httpd (no pid file) not running

hi there after i install SOGo i restart apache and this is what its tell me:

apache2.service - The Apache Webserver
Loaded: loaded (/usr/lib/systemd/system/apache2.service; enabled)
Active: failed (Result: exit-code) since Tue 2014-03-25 12:30:17 IST; 2min 25s ago
Process: 4157 ExecStop=/usr/sbin/start_apache2 -D SYSTEMD -DFOREGROUND -k graceful-stop (code=exited, status=0/SUCCESS)
Process: 3874 ExecStart=/usr/sbin/start_apache2 -D SYSTEMD -DFOREGROUND -k start (code=exited, status=1/FAILURE)
Main PID: 3874 (code=exited, status=1/FAILURE)
CGroup: /system.slice/apache2.service

Mar 25 12:30:16 linux-4v2w systemd[1]: apache2.service: main process exited, code=exited, status=1/FAILURE
Mar 25 12:30:16 linux-4v2w start_apache2[4157]: httpd (no pid file) not running
Mar 25 12:30:17 linux-4v2w systemd[1]: Failed to start The Apache Webserver.
Mar 25 12:30:17 linux-4v2w systemd[1]: Unit apache2.service entered failed state.

anyone can help me?

Please post the output of:

sudo journalctl -b -x -u apache2

This should provide a clue why it fails to start. (most likely an invalid configuration though)

What is SOGo btw, and how did you install it?

this is the output:

sudo journalctl -b -x -u apache2-- Logs begin at Tue 2014-03-25 12:29:19 IST, end at Tue 2014-03-25 12:51:07 IST. --
Mar 25 12:30:14 linux-4v2w systemd[1]: Starting The Apache Webserver...
-- Subject: Unit apache2.service has begun with start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit apache2.service has begun starting up.
Mar 25 12:30:16 linux-4v2w systemd[1]: apache2.service: main process exited, code=exited, status=1/FAILURE
Mar 25 12:30:16 linux-4v2w start_apache2[4157]: httpd (no pid file) not running
Mar 25 12:30:17 linux-4v2w systemd[1]: Failed to start The Apache Webserver.
-- Subject: Unit apache2.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- Documentation: http://www.freedesktop.org/wiki/Software/systemd/catalog/be02cf6855d2428ba40df7e9d022f03d
-- 
-- Unit apache2.service has failed.
-- 
-- The result is failed.
Mar 25 12:30:17 linux-4v2w systemd[1]: Unit apache2.service entered failed state.
Mar 25 12:48:47 linux-4v2w systemd[1]: Stopped The Apache Webserver.
-- Subject: Unit apache2.service has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- Documentation: http://www.freedesktop.org/wiki/Software/systemd/catalog/9d1aaa27d60140bd96365438aad20286
-- 
-- Unit apache2.service has finished shutting down.
Mar 25 12:49:20 linux-4v2w systemd[1]: Starting The Apache Webserver...
-- Subject: Unit apache2.service has begun with start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit apache2.service has begun starting up.
Mar 25 12:49:20 linux-4v2w systemd[1]: apache2.service: main process exited, code=exited, status=1/FAILURE
Mar 25 12:49:21 linux-4v2w start_apache2[8810]: httpd (no pid file) not running
Mar 25 12:49:21 linux-4v2w systemd[1]: Failed to start The Apache Webserver.
-- Subject: Unit apache2.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- Documentation: http://www.freedesktop.org/wiki/Software/systemd/catalog/be02cf6855d2428ba40df7e9d022f03d
-- 
-- Unit apache2.service has failed.
-- 
-- The result is failed.
Mar 25 12:49:21 linux-4v2w systemd[1]: Unit apache2.service entered failed state.



i install it from:

http://download.opensuse.org/repositories/server:/SOGo/openSUSE_13.1/

This doesn’t tell anything as well, unfortunately.

Is anything in /var/log/apache2/error_log?

Maybe the pid file cannot be created? (the error message would suggest something like this)
Could you post the output of:

ls -l /run/httpd.pid

Maybe try to delete that file. (a reboot should help as well, if that’s the issue)

this is the output:

ls: cannot access /run/httpd.pid: No such file or directory

i solve it by add mod_socache_shmcb mod_slotmem_shm.

thanks

So:

And what about /var/log/apache2/error_log?

That error message (“start_apache2[4157]: httpd (no pid file) not running”) means that you tried to STOP apache when it was not running, so it doesn’t help at all in finding out what’s wrong.
Can you please START apache and then query the status?

sudo systemctl start apache2.service
sudo systemctl status apache2.service

Then post the output please.

Ah, ok.

Nice! :wink:

So how is this installed in OpenSUSE 13.1?

zypper? yast?

No. You don’t have to explicitely install those. They are part of the standard “apache2” package.

Just add them to /etc/sysconfig/apache2 (APACHE_MODULES) either with a text editor or YaST->System->/etc/sysconfig editor, or use “a2enmod” which does that for you.

sudo a2enmod mod_socache_shmcb
sudo a2enmod mod_slotmem_shm

Check the error log for apache if you want to find out exactly what is going on. If you can’t find the pid file it means it’s not running and did not crash so as to leave a pid file there.
The error log’s location should be mentioned in the configuration file httpd.conf in /etc/apache2.
In my case it’s in /var/log/apache2/error_log
By taking a look there I found out that apache was trying to load two incompatible modules and that was causing the error when trying to start the apache2 service.
I had to edit the /etc/sysconfig/apache2 file in order to remove one of the two and then the service started without any more issues.
It was strange because neither service apache2 status, or the other two commands “systemctl status apache2.service -l” or “journalctl -b -x -u apache2” suggested by the status message produced any relevant output. But we should always check the error and access logs. Always. I totally wasted 2 days looking in the dark for this, I could have corrected everything in 10 mins or less.

I came here looking for answers, didn’t find any but I am leaving one here in case anyone else comes back.
GL everyone, it management is not as easy as it seems especially if you are a jack of all trades like me. We all need to be thorough to make sure we are not waisting our time so it can be hard.
Yannis.