Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed Apache2 start, no error log

I would restart Apache2 but there comes an Error

$ sudo service apache2 start  Starting web server apache2  Action 'start' failed. The Apache error log may have more information. 

But all error logs in "/var/log/apache2/" are empty.

Edit: The Files are at "/var/log/apache2" and there are several entries from previous Problems but this Task doesn't create any new etry ...

Where is the Problem?


I've Solved the Problem!

It was a error in the SSL Certificate and the path to the "error.log" are changed in the vHost configuration.

If you don't need SSL (i don't because i'm running a local system) simply disable all vHost HTTPS/SSL entrys in the configuration by command line for line out.

like image 566
fechnert Avatar asked Sep 24 '13 07:09

fechnert


People also ask

Why is my Apache server not starting?

There are several reasons your Apache server might fail to run. Something could be blocking the port it uses; there could be another instance of Apache already running; or there might be an incompatibility with the version of PHP you're using in MAMP.

Why my apache2 is not working?

If your system wasn't able to restart Apache2 you most likely got some form of an error message. In case you got a reply resembling either one of the output examples below, the service is most likely not properly installed on your system or some files are missing. Failed to restart apache2. service: Unit apache.

Where is the apache2 error log?

On a Linux server, you can access Apache error logs from var/log/apache2/error. log. You can then log out the errors from the error log file by writing the following command: sudo tail -f /var/log/apache2/error.


2 Answers

I also just ran in to a similar problem, that is service apache2 reload fails but prints no useful information. This is because the script in /etc/init.d/apache (on Debian, at least) eats the output of the apache2ctl configtest command it runs to sanitize the Apache config.

An easy solution to get a more meaningful explanation for the failure is to run apache2ctl configtest again yourself, which will print the (hopefully useful) error messages to the console.

like image 105
pix Avatar answered Oct 20 '22 01:10

pix


Syntax errors in the config file seem to cause problems. I found what the problem was by going to the directory and excuting this from the command line.

httpd -e info  

This gave me the error

Syntax error on line 156 of D:/.../Apache Software Foundation/Apache2.2/conf/httpd.conf: Invalid command 'PHPIniDir', perhaps misspelled or defined by a module not included in the server configuration 
like image 27
Toby Allen Avatar answered Oct 20 '22 00:10

Toby Allen