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

I've setup the following in my virtual hosts:

<VirtualHost app.pdf-edelivery.com>
ServerName app.pdf-edelivery.com
DocumentRoot /home/pdfedelivery/public_html/site
<Directory "/home/pdfedelivery/public_html/site/">
allow from all
Options +Indexes
</Directory>
</VirtualHost>

The premise is that I want to redirect app.pdf-edelivery.com to the site/ folder. Here's the issue i'm facing. I think there is some sort of conflict. If you ping app.pdf-edelivery.com it resolves to the correct IP address of my server.

About 6 records above that record (in the httpd.conf file) there is this record:

<VirtualHost pdf-edelivery.net>
DocumentRoot /home/pdfedelivery/public_html
<Directory "/home/pdfedelivery/public_html">
allow from all
Options +Indexes
</Directory>
ServerAlias www.pdf-edelivery.net pdf-edelivery.net www.pdf-edelivery.com pdf-edelivery.com www.pdfedelivery.com pdfedelivery.com www.pdfedelivery.net pdfedelivery.net www.pdfedelivery.com.au pdfedelivery.com.au
</VirtualHost>

Which I am concerned is somehow conflicting with the above record. No matter how many times I restart apache, I can't get app.pdf-edelivery.com to go to the correct site (which you can currently see at pdf-edelivery.com/site/)

Any ideas what I am missing here?

share|improve this question

2 Answers 2

Try changing the <VirtualHost ... > statements to

<VirtualHost *:80>

which will have apache respond to incoming name based virtual hosts on post 80 for all available IP addresses.

Check that you have a NameVirtualHost * (or similar) directive too

NamevirtualHost Documentation

VirtualHost Documentation

Name based virtual hosting

share|improve this answer

You should try this syntax :

<VirtualHost xx.xx.xx.xx:80> # where xx.xx.xx.xx is the IP you want Apache listen to.
ServerName pdf-edelivery.net
ServerAlias www.pdf-edelivery.net pdf-edelivery.net www.pdf-edelivery.com pdf-edelivery.com www.pdfedelivery.com pdfedelivery.com www.pdfedelivery.net pdfedelivery.net www.pdfedelivery.com.au pdfedelivery.com.au
DocumentRoot /home/pdfedelivery/public_html
<Directory "/home/pdfedelivery/public_html">
allow from all
Options +Indexes
</Directory>

</VirtualHost>
share|improve this answer

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.