Welcome to WebmasterWorld Guest from

Forum Moderators: travelin cat

Message Too Old, No Replies

Using Mac server locally not shared

Is it possible?

4:32 pm on Mar 19, 2008 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Dec 5, 2002
posts: 1318
votes: 0

OK, Mac newbie since August 2007 here so be gentle. :-) I've just learnt from a website how to turn on PHP and Apache on Mac OS X Leopard, which works great. But I had to turn on Web Sharing from the System Preferences to do it. I then found other machines on the network we use were able to view the Apache default page I have. How do I make the server so it is only viewable on this Mac?

I used XAMPP before on a PC and it was (AFAIK!) only accessible via "localhost". But I see my PHP scripts are also using that address on the Mac, and I'm worried that they won't be secure while I test files locally if other machines can access them too.

The only solution I can think of is to run a check for the IP address every time the files are loaded and limit it to just my machine. But surely that's not necessary? There must be an easier way!

Forgive me if I'm overlooking something obvious.

Paranoid of England.

5:34 pm on Mar 20, 2008 (gmt 0)

Preferred Member

10+ Year Member

joined:Oct 19, 2001
votes: 0

You need to change the configuration file for Apache to only listen to localhost:

open /private/etc/apache2/httpd.conf

change these two lines:

Listen 80


#Listen 80

3:45 pm on Mar 26, 2008 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Dec 5, 2002
votes: 0

That's great! Thanks!
7:46 am on Apr 4, 2008 (gmt 0)

New User

5+ Year Member

joined:Apr 4, 2008
posts: 1
votes: 0

You can also check out Mamp. It will allow you to do a sandbox install of Apache, Php and mySql. It's an easy install, and does not require mucking around in terminal.



Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members