So I'm trying to set up my site with Apache on Ubuntu 14.04.
I have created a
mydomain.com.conf
file in sites-available/
. It looks like this;
**mydomain.com.conf**
ServerName mydomain.com
ServerAlias www.mydomain.com
ServerAdmin admin@mydomain.com
DocumentRoot /var/www/mydomain.com/public_html
ErrorLog ${APACHE_LOG_DIR}/mydomain.com/error.log
CustomLog ${APACHE_LOG_DIR}/mydomain.com/access.log combined
**000-default.conf**
ServerAdmin webmaster@localhost
#DocumentRoot /var/www
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
For some reason apache doesn't seem to read mydomain.com.conf
at all, it will always default to the configuration in 000-default.conf
.
When visting my site I get a 403 Forbidden response.
1. I've enabled the site by a2ensite mydomain.com
and reloaded Apache.
2. apachectl configtest
returns Syntax OK
The error.log
file for **000-default.conf
** says
[Wed Sep 03 11:01:48.717652 2014] [autoindex:error] [pid 5869] [client 2.71.93.10:55718] AH01276: Cannot serve directory /var/www/: No matching DirectoryIndex (index.php,index.html,index.cgi,index.pl,index.xhtml,index.htm) found, and server-generated directory index forbidden by Options directive
while the error log & access log for mydomain.com
is empty.
My apache2.conf
does a IncludeOptional sites-enabled/*.conf
.
The security model in apache2.conf
looks like this;
Options FollowSymLinks
AllowOverride None
Require all denied
DirectoryIndex index.php, index.html
AllowOverride None
Require all granted
What's wrong?
Asked by William Boman
(131 rep)
Sep 3, 2014, 03:24 PM
Last activity: Mar 18, 2025, 09:37 AM
Last activity: Mar 18, 2025, 09:37 AM