Setting-up Virtual host on RHEL-based Apache Server - domain is pointing on a wrong project

13 Views Asked by At

I originally have one website (webproject1) that is being served by my server. I wanted to add another website (webproject2) on that same server so I set-up the Virtual hosts.

I created 2 config files for the 2 websites. Below are the commands and content of each file.

sudo nano /etc/http/conf.d/webproject1.conf

<VirtualHost *:80>
ServerName webproject1.example.com
ServerAlias www.webproject1.example.com
DocumentRoot /var/www/html/project1
</VirtualHost>

sudo nano /etc/http/conf.d/webproject12.conf

<VirtualHost *:80>
ServerName webproject2.example.com
ServerAlias www.webproject2.example.com
DocumentRoot /var/www/html/project2
</VirtualHost>

But when I try to visit www.webproject1.example.com, it is displaying the content of project2.

I am new at managing the server and I already search a lot but cannot find any answer. Your help will be much appreciated.

0

There are 0 best solutions below