I have two domains (siteA.com & SiteB.com) that point to the same webserver and I would like to show different web pages for each.
The steps I have taken so far are:
Copy the default site (siteA) to siteB
sudo cp /etc/apache2/sites-available/default /etc/apache2/sites-available/siteB
sudo vim /etc/apache2/sites-available/siteB
<VirtualHost *:80> ServerAdmin info@siteB.com DocumentRoot /var/www/siteB <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /var/www/siteB> Options Indexes FollowSymLinks MultiViews AllowOverride FileInfo Indexes Order allow,deny allow from all </Directory> </VirtualHost *:80>
Then I created under /var/www/siteB and created a sample index.html in there.
However when I load my domain
siteB.com I still get directed to
/var/www/siteA. Why is that?
Do I have to rename the
/etc/apache2/sites-available/siteA as well?
Thanks to the answer below it seems I had forgotten next to enabling the site also another entry:
<VirtualHost *:80> ServerAdmin info@siteB.com ServerName siteB.com ServerAlias www.siteB.com </VirtualHost *:80>
in order to include all subdomains as well then do:
<VirtualHost *:80> ServerAdmin info@siteB.com ServerName siteB.com ServerAlias *.siteB.com </VirtualHost *:80>
Same goes for siteA.