Apache Examples

Apache syntax highlighting

Apache Configuration Syntax Highlighting

# Apache Configuration Example ServerRoot "/etc/apache2" Listen 80 Listen 443 LoadModule ssl_module modules/mod_ssl.so LoadModule rewrite_module modules/mod_rewrite.so ServerName example.com ServerAlias www.example.com DocumentRoot /var/www/html Options Indexes FollowSymLinks AllowOverride All Require all granted ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined # Redirect to HTTPS RewriteEngine On RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}$1 [R=301,L] ServerName example.com DocumentRoot /var/www/html SSLEngine on SSLCertificateFile /etc/ssl/certs/example.crt SSLCertificateKeyFile /etc/ssl/private/example.key SSLOptions +StdEnvVars