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 set up my subdomain with my registrar of "test" point to my server ip. Everything connects and the subdomain works, but it's pointing to /var/www/html instead of /var/www/test

I restarted apache and checked the logs. I'm confused:

<VirtualHost *:80>
    ServerName www.test.example.com
    ServerAlias test.example.com
    DocumentRoot "/var/www/test/"
</VirtualHost>

Note that this has it's own conf file and the permissions are correct for /var/www/test - I also put in an index.php with dummy text to check it. No luck

Any input is appreciated!

share|improve this question
    
Should I put this in httpd.conf rather than it's own conf file? –  user1062058 Sep 24 '12 at 20:36
add comment

1 Answer

up vote 1 down vote accepted

You can only put this in its own .conf file if httpd.conf is including it.

Firstly, start by putting it at the bottom of your httpd.conf, that'll ensure you at least have the right one.

Once it works, you can see what directory apache includes by looking for an Include directive. If there isn't one, add it. There should be one like Include conf.d/*.conf - this means you can put it in your conf.d folder and as long as it has an extension of .conf, it'll be included by httpd.conf.

Note that you will need to have NameVirtualHost in order to use <VirtualHost>s.

share|improve this answer
    
Thanks, that did it! –  user1062058 Sep 25 '12 at 0:58
add comment

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.