I just set up Apache v2.4, PHP and MySQL on new windows machine. I've made only a few changes to httpd.conf
. I'm including httpd-vhosts.conf
, which has 2 custom sites defined (I removed the default dummy
sites from it), both of which are WordPress sites.
One of those WordPress sites has no database, and when I go to the htdocs
root directory, I see a database connection error for that site. When I comment out the DocumentRoot
line of the virtual host, the directory listing shows up again.
Here are all the Directory
-related lines from httpd.conf
(in order):
Define SRVROOT "C:/webserv/Apache24"
ServerRoot "${SRVROOT}"
<Directory />
AllowOverride none
Require all denied
</Directory>
DocumentRoot "${SRVROOT}/htdocs"
<Directory "${SRVROOT}/htdocs">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
<Directory "${SRVROOT}/cgi-bin">
AllowOverride None
Options None
Require all granted
</Directory>
And here's the virtual host that causes the issue:
<VirtualHost *:80>#gutenberg
DocumentRoot "${SRVROOT}/htdocs/gutenberg"
ServerName gutenberg.squarestarmedia.ie
ErrorLog "logs/gutenberg.localhost-error.log"
</VirtualHost>
(Note that I'm using my hosts
file to point to the ServerName).
I should mention that I'm symlinking the htdocs
directory from a different drive, but I have a very similar setup on another windows machine that is not experiencing the same issue.
How can I fix it so that htdocs
always shows the directory listing, even if a sub-directory/virtual host has an error?