I have a file called pga-default.conf which looks like,
<VirtualHost *:8008>
ServerName 192.168.1.10
DocumentRoot /var/www/portals/default/public
<Directory "/var/www/portals/default/public">
AllowOverride All
</Directory>
ErrorLog /var/log/httpd/default.error.log
CustomLog /var/log/httpd/default.requests.log combined
</VirtualHost>
Problem is whenever I try with http://192.168.1.10:8008 it always loads the default Apache Testing page. default.conf looks like,
Listen 8008
<VirtualHost _default_:8008>
DocumentRoot "/www/default"
</VirtualHost>
But when I change the <VirtualHost *:8008>
into <VirtualHost 192.168.1.10:8008>
in pga-default.conf it works as expected. I want to know why is this. As far as I know, this is because the server doesn't pick the VirtualHost as the best match for the particular IP address and port. (This answer confirms that difference between _default_:* and *:* in VirtualHost Context)
I tried several other methods as well, but none of them worked except the above-mentioned method. Following are the other methods. (Changes for pga-default.conf)
- Change
ServerName 192.168.1.10
toServerName 192.168.1.10:8008
- Used
ServerAlias 192.168.1.10
Note - With the above configuration <VirtualHost *:8008>
some of my colleagues have received successful results. This problem occurred only for me.
What have I missed here? How come others getting the expected results while I am not?