Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apache2 Won't Start

I have set up ubuntu server on an old pc with webmin as well. I am not sure what was going on but i restarted the server and when it boots it now get this when Apache tries to start.

 * Starting web server apache2
apache2: Syntax error on line 237 of /etc/apache2/apache2.conf: Could not open configuration file /etc/apache2/sites-enabled/000-default: No such file or directory
Action 'start' failed.
The Apache error log may have more information.

I have checked this file on this line and it looks like this:

# Include the virtual host configurations:
Include sites-enabled/

I have removed Apache and re installed it but not sure why it still fails.

like image 419
Ryan King Avatar asked Oct 09 '13 13:10

Ryan King


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.


2 Answers

You do not have a default site enabled:

/etc/apache2/sites-enabled/000-default: No such file or directory

site-enabled should contain symlinks to files in site-available and I guess your 000-default symlink does not link to a real file in site-available.

I guess this Ubuntu guide might be of interest for you.

like image 42
Qben Avatar answered Oct 26 '22 12:10

Qben


As also answered by Qben, the issue was an invalid symlink in the sites-enabled folder. Removing the broken symlink and adding a valid one will fix the issue.

like image 60
emsworth Avatar answered Oct 26 '22 12:10

emsworth