Testing virtual host creation
Hi,
I have created 3 virtual hosts within my virtual machine. The DocumentRoot for two of the virtual machines are located in /var/www/vhosts. The name of these two virtual hosts (ServerName) are beta.example.com & example.com. The index.html contents for both these servers are "COFFEE!" and "COKE!" respectively. The 3rd virtual host is located in a directory called /website. I created an index.html for this virtual host in /website with the content "OMG SO NON STANDARD". The SELinux setting for the /website directory was originally : Code:
# ls -Z / | grep website Code:
# chcon --reference=/var/www /website/ Code:
# curl non.example.com I then add all three virtual hosts beta.example.com, example.com and non.example.com into /etc/hosts, the same line as localhost. I then restart httpd, and when I do the 'curl' command : Code:
# curl non.example.com Code:
# curl non.example.com Code:
# curl non.example.com If so then why does using curl on non.example.com give the output COFFEE! which is the content of beta.example.com? |
Quote:
Code:
curl --header 'Host: beta.example.com' http://localhost Code:
curl --resolve beta.example.com:80:127.0.0.1 http://beta.example.com/ |
All times are GMT -5. The time now is 12:06 AM. |