12

So I upgraded Ubuntu and I went to 127.0.0.1 in Chrome and got "Oops! Google Chrome could not connect to 127.0.0.1" so I restarted Apache but was met with this error:

apache2: Syntax error on line 215 of /etc/apache2/apache2.conf: Could not open configuration file /etc/apache2/httpd.conf: No such file or directory

Action 'configtest' failed. The Apache error log may have more information. ...fail!

This is the contents of my /etc/apache2 folder:

conf.d/
mods-available/
mods-enabled/
sites-available/
sites-enabled/
apache2.conf
apache2.conf.dpkg-dist
envvars
magic
ports.conf

What's going on? How can I resolve this?

noidea
  • 123
  • 1
  • 1
  • 4
  • It appears within your /etc/apache2/apache2.conf file, the file /etc/apache2/httpd.conf is being included or referenced. Try searching for this within your /etc/apache2/apache2.conf file to see where and provide that if you require further assistance. – Andrew Ty. Apr 19 '13 at 04:33
  • I had the same problem after upgrading do Debian Wheezy, the accepted solution worked. – Petr Dec 10 '14 at 20:16

1 Answers1

15

For some reason you are missing the http.conf which usually has no content.

Please try to create it and restart your web server

touch /etc/apache2/httpd.conf

Hex
  • 1,939
  • 10
  • 17
  • I have no idea what this means but it worked. Thanks! – noidea Apr 19 '13 at 07:38
  • 1
    This means: You are creating an empty file called httpd.conf in /etc/apache2/ directory to overcome the error that prevented the apache to start because of the missing file. – Hex Apr 19 '13 at 18:56
  • In my case, on debian rasperry the apache2.conf was missing. I created one. Then I got apache2: Configuration error: No MPM loaded. I reinstalled apache2 and then finally got ` mpm_event_module (shared)` with `apache2 -M`. Now it works. – Timo Nov 05 '20 at 16:30