Apache2 Won't Start
Asked Answered
A

3

6

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.

Allargando answered 9/10, 2013 at 13:47 Comment(15)
That doesn't look like your apache log, check /var/log/apache2 or /var/log/httpdBradeord
@Bradeord this is what i get in the command line i have managed to get to the log and there no entries for the time around when i did tryAllargando
I'm not sure I fully understand, does the file "/etc/apache2/sites-enabled/000-default" actually exist? If it does, is it a symlink or a file? If it is a symlink, what does it point to?Bradeord
@Bradeord the file does exist in the sites-enabled folder i checked it am it is a symlink. it is pointing to the ..sites-available/default the only file or folder in the sites-available folder is default-ssl do i just change this to the other file in the folder called kooserver.conf?Allargando
The symlink will need to point to something valid, if kooserver.conf is your configuration, then yes. Apache includes everything in the sites-enabled directory, and typically the sites-enabled just contains symlinks to the sites-available directory. This makes it easy to enable and disable sites by adding or removing symlinks, rather than modifying the site configuration files or file locations.Bradeord
@Bradeord i have changed it too kooserver and kooserver.conf and it still does the sameAllargando
Can you show the output of "ls -l /etc/apache2/sites-enabled" and "ls -l /etc/apache2/sites-available"?Bradeord
I have just tried this which i have just found on a forum: root@kooserver:~# sudo a2ensite default ERROR: /etc/apache2/sites-enabled/000-default is a dangling symlink! ERROR: Site default does not exist!Allargando
remove the symlink to default in the sites-enabledBradeord
root@kooserver:~# ls -l /etc/apache2/sites-enabled total 0 lrwxrwxrwx 1 root root 26 Oct 9 15:26 000-default -> ../sites-available/default lrwxrwxrwx 1 root root 43 Oct 9 14:07 kooserver.conf -> /etc/apache2/sites-available/kooserver.confAllargando
root@kooserver:~# ls -l /etc/apache2/sites-available total 12 -rw-r--r-- 1 root root 7469 Feb 7 2012 default-ssl -rw-r--r-- 1 root root 156 Oct 9 15:10 kooserver.confAllargando
@Bradeord do you mean delete the file?Allargando
yes, remove sites-enabled/default, it's not pointing to anythingBradeord
I have removed it but i now get another error: Starting web server apache2 apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName NameVirtualHost 192.168.1.22:0 has no VirtualHosts NameVirtualHost *:80 has no VirtualHosts (99)Cannot assign requested address: make_sock: could not bind to address 192.168.1.22:90 no listening sockets available, shutting down Unable to open logs Action 'start' failed. The Apache error log may have more information.Allargando
That's a whole different issue, probably best to open a new question or search existing ones for the appropriate answer on this site.Bradeord
B
4

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.

Bradeord answered 9/10, 2013 at 14:45 Comment(0)
B
4

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.

Besmear answered 9/10, 2013 at 13:59 Comment(1)
Thanks I have just looked in the sites-enabled folder and there is a file called "000-default" and in the "site-available" folder there is the following files. "default-ssl" and kooserver.confAllargando
B
4

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.

Bradeord answered 9/10, 2013 at 14:45 Comment(0)
S
2

One of the reason may be that you might have some site that is not enabled.To check that

  1. Go to /etc/apache2/sites-enabled
  2. Out of many/some [sitename].conf files , one/some may be crossed
  3. Delete those found crossed
  4. Restart apache server

    sudo service apache2 restart.

Hope this has helped you , but may be some other reason too. Thank you.

Saragossa answered 16/12, 2013 at 8:56 Comment(2)
i appreciate your attempt to answer, but try answer like answer not like comment.Cadi
I made some changes , hope this helps !!Saragossa

© 2022 - 2024 — McMap. All rights reserved.