I have just upgraded my Ubuntu 13.10 and apache2 is not working. When I try to start the apache2 server it is printing following errors:
* Starting web server apache2 * The apache2 configtest failed.
Output of config test was:
apache2: Syntax error on line 263 of /etc/apache2/apache2.conf: Could not open configuration file /etc/apache2/conf.d/: No such file or directory
Action 'configtest' failed. 8 Answers
It was the same for me. After I created the conf.d folder still Apache 2 won't start. I was able to solve like this:
Replacing this line
LockFile ${APACHE_LOCK_DIR}/accept.lockwith this one
Mutex file:${APACHE_LOCK_DIR} defaultin
/etc/apache2/apache2.confsolved the problem.
(source)
1When creating symbolic links make sure to use absolute paths
Instead of:
ln -s ./conf-available/mysite.conf ./conf-enabled/mysite.confYou should use :
ln -s /etc/apache2/conf-available/mysite.conf /etc/apache2/conf-enabled/mysite.conf 1 Perform a mkdir -p /etc/apache2/conf.d/. So the folder conf.d is created. Your apache2.conf file includes all files in this folder into the configuratin, and if this folder doesn't exist it run into an error. See:
user@host:~$ grep conf.d /etc/apache2/apache2.conf
Include conf.d/ For me there was and invalid shortcut inside the sites-enabled folder. Once I deleted that I could easily restart/reload apache.
Here is my full answer to the error :
- Restarting web server apache2 [fail]
- The apache2 configtest failed. Output of config test was: apache2: Syntax error on line 214 of /etc/apache2/apache2.conf: Could not open c onfiguration file /etc/apache2/httpd.conf: No such file or directory Action 'configtest' failed. The Apache error log may have more information.
- Run command
sudo mkdir conf.d - Run command
sudo touch httpd.conf - Run command
sudo vi apache2.confand replace
LockFile ${APACHE_LOCK_DIR}/accept.lock
by
Mutex file:${APACHE_LOCK_DIR} default
- Save and restart apache
Many thanks to all for you very good advice
Best regards
Dunbo
Please use the below commands
sudo mkdir /etc/apache2/conf.dReinstall the packages.
Create symbolic links
ln -s /etc/websvn/apache.conf /etc/apache2/conf-available/websvn.confEnable the websvn configuration using below command.
sudo a2enconf websvn.confEnable the dav and dav_svn modules
sudo a2enmod dav
sudo a2enmod dav_svn
sudo service apache2 reload I know this is an old thread, but I ran into this today and had forgotten how I fixed it a few years ago.
In addition to replacing:
LockFile ${APACHE_LOCK_DIR}/accept.lockwith
Mutex file:${APACHE_LOCK_DIR} defaultin the /etc/apache2/apache2.conf file, I also had to manually create the httpd.conf file in the /etc/apache2/ directory.
I also had this same problem with apache.
apache2: Syntax error on line 220 of /etc/apache2/apache2.conf: Could not open file configuration /etc/apache2/sites-enabled/000-default.conf: No such file or directory
Any consideration we are in the /etc/apache2
I solved this:
1- Knowing sites-enabled/000-default.conf is a link that points to site-available/000-default.conf, I went to check the content of sites-availables file;
And to my surprise, 000-default.conf is replaced by 000-default.conf ~ (because of gedit which always creates a backup)
2- Automatically I copy the file
$ sudo cp -v-default.conf 000 ~ 000-default.conf
3- Restart apache2
$ sudo /etc/init.d/apache2 restart
4- My server is started