I'm trying to setup a couple of Virtual Host files on my Localhost PC running Fedora Core 15.
Now I get this working, but now onloy one Virtual Host site works, and if I type in 127.0.0.1/test/testApp.php which is not related to the Virtual Host site , I get redirected to the Virtual Host site.
Here's what I did.
- I created a new folder called virtualhosts in /etc/httpd/ where all my host files are stored in the following format site.conf
- In /etc/conf/httpd.conf I enabled
NameVirtualHost *:80and included the host files at the bottom of the config page like this
- In /etc/hosts I added the line 127.0.0.1 website
No when I run
sudo httpd -t I get Syntax OK
I restart apache and then the Virtualhost works, but as soon as I add other hosts and only use 127.0.0.1 as above it still links to the original host.
Am I doing anything wrong here or left out something?
An example of my Virtual Host file looks like this
<VirtualHost *:80> ServerAdmin firstname.lastname@example.org DocumentRoot /var/www/html/website/ ServerName website ServerAlias website ErrorLog logs/dev-error_log CustomLog logs/dev-access_log common Alias /blog /var/www/html/blog/ <Directory /var/www/html/website/> Options FollowSymLinks Allow Override All Order allow,deny allow from all </Directory> #php_value error_reporting E_ALL & ~E_NOTICE & ~E_DEPRECATED php_flag display_errors On php_value date.timezone Europe/London </VirtualHost>