Ubuntu – apache2 service not restarting rails ubuntu

ruby-on-railsUbuntu

When I type:

sudo /etc/init.d/apache2 restart

… or:

service apache2 restart

… I get the following error:

Job for apache2.service failed. See "systemctl status apache2.service" and "journalctl -xe" for details.`

When I type systemctl status apache2.service, this is the result:

apache2.service - LSB: Apache2 web server
   Loaded: loaded (/etc/init.d/apache2)
   Active: failed (Result: exit-code) since Thu 2015-08-27 21:18:25 PDT; 3min 1s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 20754 ExecStop=/etc/init.d/apache2 stop (code=exited, status=0/SUCCESS)
  Process: 20863 ExecStart=/etc/init.d/apache2 start (code=exited, status=1/FAILURE)

And typingjournalctl -xe says No journal files were found

Can anyone help?

Best Answer

I had a similar problem today, I was running apache 2.4.10-10+deb8u1, but my virtualhost was a copy from a server running 2.2.16-6+squeeze15, and I found one line that was no longer working,

Require Valid-user

needed to be changed to

Require valid-user

(CAPS removed), and this made my apache run again.

I found this error in /var/log/syslog (on debian 8). it gave me the line number of the error vhost, and that lead me to this fix for me. I am not sure why the V was capital on my old vhost, but it seems to work on 2.2 but not on 2.4 so I suggest that you look in your syslog to see if you can find out what your error is.

Related Topic