I'm using XAMPP, for development purposes
Is it possible to allow access from other computers outside network?
What do i need to configure?
I assume you are using WAMPServer 2.5!
This means you are using Apache 2.4
In Apache 2.4 the syntax changed from what you are looking for to:
Require local ( For 127.0.0.1 and localhost and ::1 )
So you need to change that to allow access from anywhere to :
Require all granted
And other changes as well, you could always try reading the manual, radical I know, but it just may catch on.
Related
I have MAMP Pro 4 running on a Macbook Pro, with virtual hosts. It's working fine. I want to be able to access it from other devices on my local network in order to test various browser / os combinations. All the articles and posts I have found online are for earlier versions, and or don't seem to work, or require additional software, ... I know this is easy -- I had it working a few years ago, but I don't recall how I did it. Your help will be appreciated.
You can simply configure you projects host:
Try: http:// ip-address-of-your-MAMP-installation:8080
if it connects, fine is working.
Now the domain names. Because your are running locally and your test domains will not be resolved/routed, you need to change the "hosts" file.
Use the other Mac from where you want test.
Select "Go to Folder" and enter "/etc", there is a file called "hosts". Open it with a text editor (Wrangler,TextMate...)
Then add a line at the end:
Save it (requires the admin password).
Now enter "http:// name of the domain:8080" and it should connect you to the MAMP domain.
A more elegant way is to install a local DNS server, but that's a complete different story.
Greetings,
Peter
External network access to phpmyadmin has to be allowed specifically.
This is what I used a long time ago.
A simple solution is to use the network name of your macbook.
You can set it in the system settings.
Let say that your macbook's network name is my-macbook
Then, to acess the served website / phpMyadmin, you can simply type my-macbook.local:8888 (assuming that Mamp serves on the port 8888).
I'm very new to web server and I would like to propose to my users the capability to use Python through my website.
My main problem is that Python is not harmless, even if it is armless (sorry for this very bad play on words). So I need to use a kind of sandbox but for me this is more a concept than a technic that I can use it.
So what would be the best way to do that ?
Sandboxing
You will need support from the operating system to effectively sandbox an application.
On FreeBSD, you can use a jail. This has proven to be quite secure over the years. (While there have been vulnerabilities in this system, the concensus is that it is not possible for a program to break out of a jail without outside help. <1>)
On Linux you can use LXC.
On MS-Windows you could use sandboxie.
Have a look at the comparison of virtualization technologies before deciding what to do. Personally I'd suggest only using technologies that offer "root privilege isolation".
Another possibility would be to use a virtual machine. But that would probably have more overhead.
And no matter what you use, you still need the firewall on the host to redirect some traffic to the sandbox/virtual machine.
Python security
CPython itself
The source code for the standard CPython is regularly audited by coverity. In their 2012 scan they found 0.005 defects in 1000 lines of code. The average for open source projects is 0.69 defects per 1000 lines, and 1 defect/1000 lines is accepted as a good industry standard.
So CPython itself doesn't have many defects.
Web programming with Python
The OWASP Python security project has identified security concerns in the CPython source code, as well as security concerns in modules and functions.
The built-in eval() function deserves special mention here.
It executes the Python code given to it as a string without check or boundaries. So while it is sometimes very useful, this function should never ever be given untrusted input from the web!
For instance, don't be tempted to use it to give your web app a built in calculator.
Their top-10 list of web app vulnerabilities also makes for interesting reading.
<1> From the documentation;
Jails are a powerful tool, but they are not a security panacea. While it is not possible for a jailed process to break out on its own, there are several ways in which an unprivileged user outside the jail can cooperate with a privileged user inside the jail to obtain elevated privileges in the host environment.
Most of these attacks can be mitigated by ensuring that the jail root is not accessible to unprivileged users in the host environment. As a general rule, untrusted users with privileged access to a jail should not be given access to the host environment.
You can run a cgi enabled server on the local machine with a single command:
python -m http.server 8000 --cgi
It will serve whatever is in the working directory that you executed the command.
You can browse the pages served by pointing your browser to localhost:8000
If you are using python 3.4 or later, you can restrict this to the local interface so that no one from the outside can access the pages:
python -m http.server 8000 --cgi --bind 127.0.0.1
My computer is connected to our college's local network. I am able to access my django server in the same network from another computer. When I try to do the same from an outside internet connection, I get an " Webpage not found error" . I used the ip given by Whatsmyip.com to access it from outside. Also, I started the server using the command : python manage.py runserver 0:8000
Use something like:
LocalTunnel http://localtunnel.me/
Ngrok https://ngrok.com/
These create a tunnel to your localhost. You cannot host from a common IP shared by an internal network. Read more about localhost here: http://en.wikipedia.org/wiki/Localhost
Please note that the tools above allow you to share a link to your site and is mostly meant for development and testing. If you really want to host a Django server, either do it on an external server or contact your infrastructure team in college to see if they even allow such a thing.
For external hosting, Heroku (https://www.heroku.com) can be a good option with a reasonable free plan.
This depends on your college network. Often, computers in local networkds are behind a NAT (one single external ip for several clients). At this point, the request cannot be routed from out- to inside. Maybe a college technician can help you to route your page.
I think it's first important to note that manage.py runserver is for local development. It is not meant to be used for deployment.
If you want to access your website from "outside", you should consider deploying it. You can then read more about this here : https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/
Also, like stated in other answers, depending on how is configured your college network, it may not be possible to access your development server from outside, because :
It probably has NAT rules for local networks
There are probably port restrictions and a firewall for outside access (usually college networks are very restrictive from inside AND from outside)
I am a GIS tech trying to get migrate to Geoserver, unfortunately I am not very savvy on web hosting.
I installed the Windows version 2.3.1.
I was able to build by map and access it through localhost:8080\geoserver\www\
I take that to mean that the jetty server it working.
I understand that I should be able to replace my local IP address where "localhost" is and be able to access it from another computer via Http.
I can't figure out the next step. I have found great tutorials on every part of geoserver process except this. And the user guide does not get into this either.
My set up: Cable Modem > Router > PC with Geoserver
What I have tried: Setting up a virtual server on my router. I have tried changing by router to inbound port 8080 to private port 8080
I also tried 80 to 8080
and 80 to 80
I also tried windows firewall exception. and turning off windows firewall.
I read about using appache tomcat but I have not installed it because it seems that jetty is working (at least as a local host) and I don't want to put another program on 8080. And to my understanding it can work stand alone but I really honestly don't know no.
I am must be missing some vital piece of information on how to do this. I am hoping it is just so basic that it wasn't worth mentioning on tutorials.
Thanks
Karin
This would be a GeoServer configuration question, but since its deployed in jetty the solution is likely in the underlying jetty configuration. That being said it is a guess on my part (the jetty side of things) how they set up this distribution, but if you find a jetty.xml file, perhaps under an /etc directory then you should be able to edit that file and set a proper host in the configuration.
Seriously though, this has to be a pretty common GeoServer question so I bet they have some documentation floating around for setting this properly in their software distribution.
http://docs.geoserver.org/latest/en/user/webadmin/basics.html
That seems to indicate it might be dependent on your container configuration, in which case look through how ever they are configuring jetty for a Host setting that is likely hardcoded to 'localhost'
I created a web app with Django and I have it running on localhost (http://127.0.0.1:8000/), my question is, how can I make it available to the world, using Mac OS X's web sharing or something?
Thanks!
While you start the server specify the public ip or for any ip use 0.0.0.0
Example:
sudo python manage.py runserver 0.0.0.0:80
If you start your application without ip and port its bind only for loopback which is 127.0.0.1 and will not accessible in your network.
First off, I would strongly suggest you not to serve a website from your Mac. It's a really bad idea™. Both Mac OS X web sharing and Django's included http server (which I assume you're using) are intended for testing purposes only, for a number of reasons concerning speed, security et al. which is frankly too long to post here (but I hope that someone will :)
Second, it's already open to the world: anyone can connect to your computer using your IP address instead of the loopback 127.0.0.1 (unless you're NATted). This, again, is quite useful to test it (and have your friends/colleagues/boss) test it temporarily, but again is not fit for production use. Really.
It depends what your real purpose is, what you mean by "available to the world...or something". If you do want it to be permanently accessible from the web, you need to host it on a server (be it shared or dedicated), you won't keep your Mac turned on forever, will you? :)
For hosting Django on shared hosting - I'd recommend webfaction, step-by-step tutorials on setting up Django project can be found in their screencasts and forums (9.50$ per month for basic plan, with two months money-back guarantee, which actually works, tried myself:). More options in Djangofriendly.com
For dedicated server, ask yourself if you favor managing whole server(OS, web server, database server, memcache, firewall, backups...)yourself. If the answer is "yes", check out Linode, Rackspace, or Slicehost or even amazon web services, but bear in mind it's more expensive, it's way more complicated, but that's what gives you the ultimated flexibility. Once you are ready to try - this is one of the best tutorials i've found in net for a given subject.
If all you need is a proof of concept, that "whatever i can access from my web browser, should be accessible from anywhere in the world", ask your ISP if you are given the private IPaddress. If not, hm, better go for options mentioned above :) If you do, then find out what IP it is by visiting whatismyipaddress.com. Then start the web server as Prashanth suggested, and enter the IP address from whatismyip.org in your browser. Get nothing? a)turn off firewall of MacOSx. still nothing? b)connect your Mac directly to ethernet cable your ISP provides, without router in between. Retry entering your ouside IP in the browser. Works? great, go google "Port forwarding ", this will tell you have to configure your router to have the same effect when router is being used. Doesn't? Ask separate question in stackoverflow and provide as much details about what you are doing as you can.
Mac os Web sharing is uselless if the packets aren't routed correctly to reach your computer on a network. I guess all it can do is start apache, and open some ports in a firewall. But if your personal router or ISP wont forward external packets to your computer - you won't get what you want.
Good luck!