Apache HTTP Server Configuration Examples
example.com 192.168.0.11 test.com 192.168.0.11
example.com 192.168.0.11 test.com 192.168.0.12
Listen 443 Listen 80 NameVirtualHost *:80 NameVirtualHost *:443 ServerName *:80 <virtualhost *:80 *:443> ServerName example.com DocumentRoot /var/www/example.com </virtualhost> <virtualhost *:80 *:443> ServerName test.com DocumentRoot /var/www/test.com </virtualhost>
NameVirtualHost *:443 <VirtualHost *:443> DocumentRoot /var/www/html/example ServerName www.exammple:443 SSLEngine on SSLCertificateChainFile /etc/httpd/conf/chain.cer SSLCertificateFile "/etc/httpd/conf/www.crt" SSLCertificateKeyFile "/etc/httpd/conf/www.key" ErrorLog /var/log/httpd/error_log TransferLog /var/log/httpd/access_log </VirtualHost>
Listen 80 BindAddress 192.168.0.11 192.168.0.12 <VirtualHost 192.168.0.11> ServerName www.sample1.com DocumentRoot /var/www/sample1 ErrorLog logs/sample1_error_log TransferLog logs/sample1_access_log </VirtualHost> <VirtualHost 192.168.0.12> ServerName www.sample2.com DocumentRoot /var/www/sample2 ErrorLog logs/sample2_error_log TransferLog logs/sample2_access_log </VirtualHost>