I want to have multiple domains on my apache2.2 local server on Linux. I have edited the httpd.conf and inserted these codes after going through various posts on the internet.
NameVirtualHost *:80
<VirtualHost *:80>
ServerName localhost
DocumentRoot /home/jharvard/vhosts/localhost
</VirtualHost>
<VirtualHost *:80>
ServerName ratnesh
DocumentRoot /home/jharvard/vhosts/ratnesh
</VirtualHost>
the html folder is inside the 'localhost' and 'ratnesh' folders for each case. Then I edited the /etc/hosts files as follows:
127.0.0.1 localhost localhost.localdomain
127.0.0.1 ratnesh ratnesh.localdomain
127.0.0.1 appliance appliance.localdomain
Then I restarted the apache service. But of no help. When i try to visit localhost I am getting 403 FORBIDDEN error. And for visiting the ratnesh domain, it directs me to the google search. Furthermore, when i am removing the edited code (written above) from the 'httpd.conf' the localhost works fine but ratnesh doesn't. Stuck on this problem for a week and am really frustrated now.
Hope you'll help. Thanks.
Regards,
Ratnesh