Apache restarting on its own and errors on log - apache

I have three separate boxes running Apache 2.4, all with the same config and modules. On CentOS 7, Apache 2.4, PHP 5.6.
Two issues that could possibly be related. On one hand, I have not forced a restart, yet it would appear that apache restarted itself based on error_log being purged and having the below.
Second issue are the actual errors or warnings displayed. I can't figure out how to resolve them and if they could be the reason that Apache restarts itself in the first place, or be creating other issues elsewhere.
[Sun Jul 19 03:39:02.241577 2015] [auth_digest:notice] [pid 904] AH01757: generating secret for digest authentication ...
[Sun Jul 19 03:39:02.243161 2015] [lbmethod_heartbeat:notice] [pid 904] AH02282: No slotmem from mod_heartmonitor
[Sun Jul 19 03:39:02.246337 2015] [ssl:warn] [pid 904] AH02292: Init: Name-based SSL virtual hosts only work for clients with TLS server name indication support (RFC 4366)
[Sun Jul 19 03:39:02.292119 2015] [mpm_prefork:notice] [pid 904] AH00163: Apache/2.4.6 (CentOS) OpenSSL/1.0.1e-fips configured -- resuming normal operations
[Sun Jul 19 03:39:02.292151 2015] [core:notice] [pid 904] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
Would appreciate any guidance?

Related

Apache crashing when doing concurrent requests with Symfony dev mode

I'm making a symfony 3.4 application as REST service (so I have installed the usual JMS Serializer, FoSRest and lexik/jwt-authentication-bundle) and testing it on XAMPP (Windows 10).
When i make XHR requests through my frontend application using app_dev.php as endpoint it (very) often happens that Apache crashes when making 2+ requests at the same time.
Reading here and there it looks like that this issue is often caused by an attempt to write on the session file since symfony default session handler is session.handler.native_file.
So i first tried to put null (which, according to the documentation, uses native PHP session handler), this made the crashes happen less often but didn't fix the issue completely
Then i tried using Symfony\Component\HttpFoundation\Session\Storage\Handler\PdoSessionHandler which made the crashes happen even less than before, but there's still the occasional crash
Now that i'm using a database as session handler though i'm noticing that no session is being written on the database when i make XHR requests (While it does if i open a normal web page served by the application), which shouldn't surprise me since I set my security.yml such that the REST routes must be stateless, and yet toying with the handler_id configuration influences how often my apache crashes
The same thing doesn't happen if I open multiple web pages served by the same application, nor it happens if I use the production endpoint (app.php).
Is there any way to fix this completely?
EDIT:
As requested
Can you add the apache error logs and php error logs?
It just repeats like this for each time it restarted. I have noticed this line: AH00428: Parent: child process 29076 exited with status 3221226356 -- Restarting. which might be interesting investigating upon
[Sun Dec 17 00:39:58.548676 2017] [mpm_winnt:notice] [pid 17564:tid 532] AH00428: Parent: child process 22856 exited with status 3221226356 -- Restarting.
[Sun Dec 17 00:39:59.544151 2017] [ssl:warn] [pid 17564:tid 532] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sun Dec 17 00:39:59.740710 2017] [mpm_winnt:notice] [pid 17564:tid 532] AH00455: Apache/2.4.26 (Win32) OpenSSL/1.0.2l PHP/7.1.7 configured -- resuming normal operations
[Sun Dec 17 00:39:59.740710 2017] [mpm_winnt:notice] [pid 17564:tid 532] AH00456: Apache Lounge VC14 Server built: Jun 15 2017 12:39:41
[Sun Dec 17 00:39:59.740710 2017] [core:notice] [pid 17564:tid 532] AH00094: Command line: 'c:\\xampp\\apache\\bin\\httpd.exe -d C:/xampp/apache'
[Sun Dec 17 00:39:59.746705 2017] [mpm_winnt:notice] [pid 17564:tid 532] AH00418: Parent: Created child process 29076
[Sun Dec 17 00:40:01.201423 2017] [ssl:warn] [pid 29076:tid 592] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sun Dec 17 00:40:01.414295 2017] [ssl:warn] [pid 29076:tid 592] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sun Dec 17 00:40:01.455312 2017] [mpm_winnt:notice] [pid 29076:tid 592] AH00354: Child: Starting 150 worker threads.
[Sun Dec 17 00:40:17.006680 2017] [mpm_winnt:notice] [pid 17564:tid 532] AH00428: Parent: child process 29076 exited with status 3221226356 -- Restarting.
[Sun Dec 17 00:40:17.371667 2017] [ssl:warn] [pid 17564:tid 532] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sun Dec 17 00:40:17.403690 2017] [mpm_winnt:notice] [pid 17564:tid 532] AH00455: Apache/2.4.26 (Win32) OpenSSL/1.0.2l PHP/7.1.7 configured -- resuming normal operations
[Sun Dec 17 00:40:17.403690 2017] [mpm_winnt:notice] [pid 17564:tid 532] AH00456: Apache Lounge VC14 Server built: Jun 15 2017 12:39:41
[Sun Dec 17 00:40:17.403690 2017] [core:notice] [pid 17564:tid 532] AH00094: Command line: 'c:\\xampp\\apache\\bin\\httpd.exe -d C:/xampp/apache'
[Sun Dec 17 00:40:17.409694 2017] [mpm_winnt:notice] [pid 17564:tid 532] AH00418: Parent: Created child process 24332
[Sun Dec 17 00:40:18.667139 2017] [ssl:warn] [pid 24332:tid 524] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sun Dec 17 00:40:18.858441 2017] [ssl:warn] [pid 24332:tid 524] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sun Dec 17 00:40:18.895469 2017] [mpm_winnt:notice] [pid 24332:tid 524] AH00354: Child: Starting 150 worker threads.
[Sun Dec 17 00:40:20.972550 2017] [mpm_winnt:notice] [pid 17564:tid 532] AH00428: Parent: child process 24332 exited with status 3221226356 -- Restarting.
[Sun Dec 17 00:40:21.481091 2017] [ssl:warn] [pid 17564:tid 532] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sun Dec 17 00:40:21.513627 2017] [mpm_winnt:notice] [pid 17564:tid 532] AH00455: Apache/2.4.26 (Win32) OpenSSL/1.0.2l PHP/7.1.7 configured -- resuming normal operations
[Sun Dec 17 00:40:21.513627 2017] [mpm_winnt:notice] [pid 17564:tid 532] AH00456: Apache Lounge VC14 Server built: Jun 15 2017 12:39:41
[Sun Dec 17 00:40:21.513627 2017] [core:notice] [pid 17564:tid 532] AH00094: Command line: 'c:\\xampp\\apache\\bin\\httpd.exe -d C:/xampp/apache'
[Sun Dec 17 00:40:21.519144 2017] [mpm_winnt:notice] [pid 17564:tid 532] AH00418: Parent: Created child process 27440
[Sun Dec 17 00:40:22.991094 2017] [ssl:warn] [pid 27440:tid 552] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sun Dec 17 00:40:23.266105 2017] [ssl:warn] [pid 27440:tid 552] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sun Dec 17 00:40:23.301132 2017] [mpm_winnt:notice] [pid 27440:tid 552] AH00354: Child: Starting 150 worker threads.
When you say apache crash means that you have to start apache again,
or you just get an error? Which error do you get?
I Just get the usual application crashed window saying "Apache has stopped working", if i click "Close the application" it restarts by itself and the request that caused the crash simply fails with no status code or error message (which is expected since the connection with the server stopped). As you can see there's no specific error in the logs except for that status code
How you have setup apache and php mod_apache, php-fpm? Which apache
server limits do you have, how many php workers?
I'm not sure how to answer this question, i'm using stock apache and php from the XAMPP package with no edits to the configuration. I can tell you php is loaded as apache handler, so no CGI or FastCGI. Anyways on simple pages or using production mode in Symfony it works fine
NEWS:
I have discovered that since i was doing CORS requests it was creating a session file for each request, i fixed that and it slightly improved my issue, but it's still there
I have tried using redis as session handler for PHP but it actually made things worse
I have made a simple test where i called the same page (which uses session) 1000 times, it works fine as long as i put session_write_close(); at the end, otherwise it crashes
As stated in my last comment, I tried using FastCGI and it fixed the issue.
https://blog.tiger-workshop.com/fix-various-apache-crashes-on-windows/
On this page there are 2 suggestions for the error i was receiving AH00428: Parent: child process 29076 exited with status 3221226356 -- Restarting. One fix is to add the following lines to httpd.conf
<IfModule mpm_winnt_module>
ThreadStackSize 8388608
</IfModule>
But it didn't work. The second fix is related to a bug that happens in windows when using PHP as Apache Handler https://github.com/vlucas/phpdotenv/issues/76 so i switched to FastCGI as suggested.
These instructions are more specific to XAMPP than the ones posted in the link above. You need to edit the file xampp\apache\conf\extra\httpd-xampp.conf
Comment the following lines
#
# PHP-Module setup
#
#LoadFile "C:/xampp/php/php7ts.dll"
#LoadFile "C:/xampp/php/libpq.dll"
#LoadModule php7_module "C:/xampp/php/php7apache2_4.dll"
#
#<FilesMatch "\.php$">
# SetHandler application/x-httpd-php
#</FilesMatch>
#<FilesMatch "\.phps$">
# SetHandler application/x-httpd-php-source
#</FilesMatch>
[...] (This one is further down in the file)
#
#<IfModule php7_module>
# PHPINIDir "C:/xampp/php"
#</IfModule>
And add these lines
LoadModule fcgid_module modules/mod_fcgid.so
<IfModule fcgid_module>
FcgidMaxProcesses 300
FcgidMaxProcessesPerClass 300
FcgidOutputBufferSize 65536
FcgidConnectTimeout 10
FcgidProcessLifeTime 0
FcgidMaxRequestsPerProcess 0
FcgidMinProcessesPerClass 0
FcgidFixPathinfo 0
FcgidProcessLifeTime 0
FcgidZombieScanInterval 20
FcgidMaxRequestLen 536870912
FcgidIOTimeout 120
FcgidTimeScore 3
FcgidPassHeader Authorization
FcgidInitialEnv PHPRC "C:\\xampp\\php"
FcgidInitialEnv PATH "C:\\xampp\\php;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;"
FcgidInitialEnv SystemRoot "C:\\Windows"
FcgidInitialEnv SystemDrive "C:"
FcgidInitialEnv TEMP "C:\\xampp\\tmp"
FcgidInitialEnv TMP "C:\\xampp\\tmp"
FcgidInitialEnv windir "C:\\Windows"
DirectoryIndex index.html index.htm index.php
<Files ~ "\.php$">
Options Indexes FollowSymLinks ExecCGI
AddHandler fcgid-script .php
FcgidWrapper "C:/xampp/php/php-cgi.exe" .php
</Files>
</IfModule>

Apache2 not working after SSL certificate remove

im using vesta cp i remove the keys on the settings of the domain and the apache is not working how can i make it work again
Restarting web server apache2
...fail!
The apache2 configtest failed.
Output of config test was:
apache2: Syntax error on line 83 of /etc/apache2/apache2.conf: Syntax error on line 3 of /etc/apache2/conf.d/vesta.conf: Syntax error on line 1 of /home/admin/conf/web/sapache2.conf: without matching section
Action 'configtest' failed.
The Apache error log may have more information.
Error log
[Sun Dec 04 06:43:37.530259 2016] [:notice] [pid 1881]
mod_ruid2/0.9.8 enabled
[Sun Dec 04 06:43:37.535379 2016] [ssl:warn] [pid 1881] AH02292:
Init: Name-based SSL virtual hosts only work for clients with TLS
server name indication support (RFC 4366)
[Sun Dec 04 06:43:37.535844 2016] [mpm_prefork:notice] [pid 1881]
AH00163: Apache/2.4.7 (Ubuntu) mod_fcgid/2.3.9 PHP/5.5.9-1ubuntu4.17
OpenSSL/1.0.1f configured -- resuming normal operations
[Sun Dec 04 06:43:37.535858 2016] [core:notice] [pid 1881] AH00094:
Command line: '/usr/sbin/apache2'
[Mon Dec 05 18:42:53.735381 2016] [mpm_prefork:notice] [pid 1881]
AH00169: caught SIGTERM, shutting down
Run as root this command:
v-rebuild-user admin

Having problems accessing Apache Webserver from Webmin

I'm running apache on AMI, and I am unable to start the server through webmin. When I try, I get:
Failed to start apache : Apache does not appear to be running :
[Wed Sep 07 20:53:22.937284 2016] [suexec:notice] [pid 9985] AH01232: suEXEC >mechanism enabled (wrapper: /usr/sbin/suexec)
[Wed Sep 07 20:53:22.958565 2016] [auth_digest:notice] [pid 9986] AH01757: generating secret for digest authentication ...
[Wed Sep 07 20:53:22.959164 2016] [lbmethod_heartbeat:notice] [pid 9986] AH02282: No slotmem from mod_heartmonitor
[Wed Sep 07 20:53:22.983021 2016] [mpm_prefork:notice] [pid 9986] AH00163: Apache/2.4.23 (Amazon) PHP/5.6.24 configured -- resuming normal operations
[Wed Sep 07 20:53:22.983041 2016] [core:notice] [pid 9986] AH00094: Command line: '/usr/sbin/httpd'
This is my first time setting up a site on AWS, and any help would be greatly appreciated!
Make sure whether Apache is running or not by issuing the below command:
ps ax | grep httpd | grep -v grep
or try to visit your index.html page.
Also, just for your reference, webmin was dropped by Ubuntu https://help.ubuntu.com/community/WebMin

Apache httpd, starts but failed. Fedora 19 and webmin

I have a problem start apache from webmin, it works but webmin not registre it's running. And the log shows this failed.
In running procsses it work, and the testpages running on the server.
Fedora 19
Apache version 2.4.6
Webmin 1.660
What to do. please help?
---------------LOG----------------
Failed to start apache : Apache does not appear to be running :
[Thu Dec 05 23:57:56.773010 2013] [core:notice] [pid 4712] SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0
[Thu Dec 05 23:57:56.774357 2013] [suexec:notice] [pid 4712] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Thu Dec 05 23:57:56.860940 2013] [auth_digest:notice] [pid 4712] AH01757: generating secret for digest authentication ...
[Thu Dec 05 23:57:56.975651 2013] [mpm_prefork:notice] [pid 4712] AH00163: Apache/2.4.6 (Fedora) OpenSSL/1.0.0-fips PHP/5.5.6 mod_perl/2.0.8-dev Perl/v5.16.3 configured -- resuming normal operations
[Thu Dec 05 23:57:56.975690 2013] [core:notice] [pid 4712] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'

Error after upgrading to Apache 2.4.6

The "a2ensite""a2dissite" are not working
Echo:
ERROR: Site XXXXXX does not exist!
I swear it exists in sites-available folder.
After I typed a2ensite and double clicked the Tab button, it shows the /root directory.
There must be something wrong with the a2en/dissite script.
How can I make it back to work?
=====================
Here are the last lines of the error log:
[Sun Aug 04 22:59:31.406192 2013] [mpm_event:notice] [pid 5378:tid 140459282536256] AH00489: Apache/2.4.6 (Ubuntu) configured -- resuming normal operations
[Sun Aug 04 22:59:31.406433 2013] [core:notice] [pid 5378:tid 140459282536256] AH00094: Command line: '/usr/sbin/apache2'
[Sun Aug 04 23:09:44.648984 2013] [mpm_event:notice] [pid 5378:tid 140459282536256] AH00491: caught SIGTERM, shutting down
[Sun Aug 04 23:09:46.001182 2013] [mpm_event:notice] [pid 5692:tid 139671144335168] AH00489: Apache/2.4.6 (Ubuntu) configured -- resuming normal operations
[Sun Aug 04 23:09:46.001490 2013] [core:notice] [pid 5692:tid 139671144335168] AH00094: Command line: '/usr/sbin/apache2'
Renaming site configuration files in /etc/apache2/sites-available/* into *.conf helped.
Example, when enabling site dummy.com, configuration file must be named dummy.com.conf.
Another solution is to change this line in /etc/apache2/apache2.conf from:
IncludeOptional sites-enabled/*.conf
to:
IncludeOptional sites-enabled/*