Forum Moderators: phranque
<VirtualHost 127.0.0.1:12345>
ErrorDocument 400 "unauthorised"
ServerName 127.0.0.1 wol.example.org
ServerAdmin example@admin.org
DocumentRoot /var/www/wol/
<Location />
ErrorDocument 400 "."
Order allow,deny
Allow from all
AuthType Basic
AuthName "Restricted - Authorised use ONLY"
AuthBasicProvider file
AuthUserFile "/etc/apache2/passwd.dat"
Require user userA
</Location>
# redirect everything to /wol.php
#http://moz.com/learn/seo/redirection
#http://serverfault.com/questions/32513/url-redirect-to-another-page-on-the-same-site
#RewriteEngine On
#RewriteCond %{REQUEST_URI} !=/wol.php
#RewriteRule ^ /wol.php [R=301]
#RedirectMatch permanent !^/wol.php https://127.0.0.1:10013/wol.php
#Im unsure about regex expressions, I hope this is correct to prevent looping
RedirectMatch permanent !https://127.0.0.1:12345/wol.php https://127.0.0.1:123456/wol.php
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order deny,allow
Deny from all
</Directory>
LogLevel info
CustomLog ${APACHE_LOG_DIR}/access.log combined
ErrorLog ${APACHE_LOG_DIR}/error.log
SSLEngine on
SSLCertificateFile /etc/ssl/localcerts/server.side.SSL.certificate.crt
SSLCertificateKeyFile /etc/ssl/localcerts/server.side.SSL.certificatekey.key
<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory /usr/lib/cgi-bin>
SSLOptions +StdEnvVars
</Directory>
#MSIE 6 and older cannot use keepalive
BrowserMatch "MSIE [2-6]" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
# MSIE 7 and newer should be able to use keepalive
BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
</VirtualHost>
ProxyRequests Off
ProxyVia Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass /wol https://127.0.0.1:12345/
ProxyPassReverse /wol https://127.0.0.1:12345/
<Location /wol>
ErrorDocument 400 "."
Order allow,deny
Allow from all
AuthType Basic
AuthName "Restricted - Authorised use ONLY"
AuthBasicProvider file
AuthUserFile "/etc/apache2/passwd.dat"
Require user userA
</Location>