Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

davidje13

macrumors member
Original poster
Dec 4, 2007
31
0
Warwick, UK
Hi,

I want to make a simple sandbox on my mac for testing scripts using localhost, but I don't want it available to the network or internet. Is this possible?
 
One way would be to edit the Apache configuration file httpd.conf to only allow from localhost. Also, if you have a router it can block the traffic.
 
I don't actually own the router (I'm on a university network) and the main reason I want to prevent it being available on the network is because the IT department doesn't allow "any machines running server operating systems or services e.g DHCP, DNS, web servers etc".

So would only allowing from localhost prevent it from interfering with the network entirely? if so, how do I do this? (In my quick scan of the httpd.conf file I can't see anything to do with access)
 
I don't actually own the router (I'm on a university network) and the main reason I want to prevent it being available on the network is because the IT department doesn't allow "any machines running server operating systems or services e.g DHCP, DNS, web servers etc".

So would only allowing from localhost prevent it from interfering with the network entirely? if so, how do I do this? (In my quick scan of the httpd.conf file I can't see anything to do with access)

Search for a line that starts with "Listen" Then you can set it for 127.0.0.1:80 or localhost.

http://www.usenet-forums.com/apache-web-server/9685-how-only-allow-access-localhost.html said:
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, in addition to the default. See also the <VirtualHost>
# directive.
#
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses (0.0.0.0)
#
#Listen 12.34.56.78:80
Listen 127.0.0.1:80

The university should have no problems with this at all.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.