Code: |
Listen 192.168.1.12:80 NameVirtualHost 192.168.1.12:80 <VirtualHost 192.168.1.12:80> DocumentRoot "/Apache22/htdocs" ServerName serverone.tld ErrorLog "/Apache22/logs/serverone-error.log" CustomLog "/Apache22/logs/serverone-access.log" combined </VirtualHost> <VirtualHost 192.168.1.12:80> DocumentRoot "/Apache22/htdocs" ServerName 192.168.1.12 ErrorLog "/Apache22/logs/192.168.1.12-error.log" CustomLog "/Apache22/logs/192.168.1.12-access.log" combined </VirtualHost> |
Code: |
LogFormat "Host:%{Host}i|CServerName:%v| %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined |
Code: |
Host:serverone.tld|CServerName:serverone.tld| 192.168.1.12 - - [13/Feb/2016:11:27:23 +0000] "GET / HTTP/1.1" 304 - Host:192.168.1.12|CServerName:serverone.tld| 192.168.1.12 - - [13/Feb/2016:11:28:22 +0000] "GET / HTTP/1.1" 304 - |
Quote: |
...when a request arrives, the server will first check if it is using an IP address that matches the NameVirtualHost. If it is, then it will look at each <VirtualHost> section with a matching IP address and try to find one where the ServerName or ServerAlias matches the requested hostname. If it finds one, then it uses the configuration for that server. If no matching virtual host is found, then the first listed virtual host that matches the IP address will be used. |
Code: |
Listen 80 NameVirtualHost *:80 <VirtualHost *:80> DocumentRoot "/Apache22/htdocs" ServerName serverone.tld ErrorLog "/Apache22/logs/serverone-error.log" CustomLog "/Apache22/logs/serverone-access.log" combined </VirtualHost> <VirtualHost *:80> DocumentRoot "/Apache22/htdocs" ServerName 192.168.1.12 ErrorLog "/Apache22/logs/192.168.1.12-error.log" CustomLog "/Apache22/logs/192.168.1.12-access.log" combined </VirtualHost> |
Code: |
Host:serverone.tld|CServerName:serverone.tld| 192.168.1.12 - - [13/Feb/2016:11:37:48 +0000] "GET / HTTP/1.1" 304 - |
Code: |
Host:192.168.1.12|CServerName:192.168.1.12| 192.168.1.12 - - [13/Feb/2016:11:37:38 +0000] "GET / HTTP/1.1" 304 - |