Author |
|
richvigorito
Joined: 26 Sep 2014 Posts: 5 Location: USA, Portland
|
Posted: Mon 29 Sep '14 18:31 Post subject: [SOLVED] Cannot start apache 2.4 on centos 7. Just timesout |
|
|
Cannot start apache 2.4 on newly built centos 7 box.
Log entries, as far as i can tell, doesnt seem to yield much useful information.
/var/log/error_log:
Code: |
[Mon Sep 29 08:59:02.398020 2014] [core:notice] [pid 10391] SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0
[Mon Sep 29 08:59:02.418471 2014] [ssl:warn] [pid 10391] AH01873: Init: Session Cache is not configured [hint: SSLSessionCache]
[Mon Sep 29 08:59:02.428784 2014] [core:warn] [pid 10391] AH00098: pid file /var/run/httpd/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
[Mon Sep 29 08:59:02.431062 2014] [mpm_prefork:notice] [pid 10391] AH00163: Apache/2.4.6 (CentOS) OpenSSL/1.0.1e-fips PHP/5.5.10 configured -- resuming normal operations
[Mon Sep 29 08:59:02.431083 2014] [core:notice] [pid 10391] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
|
Thinking it may of been an issue w/ SELinux i disabled that and tried restarting apache and still the timeout. I also tried without success. I also tried the same approach with SSL because of the Secession Cache warning. Those 2 log entries being what looked like the culprits were not and am left with not much to work. Any help/suggestions would be very welcomed.
Last edited by richvigorito on Tue 07 Oct '14 20:07; edited 1 time in total |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Tue 30 Sep '14 14:21 Post subject: |
|
|
Session cache is easy
SSLSessionCache shmcb:/var/logs/apache2/ssl_gcache_data(512000) |
|
Back to top |
|
richvigorito
Joined: 26 Sep 2014 Posts: 5 Location: USA, Portland
|
Posted: Wed 01 Oct '14 22:40 Post subject: |
|
|
Sure, however SSLSession thing isnt the issue as ive removed ssl.conf and then restart same issue, despite not enabling ssl. ie not being able to start apache successfully. |
|
Back to top |
|
richvigorito
Joined: 26 Sep 2014 Posts: 5 Location: USA, Portland
|
Posted: Wed 01 Oct '14 22:43 Post subject: |
|
|
More info:
[root@dragon-new /etc/httpd/conf]# systemctl status httpd.service
httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled)
Active: failed (Result: timeout) since Wed 2014-10-01 13:39:22 PDT; 3min 55s ago
Main PID: 7760
CGroup: /system.slice/httpd.service
Oct 01 13:37:52 dragon-new.ocp.org systemd[1]: httpd.service operation timed out. Terminating.
Oct 01 13:39:22 dragon-new.ocp.org systemd[1]: httpd.service stopping timed out (2). Killing.
Oct 01 13:39:22 dragon-new.ocp.org systemd[1]: Failed to start The Apache HTTP Server.
Oct 01 13:39:22 dragon-new.ocp.org systemd[1]: Unit httpd.service entered failed state. |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Thu 02 Oct '14 11:06 Post subject: |
|
|
Then in that case the following link is more applicable:
- http://httpd.apache.org/docs/2.4/programs/apachectl.html
Apparently, the apachectl script can operate in two different modes.
Your environment appears to be set up only for the second.
So for this you would need to use "apachectl restart" or "apachectl
graceful". |
|
Back to top |
|
richvigorito
Joined: 26 Sep 2014 Posts: 5 Location: USA, Portland
|
Posted: Fri 03 Oct '14 23:09 Post subject: |
|
|
sudo /bin/systemctl restart httpd.service
sudo service httpd restart
apachectl restart
all result in timeouts
error_log:
[Fri Oct 03 14:04:48.540417 2014] [core:notice] [pid 4596] SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0
[Fri Oct 03 14:04:48.617319 2014] [mpm_prefork:notice] [pid 4596] AH00163: Apache/2.4.6 (CentOS) OpenSSL/1.0.1e-fips PHP/5.5.10 configured -- resuming normal operations
[Fri Oct 03 14:04:48.617387 2014] [core:notice] [pid 4596] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
[richv@dragon-new /etc/httpd/sites]$ sudo service httpd status;
Redirecting to /bin/systemctl status httpd.service
httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled)
Active: failed (Result: timeout) since Fri 2014-10-03 14:07:48 PDT; 1min 41s ago
Process: 4359 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=0/SUCCESS)
Main PID: 4596
Oct 03 14:06:18 dragon-new.ocp.org systemd[1]: httpd.service operation timed out. Terminating.
Oct 03 14:07:48 dragon-new.ocp.org systemd[1]: httpd.service stopping timed out (2). Killing.
Oct 03 14:07:48 dragon-new.ocp.org systemd[1]: Failed to start The Apache HTTP Server.
Oct 03 14:07:48 dragon-new.ocp.org systemd[1]: Unit httpd.service entered failed state. |
|
Back to top |
|
richvigorito
Joined: 26 Sep 2014 Posts: 5 Location: USA, Portland
|
Posted: Tue 07 Oct '14 20:09 Post subject: |
|
|
Idk really why this worked but following the instructions from this post fixed it for me:
https://bugzilla.redhat.com/show_bug.cgi?id=907579
worked. The httpd.service file that installed via yum, was problematic. changing it to:
Code: |
[Unit]
Description=The Apache HTTP Server
After=network.target remote-fs.target nss-lookup.target
[Service]
Type=forking
EnvironmentFile=/etc/sysconfig/httpd
ExecStart=/usr/sbin/httpd $OPTIONS -k start
ExecReload=/usr/sbin/httpd $OPTIONS -k graceful
ExecStop=/usr/sbin/httpd $OPTIONS -k graceful-stop
PrivateTmp=true
[Install]
WantedBy=multi-user.target
|
the old one was:
Code: |
[Unit]
Description=The Apache HTTP Server
After=network.target remote-fs.target nss-lookup.target
[Service]
Type=notify
EnvironmentFile=/etc/sysconfig/httpd
ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND
ExecReload=/usr/sbin/httpd $OPTIONS -k graceful
ExecStop=/bin/kill -WINCH ${MAINPID}
# We want systemd to give httpd some time to finish gracefully, but still want
# it to kill httpd after TimeoutStopSec if something went wrong during the
# graceful stop. Normally, Systemd sends SIGTERM signal right after the
# ExecStop, which would kill httpd. We are sending useless SIGCONT here to give
# httpd time to finish.
KillSignal=SIGCONT
PrivateTmp=true
[Install]
WantedBy=multi-user.target
|
worked. again, idk why. if someone could shed light that'd be fantastic. |
|
Back to top |
|
vik_0072
Joined: 14 Jun 2016 Posts: 1
|
Posted: Tue 14 Jun '16 9:35 Post subject: |
|
|
Hi,
You can use default service file, it's not a bug. Check ypur config, it's must contein next line:
LoadModule systemd_module modules/mod_systemd.so
This module need for Type=notify, because this type waiting respose from apache about successfuly start service. If you don't want enable this module, you can change Type=notify to Type=simple and it's will be work.
Ypu can find more information in "man systemd" |
|
Back to top |
|