Welcome to WebmasterWorld Guest from 107.20.110.201

Forum Moderators: travelin cat

Message Too Old, No Replies

Using Mac server locally not shared

Is it possible?

     

Hester

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

WebmasterWorld Senior Member 10+ Year Member



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.

Yours,
Paranoid of England.

your_store

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

10+ Year Member



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 12.34.56.78:80
Listen 80

to

Listen 127.0.0.1:80
#Listen 80

Hester

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

WebmasterWorld Senior Member 10+ Year Member



That's great! Thanks!

MarcR

7:46 am on Apr 4, 2008 (gmt 0)

5+ Year Member



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.

Marc

 

Featured Threads

Hot Threads This Week

Hot Threads This Month