0

I currently have example.com pointing to Server one. I wanted to server example.com from a different directory ( /WebData )

I did this by editing httpd.conf

http://pastebin.com/UjHhRNTX

I this works as desired.

I then found out I needed to add website.org to the server. So I mounted another disk and created a dir called /WebDataWebsite

and created /etc/httpd/conf.d/websiteorg.conf with the following VHost:

http://pastebin.com/GTmqtABf

<VirtualHost *:80>
       DocumentRoot "/WebDataWebsite"
       ServerName website.org
       ServerAlias www.website.org
       <Directory "/WebDataWebsite">
               Require all granted
       </Directory>
</VirtualHost>

For some reason all traffic to example.com and website.org were both directed to index.htm in /WebDataWebsite

What I am doing wrong? How to I make /WebData (in httpd.conf) the default website but filter by servername website.org with the VHost?

1 Answer 1

1

Once you define a first vhost on port *:80, all your port 80 traffic is handled by that vhost as opposed to the base webserver configuration.

Usually the best way to proceed is to create two *:80 vhosts. The first one defined is the default will cover everything your base config used to handle -- the second specifies ServerName/ServerAlias to capture the stuff you intended to customize.

Check your work with apachectl -S

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .