« MIT Hacks | Main | Lock your screen in OS X »

May 19, 2003

Virtual Hosts on OS X

Here’s an article by Patrick Crowley over at MacDevCenter talking about setting up Virtual Host directories with Apache on OS X, and getting PHP to work with them. You’ve been able to do this for a while now, but I haven’t bothered to get it all working together yet. Once I do, it will be much easier to test sites locally without having to mess with our Linux web server every time I start a new site. Plus, once I break down and buy that shiny, new PowerBook, I will be able to do my dev work from anywhere (even without a web connection). Sweet.

Posted by paullheureux at May 19, 2003 11:37 AM

Comments

I read the article you linked to but there is one flaw with setting up virtual hosts this way.

First the httpd.conf file. I am running 10.2.6 on my 15” tibook. I wasn’t able to call 127.0.0.1, I had to have the virtual hosts listed like the following, one for each virtual host, using * instead of 127.0.0.1


DocumentRoot /full/path/to/web/files
ServerName hostnamegoeshere

Then use the easy NetInfo Manager app in the Utilities folder.

Open it, click on machines duplicate localhost, rename the duplicate with the same name as the virtual host you added to the httpd.conf file.
new Click the lock to save your changes and your almost done. Go to your system prefs, clcik on sharing and restart apache. Or type apachectl restart from the command line.

Posted by: Kody at May 19, 2003 11:55 AM

Thanks for the info, Kody. Always good to know how it is “really” done.

Posted by: fargoboy at May 19, 2003 02:06 PM

Post a comment




Remember Me?