server certificate does NOT include an ID which matches the server name by django - apache2.4

my django application(ssl) is strange...
This is the application structure. there is 4 apps.
mysite
|-app1
|-app2
|-app3
|-app4
main app is app1. now, there is response follows.
mysite
|-app1 ...500 server error
|-app2 ...200 ok
|-app3 ...200 ok
|-app4 ...200 ok
Below is the actual url
app1: https://www.henojiya.net/vietnam_research/
app2: https://www.henojiya.net/gmarker/
app3: https://www.henojiya.net/shopping/
app4: https://www.henojiya.net/kanban/
mmm...
# tail -f /var/log/httpd/error_log
openssl??
[Tue Aug 25 22:28:49.164124 2020] [suexec:notice] [pid 8122:tid 140202116692224] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Tue Aug 25 22:28:49.183968 2020] [lbmethod_heartbeat:notice] [pid 8122:tid 140202116692224] AH02282: No slotmem from mod_heartmonitor
[Tue Aug 25 22:28:49.186372 2020] [mpm_event:notice] [pid 8122:tid 140202116692224] AH00489: Apache/2.4.37 (centos) OpenSSL/1.1.1c mod_wsgi/4.7.1 Python/3.6 configured -- resuming normal operations
[Tue Aug 25 22:28:49.186393 2020] [core:notice] [pid 8122:tid 140202116692224] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
# tail -f ssl_error_log
server certificate does NOT include an ID which matches the server name ??
[wsgi:error] [pid 5344:tid 140508085110528] [remote 54.67.71.54:39392] File "/var/www/html/venv/lib/python3.6/site-packages/pandas/__init__.py", line 17, in <module>
[Tue Aug 25 18:28:39.109567 2020] [wsgi:error] [pid 5344:tid 140508085110528] [remote 54.67.71.54:39392] "Unable to import required dependencies:\\n" + "\\n".join(missing_dependencies)
[Tue Aug 25 18:28:39.109575 2020] [wsgi:error] [pid 5344:tid 140508085110528] [remote 54.67.71.54:39392] ImportError: Unable to import required dependencies:
[Tue Aug 25 18:28:39.109578 2020] [wsgi:error] [pid 5344:tid 140508085110528] [remote 54.67.71.54:39392] numpy: Interpreter change detected - this module can only be loaded into one interpreter per process.
[Tue Aug 25 21:03:53.627872 2020] [ssl:warn] [pid 7430:tid 139632467552512] AH01909: 153.126.200.229:443:0 server certificate does NOT include an ID which matches the server name
[Tue Aug 25 21:03:53.645213 2020] [ssl:warn] [pid 7430:tid 139632467552512] AH01909: 153.126.200.229:443:0 server certificate does NOT include an ID which matches the server name
[Tue Aug 25 21:33:53.554592 2020] [ssl:warn] [pid 7769:tid 140223441197312] AH01909: 153.126.200.229:443:0 server certificate does NOT include an ID which matches the server name
[Tue Aug 25 21:33:53.571588 2020] [ssl:warn] [pid 7769:tid 140223441197312] AH01909: 153.126.200.229:443:0 server certificate does NOT include an ID which matches the server name
[Tue Aug 25 22:28:49.166069 2020] [ssl:warn] [pid 8122:tid 140202116692224] AH01909: 153.126.200.229:443:0 server certificate does NOT include an ID which matches the server name
[Tue Aug 25 22:28:49.183859 2020] [ssl:warn] [pid 8122:tid 140202116692224] AH01909: 153.126.200.229:443:0 server certificate does NOT include an ID which matches the server name
apache log...
# cd /etc/httpd/conf
# ls
httpd-le-ssl.conf
httpd.conf
magic
(httpd.conf)
<VirtualHost *:80>
ServerName www.henojiya.net
DocumentRoot "/var/www/html"
(httpd-le-ssl.conf)
<VirtualHost *:443>
ServerName www.henojiya.net
DocumentRoot "/var/www/html"
I hitted the wall... help me! thanks

I uploaded the view.py again and it was fine.
mysite
|-app1 ...200 ok
|-app2 ...200 ok
|-app3 ...200 ok
|-app4 ...200 ok
I think I was thinking too much.
In the first place, it is stranged that there is only one 500 error.
"View.py" may have been uploaded in a corrupted state.

Related

I have change port in xampp but Apache is not working

[Sat Aug 28 22:29:16.150892 2021] [ssl:warn] [pid 13320:tid 584] AH01909: www.example.com:4433:0 server certificate does NOT include an ID which matches the server name
[Sat Aug 28 22:29:16.211896 2021] [core:warn] [pid 13320:tid 584] AH00098: pid file C:/xampp/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
[Sat Aug 28 22:29:16.215897 2021] [ssl:warn] [pid 13320:tid 584] AH01909: www.example.com:4433:0 server certificate does NOT include an ID which matches the server name
PHP Warning: 'C:\\WINDOWS\\SYSTEM32\\VCRUNTIME140.dll' 14.0 is not compatible with this PHP build linked with 14.29 in Unknown on line 0
[Sat Aug 28 22:29:16.217896 2021] [:emerg] [pid 13320:tid 584] AH00020: Configuration Failed, exiting
I have used port 1008 for httpd.conf and port 1212 for ssl-httpd.conf.

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>

Bitnami AH02042: rejecting client initiated renegotiation

Have a site on AWS Bitnami, received the following error in log last night:
[Tue Feb 21 11:44:24.550083 2017] [ssl:error] [pid 20151:tid 140224130492160] [client 208.93.152.93:41010] AH02042: rejecting client initiated renegotiation
Then get the following errors when trying to visit the site.
[Wed Feb 22 14:00:00.739407 2017] [mpm_event:notice] [pid 19875:tid 140224892598080] AH00491: caught SIGTERM, shutting down
[Wed Feb 22 14:00:04.737461 2017] [ssl:warn] [pid 31984:tid 140233098594112] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Wed Feb 22 14:00:04.894490 2017] [ssl:warn] [pid 31985:tid 140233098594112] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Wed Feb 22 14:00:05.036172 2017] [mpm_event:notice] [pid 31985:tid 140233098594112] AH00489: Apache/2.4.23 (Unix) OpenSSL/1.0.2h configured -- resuming normal operations
[Wed Feb 22 14:00:05.036313 2017] [core:notice] [pid 31985:tid 140233098594112] AH00094: Command line: '/opt/bitnami/apache2/bin/httpd.bin -f /opt/bitnami/apache2/conf/httpd.conf'
When visiting the site only receive this message 'Your application is not currently available'
Have not made any edits to the site since 1/5/17 no previous errors in the log on the site. Attempted restart, checked paths of SSL logs.
The warn messages you are obtaining:
[Wed Feb 22 14:00:04.737461 2017] [ssl:warn] [pid 31984:tid 140233098594112] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Wed Feb 22 14:00:04.894490 2017] [ssl:warn] [pid 31985:tid 140233098594112] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
You don't have to worry about them. It is related with the dummy certificate that Bitnami includes in its cloud images. You can find the whole information at https://docs.bitnami.com/aws/components/apache/#how-to-enable-https-support-with-ssl-certificates
I recommend you to take a deeper log to the Apache Log Files. You can share with us the log files:
/opt/bitnami/apache2/logs/error_log
/opt/bitnami/apache2/logs/access_log
There should be something there we are missing.

Apache doesn't want to Start - XAMPP

Now the first thing I did was change the port it was using. I opened up the httpd.conf file, changed all port 80 to port 8080, and it still doesn't want to start. Here is the error log:
[Wed Jan 13 11:23:21.108418 2016] [ssl:warn] [pid 288:tid 540] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Wed Jan 13 11:23:21.759466 2016] [ssl:warn] [pid 288:tid 540] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Wed Jan 13 11:23:22.895556 2016] [mpm_winnt:notice] [pid 288:tid 540] AH00455: Apache/2.4.17 (Win32) OpenSSL/1.0.2d PHP/5.5.30 configured -- resuming normal operations
[Wed Jan 13 11:23:22.896593 2016] [mpm_winnt:notice] [pid 288:tid 540] AH00456: Apache Lounge VC11 Server built: Oct 13 2015 10:54:13
[Wed Jan 13 11:23:22.896593 2016] [core:notice] [pid 288:tid 540] AH00094: Command line: 'C:\\xampp\\apache\\bin\\httpd.exe -d C:/xampp/apache'
[Wed Jan 13 11:23:22.906555 2016] [mpm_winnt:notice] [pid 288:tid 540] AH00418: Parent: Created child process 9520
[Wed Jan 13 11:23:24.245663 2016] [ssl:warn] [pid 9520:tid 580] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Wed Jan 13 11:23:24.727697 2016] [ssl:warn] [pid 9520:tid 580] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Wed Jan 13 11:23:24.797699 2016] [mpm_winnt:notice] [pid 9520:tid 580] AH00354: Child: Starting 150 worker threads.
httpd.conf has these changes:
ServerName localhost:8080
#Listen 12.34.56.78:8080
Listen 8080
Looks like error is with your local ssl.conf file get included.
Try to start apache after commenting it out from include in httpd.conf
8080 is another port used by programs such as Reporting Services etc. Why not try a different one and see if it still does not start.

Xampp Apache Wont start after wordpress installation

I've been using Xampp for quite some time with no major hiccups. I attempted to make a local copy of one of my Wordpress sites. Seeing that Bitnami had an installer I attempted to use that. At the end of the installation it hung at maybe 5% left. So i cancelled and it supposedly cleaned up its files. Getting back into it today. Apache will not start. I have checked error logs and nothing seems to indicate what it actually is:
[Wed Sep 16 10:34:46.441511 2015] [ssl:warn] [pid 4424:tid 248] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Wed Sep 16 10:34:46.675505 2015] [ssl:warn] [pid 4424:tid 248] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Wed Sep 16 10:34:47.127893 2015] [mpm_winnt:notice] [pid 4424:tid 248] AH00455: Apache/2.4.12 (Win32) OpenSSL/1.0.1l PHP/5.6.8 configured -- resuming normal operations
[Wed Sep 16 10:34:47.127893 2015] [mpm_winnt:notice] [pid 4424:tid 248] AH00456: Apache Lounge VC11 Server built: Jan 28 2015 16:48:40
[Wed Sep 16 10:34:47.127893 2015] [core:notice] [pid 4424:tid 248] AH00094: Command line: 'C:\\xampp\\apache\\bin\\httpd.exe -d C:/xampp/apache'
[Wed Sep 16 10:34:47.127893 2015] [mpm_winnt:notice] [pid 4424:tid 248] AH00418: Parent: Created child process 6624
[Wed Sep 16 10:34:47.985871 2015] [ssl:warn] [pid 6624:tid 260] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Wed Sep 16 10:34:48.251065 2015] [ssl:warn] [pid 6624:tid 260] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Wed Sep 16 10:34:48.313463 2015] [mpm_winnt:notice] [pid 6624:tid 260] AH00354: Child: Starting 150 worker threads.
[Wed Sep 16 10:39:12.205587 2015] [ssl:warn] [pid 6860:tid 240] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Wed Sep 16 10:39:12.486382 2015] [ssl:warn] [pid 6860:tid 240] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Wed Sep 16 10:39:12.533181 2015] [mpm_winnt:notice] [pid 6860:tid 240] AH00455: Apache/2.4.12 (Win32) OpenSSL/1.0.1l PHP/5.6.8 configured -- resuming normal operations
[Wed Sep 16 10:39:12.533181 2015] [mpm_winnt:notice] [pid 6860:tid 240] AH00456: Apache Lounge VC11 Server built: Jan 28 2015 16:48:40
[Wed Sep 16 10:39:12.533181 2015] [core:notice] [pid 6860:tid 240] AH00094: Command line: 'C:\\xampp\\apache\\bin\\httpd.exe -d C:/xampp/apache'
[Wed Sep 16 10:39:12.533181 2015] [mpm_winnt:notice] [pid 6860:tid 240] AH00418: Parent: Created child process 7100
[Wed Sep 16 10:39:13.500362 2015] [ssl:warn] [pid 7100:tid 252] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Wed Sep 16 10:39:13.937154 2015] [ssl:warn] [pid 7100:tid 252] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Wed Sep 16 10:39:13.983953 2015] [mpm_winnt:notice] [pid 7100:tid 252] AH00354: Child: Starting 150 worker threads.
I am not running IIS or Skype. Anyone have any ideas on what might be going wrong?
EDIT:
Should have mentioned. Nothing is listening on port 80 or 443. Also attempted to use other ports just in case. Still no dice.
Alright finally found my answer. After digging through Event viewer I found a syntax error in the httpd.conf file. Turns out as suspected Bitnami did not quite clean everything up as they had said. This was left behind and Xampp was unable to compile.
Include "C:/xampp/apps/wordpress/conf/httpd-prefix.conf"