Index

Table of contents

Apache

forward /[path] to port 9300
touch conf.d/monitoring.conf
vi conf.d/monitoring.conf

ServerName example.com
<VirtualHost *:80>
  <IfModule mod_proxy_ajp.c>
     ProxyPass /[path] http://localhost:9300
     ProxyPassReverse /[path] http://localhost:9300
   </IfModule>
</VirtualHost>
Whitelist IP's
<Location /[path]>
		Order deny,allow
		Deny from all
		Allow from 10.10.10.10
	</Location>
Install SSL
SSLCertificateFile /[path]/apache2/conf/ssl/[base_name].pem
	SSLCertificateKeyFile /[path]/apache2/conf/ssl/[base_name].pem
        SSLCACertificateFile /[path]/apache2/conf/ssl/[base_name].crt
Redirect traffic to HTTPS
<VirtualHost _default_:80>
    ServerName redirect.example.com
    Redirect permanent / https://example.com/
</VirtualHost>
Error Documents
ErrorDocument 503 /503.html

mod_rewrite

load module
LoadModule rewrite_module modules/mod_rewrite.so
change log level
LogLevel alter rewrite:trace[1-8]
basic rewrite example
RewriteRule "^index\.html$"  "welcome.html"
external redirect
RewriteRule "^index\.html$"  "https://www.duckduckgo.com" [R]
dont process any other rules (last)
RewriteRule "^index\.html$"  "welcome.html" [L]
rewrite with capturing group
RewriteRule ^/([^/]*)/(.*)$ /$2/$1 [R,L]

apache docker

restart apache from within container
/usr/local/apache2/bin/apachectl restart