Ubuntu virtual machine with Apache 2.4.7
I'm getting these errors:
apache2: Syntax error on line 216 of /etc/apache2/apache2.conf: Could not open configuration file /etc/apache2/conf-enabled/servername.conf: No such file or directory
Action 'configtest' failed.
Note: When I run
apachectl configtest, it says
But there is such a file! In fact, Apache found it all by itself. Line 216, mentioned above, is
IncludeOptional conf-enabled/*.conf. So I guess it formed a shell expansion and got the list of conf files and then decided one of them didn't exist. Why?
As everyone knows, in
/etc/apache2/conf-enabled are a bunch of symlinks to files in
/etc/apache2/conf-available, created with
In my case,
conf-available is itself a symlink, pointing to one of a set of my own configuration files (for apache and other services) for setting up virtual machines. For some reason, even though Apache is finding the symlink, it is reporting it doesn't exist. I don't see why it's a problem, since there is another symlink there that phpMyAdmin uses to link to its config files and causes no error.
One difference between the phpMyAdmin file and mine is that my file (and all of its parent directories) has 777 permissions. It is in a shared folder mounted from outside the virtual machine (shared with the Windows 8.1 host).
Does Apache have a problem with 777 permissions in config files?
ls -l output asked for in a comment.
vagrant@vagrant-ubuntu-trusty-64:/vagrant/data$ ls -l /etc/apache2/conf-enabled/servername.conf
lrwxrwxrwx 1 root root 33 Jun 29 2016 /etc/apache2/conf-enabled/servername.conf -> ../conf-available/servername.conf
And here's the symlink of the symlink:
vagrant@vagrant-ubuntu-trusty-64:/etc/apache2/conf-available$ ls -l servername.conf
lrwxrwxrwx 1 root root 31 Jun 29 2016 servername.conf -> /vagrant/config/servername.conf
And here's the regular file:
vagrant@vagrant-ubuntu-trusty-64:/vagrant/config$ ls -l servername.conf
-rwxrwxrwx 1 vagrant vagrant 24 Jun 29 2016 servername.conf