17

When running service apache start I see in the log file this entry:

[mpm_event:notice] [pid 1906:tid XXX] AH00489: Apache/2.4.23 (Unix)
                         OpenSSL/1.0.2g PHP/7.0.9 configured -- resuming normal operations
[core:notice] [pid 1906:tid XXX] AH00094: Command line: '/usr/sbin/httpd'
[mpm_event:notice] [pid 1906:tid XXX] AH00492: caught SIGWINCH, shutting down gracefully

and the service apache does not start? I can find in internet what SIGWINCH means [Window size change] but it does not really help me in this case.

The file /etc/systemd/system/apache.service:

[Unit]
Description=The Apache Webserver [FaF Compiled]
After=network.target nss-lookup.target time-sync.target
[email protected] plymouth-quit.service xdm.service

[Service]
Type=notify
PrivateTmp=true
ExecStart=/usr/sbin/httpd -k start
ExecReload=/usr/sbin/httpd -k graceful
ExecStop=/usr/sbin/httpd -k graceful-stop
KillMode=mixed

[Install]
WantedBy=multi-user.target
Alias=httpd.service apache.service

Running on SLES 12 SP1. I have compiled Apache on my own. Starting it with apachectl -k start works perfectly and I can access and run the PHP code.

My question: What am I doing wrong that the apache service does not start. I have enabled it with systemctl enable apache. This was the output:

ln -s '/usr/lib/systemd/system/apache2.service' '/etc/systemd/system/httpd.service'
ln -s '/usr/lib/systemd/system/apache2.service' '/etc/systemd/system/apache.service'
ln -s '/usr/lib/systemd/system/apache2.service' '/etc/systemd/system/multi-user.target.wants/apache2.service'
Peter VARGA
  • 992
  • 3
  • 11
  • 28

5 Answers5

3

systemd is instructing Apache to stop with graceful-stop, which generates a SIGWINCH signal, and hence the log caught SIGWINCH, shutting down gracefully. (the SIGWINCH signal is (ab)used by Apache)

IMO, there is a possibility of another error, including configuration errors, making it stop, and you are looking at related symptoms which are normal behaviour.

I would recommend perusing your Apache error logs, usually by default in SLES under the directory /var/log/apache2.

Rui F Ribeiro
  • 55,929
  • 26
  • 146
  • 227
1

I found a similar problem reported on RedHat. Closed with a status "NOTABUG". Eventually recognised as wrong config.

img #1 1


img #2 2


img #3 3


UPDATE

I found one more similar problem reported on serverfault. And one more in the answer to it, in the image below.

img 1/1enter image description here

  • `-DFOREGROUND` does not help in my case. Apache does start but it does not return back to `service` and therefore `service` complains with `apache2.service start operation timed out. Terminating.` – Peter VARGA Aug 08 '16 at 20:18
  • Did you read the thread in the link? –  Aug 08 '16 at 20:19
  • 1
    I gave up. I understand the situation but I don't have a clue how to fix it. I found out when I remove `ExecReload=` from `/usr/lib/systemd/system/apache2.service` then `SIGWINCH` is not sent but then Apache does not start - no error message in log, nothing. It just immediately quits when it has been started. I implemented now the hack that I run `apachectl -k start` as a cron job when the system starts. I can restart Apache with `apachectl -k restart`. I will try it later; may be I get some new ideas. – Peter VARGA Aug 08 '16 at 22:16
  • I found one more, different. See update. –  Aug 08 '16 at 22:37
1

From a comment on the Red Hat bug report linked from Tomasz's answer:

It looks like you need to run 00-systemd.conf if you want systemd to recognize that httpd has started successfully.

I ran this and it worked:

ln -sr /etc/httpd/conf.modules.d/00-systemd.conf /etc/httpd/conf.d/00-systemd.conf
systemctl restart httpd

I'm on Amazon Linux 2 (will probably also work on RHEL/Centos 7).

Anthony Geoghegan
  • 12,605
  • 7
  • 59
  • 62
luds
  • 111
  • 1
0

This problem is from adding too many domains at once.
You are supposed to add one domain then restart httpd. I made this mistake too.

powerhousemethod
  • 435
  • 9
  • 25
0

I had this issue happening in AWS Cloud9 Console. I thought that SIGWINCH by itself was the problem, but later found a default setting in AWS Cloud 9 that terminates the instance after 30 minutes. This triggers SIGWINCH, which then tells Apache to shut down.

I had no idea about this, and this took me 2 days to figure out. I hope it saves someone time.

Be sure to adjust the "Stop my environment" setting

Rob Myrick
  • 101
  • 2
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jan 02 '23 at 21:16