<VirtualHost *:441>
	ServerName ucm.dev
	ServerAlias ucm au.ucm.dev us.ucm.dev opal2.ucm.dev
	DocumentRoot "/var/www/ucm"
	ServerAdmin sam@ucm.dev
	ErrorLog logs/ucm-error_log
	CustomLog logs/ucm-access_log combined
	ScriptAlias /x/ /var/www/ucm/x/
	ScriptAlias /a/ /var/www/ucm/a/
	AddHandler cgi-script .cgi
	AddType text/plain .b .bb .bh .bbh .b1 .c .cc .h .sh .pl .py
	<Directory "/var/www/ucm">
		Options +Indexes
		Options +FollowSymLinks -SymLinksIfOwnerMatch
		Require all granted
		AllowOverride All
	</Directory>
	<Directory "/var/www/ucm/x">
		AllowOverride None
		Options +ExecCGI -MultiViews
		Options +FollowSymLinks -SymLinksIfOwnerMatch
		Require all granted
	</Directory>
	<Directory "/var/www/ucm/a">
		AllowOverride None
		Options +ExecCGI -MultiViews
		Options +FollowSymLinks -SymLinksIfOwnerMatch
		AuthName "Admin Only"
		AuthType Basic
		AuthUserFile /var/www/ucm/.htpasswd
		Require valid-user
	</Directory>
	<Directory "/var/www/ucm/logout">
		AllowOverride None
		authname "Admin Only"
		authtype basic
		authuserfile /var/www/ucm/logout/.htpasswd
		require valid-user
	</Directory>
	<Directory "/var/www/ucm/log">
		AllowOverride None
		authname "admin only"
		authtype basic
		authuserfile /var/www/ucm/.htpasswd
		require valid-user
	</Directory>
	<FilesMatch "^\.">
		order allow,deny
		deny from all
	</FilesMatch>

	ProxyRequests Off
	ProxyPreserveHost On
	ProxyVia Full
	<Proxy *>
		Require all granted
	</Proxy>
	<Location /ssh/>
		ProxyPass http://127.0.0.1:2222/ssh/
		ProxyPassReverse http://127.0.0.1:2222/ssh/
	</Location>

	AddDefaultCharset utf-8
	RewriteEngine on
	RewriteRule ^/math/(.*)$ https://sam.try.coach/$1 [L]
	RewriteRule ^/d/(.*)$ https://dilbert.com/strips/comic/$1 [L]
	RewriteRule ^/c(15|30|60)$ https://calendly.com/ultracodemonkey/$1min [L]
	RewriteRule ^/resume(.*)$ https://sam.ucm.dev/resume$1 [L]
#	RewriteRule ^/sam$ https://sam.aiki.info/ [L]
	SSLCertificateFile /etc/letsencrypt/live/ucm.dev/fullchain.pem
	SSLCertificateKeyFile /etc/letsencrypt/live/ucm.dev/privkey.pem
	Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
<VirtualHost *:441>
	ServerName www.ucm.dev
	DocumentRoot "/var/www/ucm"
	ServerAdmin sam@ucm.dev
	ErrorLog logs/ucm-error_log
	CustomLog logs/ucm-access_log combined
	RewriteEngine on
	RewriteRule (.*) https://ucm.dev%{REQUEST_URI} [L]
	SSLCertificateFile /etc/letsencrypt/live/ucm.dev/fullchain.pem
	SSLCertificateKeyFile /etc/letsencrypt/live/ucm.dev/privkey.pem
	Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
<VirtualHost *:441>
	ServerName ultracodemonkey.com
	ServerAlias www.ultracodemonkey.com
	DocumentRoot "/var/www/ucm"
	ServerAdmin sam@ucm.dev
	ErrorLog logs/ucm-error_log
	CustomLog logs/ucm-access_log combined
	RewriteEngine on
	RewriteRule (.*) https://ucm.dev%{REQUEST_URI} [L]
	SSLCertificateFile /etc/letsencrypt/live/ultracodemonkey.com/fullchain.pem
	SSLCertificateKeyFile /etc/letsencrypt/live/ultracodemonkey.com/privkey.pem
	Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
<VirtualHost *:80>
	ServerName ucm.dev
	ServerAlias ultracodemonkey.com
	ServerAlias www.ultracodemonkey.com
	ServerAlias ucm au.ucm.dev us.ucm.dev opal2.ucm.dev
	DocumentRoot "/var/www/ucm"
	ServerAdmin sam@ucm.dev
	ErrorLog logs/ucm-error_log
	CustomLog logs/ucm-access_log combined
	RewriteEngine on
	RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L]
</VirtualHost>
