I have an Apache server that uses name-based virtual hosts.
NameVirtualHost *:80 <VirtualHost *:80> DocumentRoot /var/www/localhost ServerName localhost.localdomain ServerAlias localhost.localdomain ErrorLog logs/localhost_error_log CustomLog logs/localhost_access_log common <Directory /var/www/localhost1> Order Allow,Deny Allow from all </Directory> </VirtualHost> <VirtualHost *:80> ServerName localhost1.localdomain ServerAlias localhost1.localdomain DocumentRoot /var/www/localhost1 ErrorLog logs/localhost1_error_log CustomLog logs/localhost1_access_log common <Directory /var/www/localhost1> Order Allow,Deny Allow from all </Directory> </VirtualHost>
When I type localhost.localdomain and localhost1.localdomain, I get the correct pages from the / var / www / localhost and / var / www / localhost1 folders respectively. But then I do
ssh -L 0.0.0.0:10080:localhost.localdomain:80 -L 0.0.0.0:10081:localhost1.localdomain:80 localhost
Both localhost: 10080 and localhost: 10081 both result in a response from / var / www / localhost. Is it possible that Apache recognizes domains despite connecting through an SSH tunnel?
source share