Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I can't seem to get my virtual hosts working:

I have an /etc/apache2/users/scottr.conf set up as:

<Directory "/Users/scottr/Sites/">
       Options Indexes MultiViews FollowSymLinks
       AllowOverride All
       Order allow,deny
       Allow from all
</Directory>

I then have my /etc/apache2/extra/ set up as:

 <VirtualHost *:80>
    ServerName localhost
    DocumentRoot "/Users/scottr/Sites/"
 </VirtualHost>

 <VirtualHost *:80>
    ServerName whatever
    DocumentRoot "/Users/scottr/Sites/work/whatever/"
 </VirtualHost>

http://localhost works fine, but I can't get http://whatever/ to work at all.

Seems pretty basic.

What am I missing?

/var/log/apache2/error_log doesn't show any entries if I go to http://whatever/

/etc/apache2/httpd.conf is default:

# User home directories
Include /private/etc/apache2/extra/httpd-userdir.conf

# Real-time info on requests and configuration
#Include /private/etc/apache2/extra/httpd-info.conf

# Virtual hosts
Include /private/etc/apache2/extra/httpd-vhosts.conf

# Local access to the Apache HTTP Server Manual
Include /private/etc/apache2/extra/httpd-manual.conf

# Distributed authoring and versioning (WebDAV)
#Include /private/etc/apache2/extra/httpd-dav.conf

# Various default settings
#Include /private/etc/apache2/extra/httpd-default.conf

/etc/apache2/extra/httpd-userdir.conf :

Include /private/etc/apache2/users/*.conf

-- Scott

share|improve this question

1 Answer 1

up vote 0 down vote accepted

Do you have an entry for whatever in /etc/hosts?

e.g.

127.0.0.1  whatever
share|improve this answer
    
Doh! Yes, that's it. So, what does an app, like MAMP do for these? Is that app writing to the host file as well? –  Scott Oct 14 '13 at 19:17
    
I'm not familiar with MAMP, but a quick look at the docs doesn't say anything about having to manually add local DNS entries, so I'd guess yes! –  KJH Oct 14 '13 at 19:25

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.