I'm using CentOS8
, with a bog-standard (yum install httpd php
) installation of apache and php.
I've got a configuration (/etc/httpd/conf.d/trip.mydomain.mytld.conf
) that looks like the following:
<VirtualHost *:80>
ServerName trip.mydomain.mytld
DocumentRoot /var/www/trip/public
<Directory "/var/www/trip/public">
Require all granted
</Directory>
RewriteEngine on
RewriteCond %{SERVER_NAME} =trip.mydomain.mytld
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
As a sanity check:
$ ls -la /var/www/
...
drwxr-xr-x. 10 apache root 4096 Oct 5 23:01 trip
...
$ ls -la /var/www/trip
...
drwxr-xr-x. 7 apache root 4096 Oct 6 01:07 public
...
$ ls -la /var/www/trip/public
...
-rwxr-xr-x. 1 apache root 532 Oct 5 22:04 index.php
...
To be sure it wasn't SELinux, I've disabled that and restarted the server to no avail...
No matter what I've tried, when I load trip.mydomain.mytld
, I get a 403 Forbidden, and my logs are populated with:
AH01276: Cannot serve directory /var/www/tripwire/public: No matching DirectoryIndex (index.html,index.php) found, and server-generated directory index forbidden by Options directive
I have another service running with a similar configuration that works, and I'm baffled as to what's wrong with this -- but I assume it's because the first configuration is the "default", though I'm not sure what issues that might be causing.
In case it's relevant, the result of running httpd -S
is as follows:
VirtualHost configuration:
*:443 is a NameVirtualHost
default server auth.mydomain.mytld (/etc/httpd/conf.d/auth.mydomain.mytld-le-ssl.conf:2)
port 443 namevhost auth.mydomain.mytld (/etc/httpd/conf.d/auth.mydomain.mytld-le-ssl.conf:2)
port 443 namevhost tripwire.mydomain.mytld (/etc/httpd/conf.d/tripwire.mydomain.mytld-le-ssl.conf:2)
*:80 is a NameVirtualHost
default server auth.mydomain.mytld (/etc/httpd/conf.d/auth.mydomain.mytld.conf:1)
port 80 namevhost auth.mydomain.mytld (/etc/httpd/conf.d/auth.mydomain.mytld.conf:1)
port 80 namevhost tripwire.mydomain.mytld (/etc/httpd/conf.d/tripwire.mydomain.mytld.conf:1)
ServerRoot: "/etc/httpd"
Main DocumentRoot: "/var/www/html"
Main ErrorLog: "/etc/httpd/logs/error_log"
Mutex rewrite-map: using_defaults
Mutex ssl-stapling-refresh: using_defaults
Mutex authdigest-client: using_defaults
Mutex lua-ivm-shm: using_defaults
Mutex ssl-stapling: using_defaults
Mutex proxy: using_defaults
Mutex authn-socache: using_defaults
Mutex ssl-cache: using_defaults
Mutex default: dir="/etc/httpd/run/" mechanism=default
Mutex cache-socache: using_defaults
Mutex authdigest-opaque: using_defaults
Mutex watchdog-callback: using_defaults
Mutex proxy-balancer-shm: using_defaults
PidFile: "/etc/httpd/run/httpd.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="apache" id=48
Group: name="apache" id=48