Article 5FDKR Getting apache test page instead of 403 error when I put deny from all

Getting apache test page instead of 403 error when I put deny from all

by
Red Squirrel
from LinuxQuestions.org on (#5FDKR)
Pretty much as title. So I have a sub domain that's just for a test site, so when I'm not testing it I just put a .htaccess in it with "deny from all". It should show a forbidden error or custom error if I put one, but instead it's showing the apache test page. Is there a way to force it to show the error page instead?

I was originally using basic http auth, but I've been converting everything to https using acme.sh and the basic auth is not an option anymore because it blocks the validation from working. So instead I figure a simple .htaccess is easier and when it comes time to renew the certs I'll just take it off and put it back. Eventually want to automate this better.

This is the config:

Code:<virtualhost *:80>
servername example.ca
serveralias www.example.ca example.com www.example.ca
redirect 301 / https://www.example.ca/
</virtualhost>

<IfModule mod_ssl.c>
<virtualhost *:443>
documentroot /home/example/www/example.ca/www/
servername example.ca
serveralias www.example.ca

Header always set Strict-Transport-Security "max-age=15552000; includeSubdomains;"

<directory />
options +indexes
allowoverride all
</directory>

Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /home/example/.acme.sh/example.ca/example.ca.cer
SSLCertificateKeyFile /home/example/.acme.sh/example.ca/example.ca.key
SSLCertificateChainFile /home/example/.acme.sh/example.ca/fullchain.cer
</virtualhost>
</IfModule>

# Subdomain: test.example.ca
<virtualhost *:80>
servername test.example.ca
alias "/.well-known/acme-challenge/" "/home/example/www/example.ca/www/.well-known/acme-challenge/"
redirect 301 / https://test.example.ca/
</virtualhost>

<IfModule mod_ssl.c>
<virtualhost *:443>
documentroot /home/example/www/example.ca/test/
servername test.example.ca

alias "/.well-known/acme-challenge/" "/home/example/www/example.ca/www/.well-known/acme-challenge/"

Header always set Strict-Transport-Security "max-age=15552000; includeSubdomains;"

<directory />
options +indexes
allowoverride all

</directory>

Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /home/example/.acme.sh/example.ca/example.ca.cer
SSLCertificateKeyFile /home/example/.acme.sh/example.ca/example.ca.key
SSLCertificateChainFile /home/example/.acme.sh/example.ca/fullchain.cer
</virtualhost>
</IfModule>Note that it works as is. But it's when I add the "Deny from all" instead of showing an actual errordocument or a default deny it just shows Apache test page.latest?d=yIl2AUoC8zA latest?i=_pJIFwsThr0:bUs0LmZ_Nvs:F7zBnMy latest?i=_pJIFwsThr0:bUs0LmZ_Nvs:V_sGLiP latest?d=qj6IDK7rITs latest?i=_pJIFwsThr0:bUs0LmZ_Nvs:gIN9vFw_pJIFwsThr0
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments