Apache httpd virtualhost config

Below is the Sample config for virtualhost and SSL enable for Apache httpd server.

Listen WEBHOST1A:4443
<VirtualHost *:4443>
ServerName x01ib01.abc.com 
DocumentRoot "/web/apache/WEB1A/var/www/html"

SSLEngine On
SSLProxyVerify none
SSLProxyCheckPeerCN off
SSLProxyCheckPeerName off
SSLProxyCheckPeerExpire off
SSLProxyEngine on
ProxyRequests Off
ProxyPreserveHost On
#Only TLSv1.2 enabled with below tag 
SSLProtocol -all +TLSv1.2
TraceEnable off
SSLHonorCipherOrder On
SSLCompression Off
SSLCipherSuite EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH
#Certificate configured for the site with below files 

SSLCertificateFile /web/apache/WEB1A/ssl/httpd.cer
SSLCertificateKeyFile /web/apache/WEB1A/ssl/httpd.key
SSLCACertificateFile /web/apache/WEB1A/ssl/httpd_ca.crt

RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^(DELETE|OPTIONS)
RewriteRule .* - [F]

#We can configure ProxyPass & ProxyPassReverse here to send request back to App Server 

</VirtualHost>

WEBHOST1A is the server hostname and 4443 is configured to run the web server.
Can see the SSL tags for enabling SSL Engine and SSL Proxy Engine ,SSL Certificates with SSLCertificateFile,SSLCertificateKeyFile,SSLCACertificateFile.

SSLCertificateFile --> This has Server certificate . Eigther selfsigned or Third party signed certificate
SSLCertificateKeyFile --> This has Private key 
SSLCACertificateFile --> This has CA certificates . Like root ,Intermedite and Any other CA certs for Web Server send request to Back end App Server
RewriteEngine to disable some Request methods 

Related Posts

One thought on “Apache httpd virtualhost config

Leave a Reply

Your email address will not be published. Required fields are marked *