[thelist] OS X Apache hosts, VirtualHost...I'm banging my head!

John Corry jcorry at gmail.com
Sun Jul 27 14:06:55 CDT 2008

I'm loving the Mac...

..but having a hard time making it do what I want.

VirtualHosts is giving me fits.

I have Apache/PHP/MySQL all installed and (I think) running.

I have a virtualhost set up for localhost. It points to DocumentRoot and 
<Directory> /Library/WebServer/Documents

I put info.pho in there and the phpinfo() function tells me all about 
PHP, great so far.

But I need other directories too.

I've always done this with a new VirtualHost in my httpd.conf file, like 
<VirtualHost *:80>
    DocumentRoot /Users/jcorry/web_work/phpMyAdmin
    ServerName pma.localhost.com
    <Directory /Users/jcorry/web_work/phpMyAdmin/>
        AllowOverride None
        DirectoryIndex index.php index.html
    AccessFileName .htaccess
    Options +includes

Then, I add a line to /etc/hosts/ to tell Apache to resolve the request 
for pma.localhost.com to localhost...where Apache will get it and 
resolve it to the correct DocumentRoot and <Directory>.

But it doesn't work.

When I request http://pma.localhost.com in the browser, I get a 403 
Forbidden error page...or now a 404 file not found.

What am I missing?

I'd like to be able to work on this gorgeous new computer this week, but 
at the rate I'm going it's a slim chance!

Hope you can help me out,
John Corry

More information about the thelist mailing list