Keystone Wirecloud Authentication failed: [SSL: CERTIFICATE_VERIFY_FAILED] - ssl

When trying to authenticate in Wirecloud via KeyStone we get the following error displayed in the browser:
Environment:
Request Method: GET
Request URL: https://<ServerURL>/complete/fiware/?state=SDyJk9ru8wSLwUZIRtSrwI86jznMIv8O&code=WzIZ11YpmGAuZoltvTTGMGoP45ZtHe
Django Version: 1.6.11
Python Version: 2.7.9
Installed Applications:
('django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin',
'wirecloud.commons',
'wirecloud.defaulttheme',
'compressor',
'south',
'wirecloud.catalogue',
'wirecloud.platform',
'wirecloud.fiware',
'social.apps.django_app.default')
Installed Middleware:
('wirecloud.commons.middleware.URLMiddleware',)
Traceback:
File "/usr/local/venv/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
112. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/usr/local/venv/lib/python2.7/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
52. response = view_func(request, *args, **kwargs)
File "/usr/local/venv/lib/python2.7/site-packages/django/views/decorators/csrf.py" in wrapped_view
57. return view_func(*args, **kwargs)
File "/usr/local/venv/lib/python2.7/site-packages/social/apps/django_app/utils.py" in wrapper
51. return func(request, backend, *args, **kwargs)
File "/usr/local/venv/lib/python2.7/site-packages/social/apps/django_app/views.py" in complete
28. redirect_name=REDIRECT_FIELD_NAME, *args, **kwargs)
File "/usr/local/venv/lib/python2.7/site-packages/social/actions.py" in do_complete
43. user = backend.complete(user=user, *args, **kwargs)
File "/usr/local/venv/lib/python2.7/site-packages/social/backends/base.py" in complete
41. return self.auth_complete(*args, **kwargs)
File "/usr/local/venv/lib/python2.7/site-packages/social/utils.py" in wrapper
229. return func(*args, **kwargs)
File "/usr/local/venv/lib/python2.7/site-packages/social/backends/oauth.py" in auth_complete
383. method=self.ACCESS_TOKEN_METHOD
File "/usr/local/venv/lib/python2.7/site-packages/social/backends/oauth.py" in request_access_token
361. return self.get_json(*args, **kwargs)
File "/usr/local/venv/lib/python2.7/site-packages/social/backends/base.py" in get_json
229. return self.request(url, *args, **kwargs).json()
File "/usr/local/venv/lib/python2.7/site-packages/social/backends/base.py" in request
224. raise AuthFailed(self, str(err))
Exception Type: AuthFailed at /complete/fiware/
Exception Value: Authentication failed: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)
The Wirecloud log shows the following:
[Fri Mar 04 08:09:51.933675 2016] [ssl:info] [pid 29119:tid 140090189723392] [client 172.30.20.99:63539] AH01964: Connection to child 20 established (server <ServerURL>:443)
[Fri Mar 04 08:10:04.388865 2016] [ssl:info] [pid 29120:tid 140090223294208] [client 172.30.20.99:63557] AH01964: Connection to child 80 established (server <ServerURL>:443)
[Fri Mar 04 08:10:04.443926 2016] [wsgi:error] [pid 29117:tid 140090323621632] Internal Server Error: /complete/fiware/
[Fri Mar 04 08:10:04.443940 2016] [wsgi:error] [pid 29117:tid 140090323621632] Traceback (most recent call last):
[Fri Mar 04 08:10:04.443942 2016] [wsgi:error] [pid 29117:tid 140090323621632] File "/usr/local/venv/lib/python2.7/site-packages/django/core/handlers/base.py", line 112, in get_response
[Fri Mar 04 08:10:04.443945 2016] [wsgi:error] [pid 29117:tid 140090323621632] response = wrapped_callback(request, *callback_args, **callback_kwargs)
[Fri Mar 04 08:10:04.443947 2016] [wsgi:error] [pid 29117:tid 140090323621632] File "/usr/local/venv/lib/python2.7/site-packages/django/views/decorators/cache.py", line 52, in _wrapped_view_func
[Fri Mar 04 08:10:04.443950 2016] [wsgi:error] [pid 29117:tid 140090323621632] response = view_func(request, *args, **kwargs)
[Fri Mar 04 08:10:04.443952 2016] [wsgi:error] [pid 29117:tid 140090323621632] File "/usr/local/venv/lib/python2.7/site-packages/django/views/decorators/csrf.py", line 57, in wrapped_view
[Fri Mar 04 08:10:04.443954 2016] [wsgi:error] [pid 29117:tid 140090323621632] return view_func(*args, **kwargs)
[Fri Mar 04 08:10:04.443956 2016] [wsgi:error] [pid 29117:tid 140090323621632] File "/usr/local/venv/lib/python2.7/site-packages/social/apps/django_app/utils.py", line 51, in wrapper
[Fri Mar 04 08:10:04.443958 2016] [wsgi:error] [pid 29117:tid 140090323621632] return func(request, backend, *args, **kwargs)
[Fri Mar 04 08:10:04.443960 2016] [wsgi:error] [pid 29117:tid 140090323621632] File "/usr/local/venv/lib/python2.7/site-packages/social/apps/django_app/views.py", line 28, in complete
[Fri Mar 04 08:10:04.443962 2016] [wsgi:error] [pid 29117:tid 140090323621632] redirect_name=REDIRECT_FIELD_NAME, *args, **kwargs)
[Fri Mar 04 08:10:04.443964 2016] [wsgi:error] [pid 29117:tid 140090323621632] File "/usr/local/venv/lib/python2.7/site-packages/social/actions.py", line 43, in do_complete
[Fri Mar 04 08:10:04.443966 2016] [wsgi:error] [pid 29117:tid 140090323621632] user = backend.complete(user=user, *args, **kwargs)
[Fri Mar 04 08:10:04.443968 2016] [wsgi:error] [pid 29117:tid 140090323621632] File "/usr/local/venv/lib/python2.7/site-packages/social/backends/base.py", line 41, in complete
[Fri Mar 04 08:10:04.443971 2016] [wsgi:error] [pid 29117:tid 140090323621632] return self.auth_complete(*args, **kwargs)
[Fri Mar 04 08:10:04.443973 2016] [wsgi:error] [pid 29117:tid 140090323621632] File "/usr/local/venv/lib/python2.7/site-packages/social/utils.py", line 229, in wrapper
[Fri Mar 04 08:10:04.443975 2016] [wsgi:error] [pid 29117:tid 140090323621632] return func(*args, **kwargs)
[Fri Mar 04 08:10:04.443977 2016] [wsgi:error] [pid 29117:tid 140090323621632] File "/usr/local/venv/lib/python2.7/site-packages/social/backends/oauth.py", line 383, in auth_complete
[Fri Mar 04 08:10:04.443979 2016] [wsgi:error] [pid 29117:tid 140090323621632] method=self.ACCESS_TOKEN_METHOD
[Fri Mar 04 08:10:04.443981 2016] [wsgi:error] [pid 29117:tid 140090323621632] File "/usr/local/venv/lib/python2.7/site-packages/social/backends/oauth.py", line 361, in request_access_token
[Fri Mar 04 08:10:04.443983 2016] [wsgi:error] [pid 29117:tid 140090323621632] return self.get_json(*args, **kwargs)
[Fri Mar 04 08:10:04.443985 2016] [wsgi:error] [pid 29117:tid 140090323621632] File "/usr/local/venv/lib/python2.7/site-packages/social/backends/base.py", line 229, in get_json
[Fri Mar 04 08:10:04.443987 2016] [wsgi:error] [pid 29117:tid 140090323621632] return self.request(url, *args, **kwargs).json()
[Fri Mar 04 08:10:04.443995 2016] [wsgi:error] [pid 29117:tid 140090323621632] File "/usr/local/venv/lib/python2.7/site-packages/social/backends/base.py", line 224, in request
[Fri Mar 04 08:10:04.443997 2016] [wsgi:error] [pid 29117:tid 140090323621632] raise AuthFailed(self, str(err))
[Fri Mar 04 08:10:04.443999 2016] [wsgi:error] [pid 29117:tid 140090323621632] AuthFailed: Authentication failed: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)
And the Horizon log displays this:
[Fri Mar 04 08:10:01.939771 2016] [ssl:info] [pid 29120:tid 140090282043136] [client 172.30.20.99:63555] AH01964: Connection to child 73 established (<ServerURL>:443)
[Fri Mar 04 07:10:02.175214 2016] [wsgi:error] [pid 29118:tid 140090390763264] No regions could be found excluding identity.
[Fri Mar 04 07:10:02.175651 2016] [wsgi:error] [pid 29118:tid 140090390763264] Login successful for user "<UserEmail>".
[Fri Mar 04 07:10:02.313486 2016] [wsgi:error] [pid 29118:tid 140090415941376] DEBUG:idm_logger:Requesting authorization for application: 904fd95c253c4938a824d1a443ce0fdd with redirect_uri: https://<ServerURL>/complete/fiware/ and scope: ['all_info'] by user <UserName>
[Fri Mar 04 07:10:02.346101 2016] [wsgi:error] [pid 29118:tid 140090415941376] DEBUG:idm_logger:OAUTH2: Application 904fd95c253c4938a824d1a443ce0fdd NOT alreadyauthorized
[Fri Mar 04 07:10:04.250695 2016] [wsgi:error] [pid 29118:tid 140090390763264] DEBUG:idm_logger:Authorizing application: 904fd95c253c4938a824d1a443ce0fdd by user: <UserName>
[Fri Mar 04 07:10:04.274461 2016] [wsgi:error] [pid 29118:tid 140090390763264] DEBUG:idm_logger:OAUTH2: Authorization Code obtained WzIZ11YpmGAuZoltvTTGMGoP45ZtHe
[Fri Mar 04 07:10:04.274541 2016] [wsgi:error] [pid 29118:tid 140090390763264] DEBUG:idm_logger:OAUTH2: Redirecting user back to https://<ServerURL>/complete/fiware/?state=SDyJk9ru8wSLwUZIRtSrwI86jznMIv8O&code=WzIZ11YpmGAuZoltvTTGMGoP45ZtHe
[Fri Mar 04 08:10:04.441087 2016] [ssl:info] [pid 29120:tid 140090189723392] [client 192.168.149.9:53270] AH01964: Connection to child 84 established (server <ServerURL>:443)
[Fri Mar 04 08:10:04.442137 2016] [ssl:info] [pid 29120:tid 140090189723392] [client 192.168.149.9:53270] AH02008: SSL library error 1 in handshake (server <ServerURL>:443)
[Fri Mar 04 08:10:04.442165 2016] [ssl:info] [pid 29120:tid 140090189723392] SSL Library Error: error:14094418:SSL routines:SSL3_READ_BYTES:tlsv1 alert unknown ca (SSL alert number 48)
[Fri Mar 04 08:10:04.442174 2016] [ssl:info] [pid 29120:tid 140090189723392] [client 192.168.149.9:53270] AH01998: Connection closed to child 84 with abortive shutdown (server <ServerURL>:443)
Horizon and Wirecloud run on the same apache, Wirecloud under port 443 and Horizon under port 40443. Both use the same cert files for ssl and work, called by themself, fine. Those cert files are currently self signed ones.
Since I am pretty new to ssl usage in apache any halp would be much appreciated.

As you are using self-signed certificates, the best option is including your cert into the list of trusted certificates. requests (the module used for making this request) usually uses a bundle by default (it depends on the installation method). You can edit that bundle for adding your cert (see this link for more details) although you will have to update this bundle every time you upgrade the requests module.
Another option, is to configure requests for using the trusted certs repository from the OS. This can be configured using the REQUESTS_CA_BUNDLE environment var (e.g. by editing your wgsi.py file adding something similar to this: os.environ['REQUESTS_CA_BUNDLE'] = "/etc/ssl/certs/ca-certificates.crt"). The operation of adding your cert into the trusted repository depends on your OS, but there is a lot of information about this matter on google (e.g. here you can find how to do it using Debian/Ubuntu).

Related

Apache, mod_wsgi, and Pandas import error, unable to import dependencies Numpy due to error

I'm able to deploy the flask app without the Pandas library, so I don't think something is wrong with how I set up the server. Additionally, I'm able to run my flask app with pandas with Flask's development server, so I think it might be something to do with mod_wsgi.
I'm using Apache/2.4.37 (Red Hat Enterprise Linux) mod_wsgi/4.6.4 Python/3.6 configured.
I'm unable to import pandas, and trying to do so through mod_wsgi generates this error.
[Mon Nov 18 08:03:25.792041 2019] [wsgi:error] [pid 13940:tid 140279706347264] [remote 73.71.92.203:61252] "Unable to import required dependencies:\\n" + "\\n".join(missing_dependencies)
[Mon Nov 18 08:03:25.792058 2019] [wsgi:error] [pid 13940:tid 140279706347264] [remote 73.71.92.203:61252] ImportError: Unable to import required dependencies:
[Mon Nov 18 08:03:25.792063 2019] [wsgi:error] [pid 13940:tid 140279706347264] [remote 73.71.92.203:61252] numpy:
[Mon Nov 18 08:03:25.792066 2019] [wsgi:error] [pid 13940:tid 140279706347264] [remote 73.71.92.203:61252]
[Mon Nov 18 08:03:25.792068 2019] [wsgi:error] [pid 13940:tid 140279706347264] [remote 73.71.92.203:61252] IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
[Mon Nov 18 08:03:25.792071 2019] [wsgi:error] [pid 13940:tid 140279706347264] [remote 73.71.92.203:61252]
[Mon Nov 18 08:03:25.792074 2019] [wsgi:error] [pid 13940:tid 140279706347264] [remote 73.71.92.203:61252] Importing the numpy c-extensions failed.
[Mon Nov 18 08:03:25.792101 2019] [wsgi:error] [pid 13940:tid 140279706347264] [remote 73.71.92.203:61252] - Try uninstalling and reinstalling numpy.
[Mon Nov 18 08:03:25.792105 2019] [wsgi:error] [pid 13940:tid 140279706347264] [remote 73.71.92.203:61252] - If you have already done that, then:
[Mon Nov 18 08:03:25.792108 2019] [wsgi:error] [pid 13940:tid 140279706347264] [remote 73.71.92.203:61252] 1. Check that you expected to use Python3.6 from "/usr/bin/python3",
[Mon Nov 18 08:03:25.792111 2019] [wsgi:error] [pid 13940:tid 140279706347264] [remote 73.71.92.203:61252] and that you have no directories in your PATH or PYTHONPATH that can
[Mon Nov 18 08:03:25.792114 2019] [wsgi:error] [pid 13940:tid 140279706347264] [remote 73.71.92.203:61252] interfere with the Python and numpy version "1.17.4" you're trying to use.
[Mon Nov 18 08:03:25.792117 2019] [wsgi:error] [pid 13940:tid 140279706347264] [remote 73.71.92.203:61252] 2. If (1) looks fine, you can open a new issue at
[Mon Nov 18 08:03:25.792120 2019] [wsgi:error] [pid 13940:tid 140279706347264] [remote 73.71.92.203:61252] https://github.com/numpy/numpy/issues. Please include details on:
[Mon Nov 18 08:03:25.792123 2019] [wsgi:error] [pid 13940:tid 140279706347264] [remote 73.71.92.203:61252] - how you installed Python
[Mon Nov 18 08:03:25.792126 2019] [wsgi:error] [pid 13940:tid 140279706347264] [remote 73.71.92.203:61252] - how you installed numpy
[Mon Nov 18 08:03:25.792129 2019] [wsgi:error] [pid 13940:tid 140279706347264] [remote 73.71.92.203:61252] - your operating system
[Mon Nov 18 08:03:25.792131 2019] [wsgi:error] [pid 13940:tid 140279706347264] [remote 73.71.92.203:61252] - whether or not you have multiple versions of Python installed
[Mon Nov 18 08:03:25.792134 2019] [wsgi:error] [pid 13940:tid 140279706347264] [remote 73.71.92.203:61252] - if you built from source, your compiler versions and ideally a build log
[Mon Nov 18 08:03:25.792137 2019] [wsgi:error] [pid 13940:tid 140279706347264] [remote 73.71.92.203:61252]
[Mon Nov 18 08:03:25.792140 2019] [wsgi:error] [pid 13940:tid 140279706347264] [remote 73.71.92.203:61252] - If you're working with a numpy git repository, try `git clean -xdf`
[Mon Nov 18 08:03:25.792143 2019] [wsgi:error] [pid 13940:tid 140279706347264] [remote 73.71.92.203:61252] (removes all files not under version control) and rebuild numpy.
[Mon Nov 18 08:03:25.792146 2019] [wsgi:error] [pid 13940:tid 140279706347264] [remote 73.71.92.203:61252]
[Mon Nov 18 08:03:25.792149 2019] [wsgi:error] [pid 13940:tid 140279706347264] [remote 73.71.92.203:61252] Note: this error has many possible causes, so please don't comment on
[Mon Nov 18 08:03:25.792152 2019] [wsgi:error] [pid 13940:tid 140279706347264] [remote 73.71.92.203:61252] an existing issue about this - open a new one instead.
[Mon Nov 18 08:03:25.792155 2019] [wsgi:error] [pid 13940:tid 140279706347264] [remote 73.71.92.203:61252]
[Mon Nov 18 08:03:25.792157 2019] [wsgi:error] [pid 13940:tid 140279706347264] [remote 73.71.92.203:61252] Original error was: /var/www/app/KENV/lib/python3.6/site-packages/numpy/core/_multiarray_umath.cpython-36m-x86_64-linux-gnu.so: failed to map segment from shared object
I'm running python 3.6.8, pandas is 0.25.1 and numpy is 1.17.4.
The error is probably due to SELinux restrictions.
Note that even if you manage to convince your system to load the shared libraries, using numpy under mod_wsgi is known to not work because numpy does not really support python sub-interpreters

Apache terminates itself

Recently the Apache2 on my Ubuntu computer terminates itself after it is started a few hours, provided that no one has modified any Apache configs or sending out any SIGTERM signal (except apt/apt-get upgrade). When I check the error.log, it shows something like this which I can find no clue:
[Mon Jun 04 00:05:36.567117 2018] [mpm_prefork:notice] [pid 2713] AH00163: Apache/2.4.27 (Ubuntu) OpenSSL/1.0.2g configured -- resuming normal operations
[Mon Jun 04 00:05:36.567139 2018] [core:notice] [pid 2713] AH00094: Command line: '/usr/sbin/apache2'
[Mon Jun 04 00:08:42.692780 2018] [mpm_prefork:notice] [pid 2713] AH00169: caught SIGTERM, shutting down
[Mon Jun 04 00:08:49.095482 2018] [ssl:warn] [pid 8974] AH01906: 167381ca9f7090bf9edf80ba7abf2757.6b6358cf1d262e93db083c8b42c3e7e4.acme.invalid:443:0 server certificate is a CA certificate (BasicConstr$
[Mon Jun 04 00:08:49.132763 2018] [ssl:warn] [pid 8975] AH01906: 167381ca9f7090bf9edf80ba7abf2757.6b6358cf1d262e93db083c8b42c3e7e4.acme.invalid:443:0 server certificate is a CA certificate (BasicConstr$
[Mon Jun 04 00:08:49.138388 2018] [mpm_prefork:notice] [pid 8975] AH00163: Apache/2.4.27 (Ubuntu) OpenSSL/1.0.2g configured -- resuming normal operations
[Mon Jun 04 00:08:49.138411 2018] [core:notice] [pid 8975] AH00094: Command line: '/usr/sbin/apache2'
[Mon Jun 04 00:08:55.724193 2018] [mpm_prefork:notice] [pid 8975] AH00171: Graceful restart requested, doing restart
[Mon Jun 04 00:08:55.761313 2018] [mpm_prefork:notice] [pid 8975] AH00163: Apache/2.4.27 (Ubuntu) OpenSSL/1.0.2g configured -- resuming normal operations
[Mon Jun 04 00:08:55.761330 2018] [core:notice] [pid 8975] AH00094: Command line: '/usr/sbin/apache2'
[Mon Jun 04 00:09:00.420832 2018] [mpm_prefork:notice] [pid 8975] AH00171: Graceful restart requested, doing restart
AH00112: Warning: DocumentRoot [/var/lib/letsencrypt/tls_sni_01_page/] does not exist
AH00112: Warning: DocumentRoot [/var/lib/letsencrypt/tls_sni_01_page/] does not exist
AH00112: Warning: DocumentRoot [/var/lib/letsencrypt/tls_sni_01_page/] does not exist
AH00112: Warning: DocumentRoot [/var/lib/letsencrypt/tls_sni_01_page/] does not exist
AH00112: Warning: DocumentRoot [/var/lib/letsencrypt/tls_sni_01_page/] does not exist
AH00112: Warning: DocumentRoot [/var/lib/letsencrypt/tls_sni_01_page/] does not exist
AH00112: Warning: DocumentRoot [/var/lib/letsencrypt/tls_sni_01_page/] does not exist
[Mon Jun 04 00:09:00.454148 2018] [ssl:warn] [pid 8975] AH01906: 188454998ed00edb88cd5d07b2ab2254.3b3a904d9d9487cc6497b164e7f62a83.acme.invalid:443:0 server certificate is a CA certificate (BasicConstr$
[Mon Jun 04 00:09:00.454369 2018] [ssl:warn] [pid 8975] AH01906: c2322864937b675b512cc9082dced726.92496ce8d61bce3f4a23bc1a3218e316.acme.invalid:443:0 server certificate is a CA certificate (BasicConstr$
[Mon Jun 04 00:09:00.454577 2018] [ssl:warn] [pid 8975] AH01906: 76af4c76944afa8d20dc39e2298db3b3.e13999bec38b4f773ce0a42cd05bbd4c.acme.invalid:443:0 server certificate is a CA certificate (BasicConstr$
[Mon Jun 04 00:09:00.454777 2018] [ssl:warn] [pid 8975] AH01906: 17692edb40ba2833effa12d8a5c88387.667c0669638111d9584e8e5e06ff19b9.acme.invalid:443:0 server certificate is a CA certificate (BasicConstr$
[Mon Jun 04 00:09:00.454982 2018] [ssl:warn] [pid 8975] AH01906: ae632be6f870530686007c705e552d70.a1bcbaaf18efb59cf234338286ca537b.acme.invalid:443:0 server certificate is a CA certificate (BasicConstr$
[Mon Jun 04 00:09:00.455186 2018] [ssl:warn] [pid 8975] AH01906: 953872e180e5982e31690363dd4a30d8.6ca1b4a315f407a052938df2d18acba3.acme.invalid:443:0 server certificate is a CA certificate (BasicConstr$
[Mon Jun 04 00:09:00.455397 2018] [ssl:warn] [pid 8975] AH01906: 6583ed0337c393064b82f1e8123809ba.e6548597537804f2bef7369a4c2acdba.acme.invalid:443:0 server certificate is a CA certificate (BasicConstr$
[Mon Jun 04 00:09:00.458601 2018] [mpm_prefork:notice] [pid 8975] AH00163: Apache/2.4.27 (Ubuntu) OpenSSL/1.0.2g configured -- resuming normal operations
[Mon Jun 04 00:09:00.458610 2018] [core:notice] [pid 8975] AH00094: Command line: '/usr/sbin/apache2'
[Mon Jun 04 00:09:10.021985 2018] [mpm_prefork:notice] [pid 8975] AH00171: Graceful restart requested, doing restart
[Mon Jun 04 00:09:10.061542 2018] [mpm_prefork:notice] [pid 8975] AH00163: Apache/2.4.27 (Ubuntu) OpenSSL/1.0.2g configured -- resuming normal operations
[Mon Jun 04 00:09:10.061567 2018] [core:notice] [pid 8975] AH00094: Command line: '/usr/sbin/apache2'
[Mon Jun 04 00:09:12.672320 2018] [mpm_prefork:notice] [pid 8975] AH00171: Graceful restart requested, doing restart
AH00112: Warning: DocumentRoot [/var/lib/letsencrypt/tls_sni_01_page/] does not exist
AH00112: Warning: DocumentRoot [/var/lib/letsencrypt/tls_sni_01_page/] does not exist
[Mon Jun 04 00:09:12.707771 2018] [ssl:warn] [pid 8975] AH01906: 074653103fcd03ca40aa6ae4b90266f9.e453fad80449cbedfb50933e788548a7.acme.invalid:443:0 server certificate is a CA certificate (BasicConstr$
[Mon Jun 04 00:09:12.708001 2018] [ssl:warn] [pid 8975] AH01906: 4ac70f37b3cc16c2eedecc274ada88b5.fc9272a4d656a16b16687b53e5ddab16.acme.invalid:443:0 server certificate is a CA certificate (BasicConstr$
[Mon Jun 04 00:09:12.711091 2018] [mpm_prefork:notice] [pid 8975] AH00163: Apache/2.4.27 (Ubuntu) OpenSSL/1.0.2g configured -- resuming normal operations
[Mon Jun 04 00:09:12.711098 2018] [core:notice] [pid 8975] AH00094: Command line: '/usr/sbin/apache2'
[Mon Jun 04 00:09:19.800865 2018] [mpm_prefork:notice] [pid 8975] AH00171: Graceful restart requested, doing restart
[Mon Jun 04 00:09:19.839602 2018] [mpm_prefork:notice] [pid 8975] AH00163: Apache/2.4.27 (Ubuntu) OpenSSL/1.0.2g configured -- resuming normal operations
[Mon Jun 04 00:09:19.839618 2018] [core:notice] [pid 8975] AH00094: Command line: '/usr/sbin/apache2'
[Mon Jun 04 00:09:22.113155 2018] [mpm_prefork:notice] [pid 8975] AH00171: Graceful restart requested, doing restart
AH00112: Warning: DocumentRoot [/var/lib/letsencrypt/tls_sni_01_page/] does not exist
[Mon Jun 04 00:09:22.149880 2018] [ssl:warn] [pid 8975] AH01906: 95a5f7529d708ef2ed9efc1770f7b3f9.7d2f8675f76c8b2e6909bbe900e67d93.acme.invalid:443:0 server certificate is a CA certificate (BasicConstr$
[Mon Jun 04 00:09:22.153017 2018] [mpm_prefork:notice] [pid 8975] AH00163: Apache/2.4.27 (Ubuntu) OpenSSL/1.0.2g configured -- resuming normal operations
[Mon Jun 04 00:09:22.153025 2018] [core:notice] [pid 8975] AH00094: Command line: '/usr/sbin/apache2'
[Mon Jun 04 00:09:28.755711 2018] [mpm_prefork:notice] [pid 8975] AH00171: Graceful restart requested, doing restart
[Mon Jun 04 00:09:28.798520 2018] [mpm_prefork:notice] [pid 8975] AH00163: Apache/2.4.27 (Ubuntu) OpenSSL/1.0.2g configured -- resuming normal operations
[Mon Jun 04 00:09:28.798537 2018] [core:notice] [pid 8975] AH00094: Command line: '/usr/sbin/apache2'
[Mon Jun 04 00:09:28.975472 2018] [mpm_prefork:notice] [pid 8975] AH00169: caught SIGTERM, shutting down
Anyone can help? Thanks!

DBAccessError(13, Permission denied) in httpd server logs, when CKAN configured with saml2

I am running CKAN with apache httpd server. So, when i enable saml2 extension in ckan. I am getting following errors in my apache logs and see "Internal Server Error" on webpage.
[Sun Jun 18 20:08:35.073897 2017] [wsgi:error] [pid 2604] [client 10.164.136.102:16035] mod_wsgi (pid=2604): Target WSGI script '/etc/ckan/default/apache.wsgi' cannot be loaded as Python module.
[Sun Jun 18 20:08:35.073908 2017] [wsgi:error] [pid 2604] [client 10.164.136.102:16035] mod_wsgi (pid=2604): Exception occurred processing WSGI script '/etc/ckan/default/apache.wsgi'.
[Sun Jun 18 20:08:35.073922 2017] [wsgi:error] [pid 2604] [client 10.164.136.102:16035] Traceback (most recent call last):
[Sun Jun 18 20:08:35.073934 2017] [wsgi:error] [pid 2604] [client 10.164.136.102:16035] File "/etc/ckan/default/apache.wsgi", line 11, in <module>
[Sun Jun 18 20:08:35.073954 2017] [wsgi:error] [pid 2604] [client 10.164.136.102:16035] application = loadapp('config:%s' % config_filepath)
[Sun Jun 18 20:08:35.073961 2017] [wsgi:error] [pid 2604] [client 10.164.136.102:16035] File "/usr/lib/ckan/default/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 247, in loadapp
[Sun Jun 18 20:08:35.073974 2017] [wsgi:error] [pid 2604] [client 10.164.136.102:16035] return loadobj(APP, uri, name=name, **kw)
[Sun Jun 18 20:08:35.073979 2017] [wsgi:error] [pid 2604] [client 10.164.136.102:16035] File "/usr/lib/ckan/default/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 272, in loadobj
[Sun Jun 18 20:08:35.073987 2017] [wsgi:error] [pid 2604] [client 10.164.136.102:16035] return context.create()
[Sun Jun 18 20:08:35.073992 2017] [wsgi:error] [pid 2604] [client 10.164.136.102:16035] File "/usr/lib/ckan/default/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 710, in create
[Sun Jun 18 20:08:35.074012 2017] [wsgi:error] [pid 2604] [client 10.164.136.102:16035] return self.object_type.invoke(self)
[Sun Jun 18 20:08:35.074017 2017] [wsgi:error] [pid 2604] [client 10.164.136.102:16035] File "/usr/lib/ckan/default/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 146, in invoke
[Sun Jun 18 20:08:35.074025 2017] [wsgi:error] [pid 2604] [client 10.164.136.102:16035] return fix_call(context.object, context.global_conf, **context.local_conf)
[Sun Jun 18 20:08:35.074030 2017] [wsgi:error] [pid 2604] [client 10.164.136.102:16035] File "/usr/lib/ckan/default/lib/python2.7/site-packages/paste/deploy/util.py", line 55, in fix_call
[Sun Jun 18 20:08:35.074039 2017] [wsgi:error] [pid 2604] [client 10.164.136.102:16035] val = callable(*args, **kw)
[Sun Jun 18 20:08:35.074043 2017] [wsgi:error] [pid 2604] [client 10.164.136.102:16035] File "/root/ckan/lib/default/src/ckan/ckan/config/middleware/__init__.py", line 48, in make_app
[Sun Jun 18 20:08:35.074052 2017] [wsgi:error] [pid 2604] [client 10.164.136.102:16035] **app_conf)
[Sun Jun 18 20:08:35.074057 2017] [wsgi:error] [pid 2604] [client 10.164.136.102:16035] File "/root/ckan/lib/default/src/ckan/ckan/config/middleware/pylons_app.py", line 113, in make_pylons_stack
[Sun Jun 18 20:08:35.074065 2017] [wsgi:error] [pid 2604] [client 10.164.136.102:16035] who_parser.parse(open(app_conf['who.config_file']))
[Sun Jun 18 20:08:35.074069 2017] [wsgi:error] [pid 2604] [client 10.164.136.102:16035] File "/usr/lib/ckan/default/lib/python2.7/site-packages/repoze/who/config.py", line 86, in parse
[Sun Jun 18 20:08:35.074079 2017] [wsgi:error] [pid 2604] [client 10.164.136.102:16035] obj = self._makePlugin(name, IPlugin, options)
[Sun Jun 18 20:08:35.074090 2017] [wsgi:error] [pid 2604] [client 10.164.136.102:16035] File "/usr/lib/ckan/default/lib/python2.7/site-packages/repoze/who/config.py", line 42, in _makePlugin
[Sun Jun 18 20:08:35.074118 2017] [wsgi:error] [pid 2604] [client 10.164.136.102:16035] obj = obj(**options)
[Sun Jun 18 20:08:35.074127 2017] [wsgi:error] [pid 2604] [client 10.164.136.102:16035] File "/root/ckan/lib/default/src/pysaml2/src/saml2/s2repoze/plugins/sp.py", line 663, in make_plugin
[Sun Jun 18 20:08:35.074137 2017] [wsgi:error] [pid 2604] [client 10.164.136.102:16035] virtual_organization=virtual_organization)
[Sun Jun 18 20:08:35.074142 2017] [wsgi:error] [pid 2604] [client 10.164.136.102:16035] File "/root/ckan/lib/default/src/pysaml2/src/saml2/client_base.py", line 102, in __init__
[Sun Jun 18 20:08:35.074149 2017] [wsgi:error] [pid 2604] [client 10.164.136.102:16035] self.users = Population(identity_cache)
[Sun Jun 18 20:08:35.074154 2017] [wsgi:error] [pid 2604] [client 10.164.136.102:16035] File "/root/ckan/lib/default/src/pysaml2/src/saml2/population.py", line 12, in __init__
[Sun Jun 18 20:08:35.074162 2017] [wsgi:error] [pid 2604] [client 10.164.136.102:16035] self.cache = Cache(cache)
[Sun Jun 18 20:08:35.074166 2017] [wsgi:error] [pid 2604] [client 10.164.136.102:16035] File "/root/ckan/lib/default/src/pysaml2/src/saml2/cache.py", line 26, in __init__
[Sun Jun 18 20:08:35.074174 2017] [wsgi:error] [pid 2604] [client 10.164.136.102:16035] self._db = shelve.open(filename, writeback=True, protocol=2)
[Sun Jun 18 20:08:35.074178 2017] [wsgi:error] [pid 2604] [client 10.164.136.102:16035] File "/usr/lib64/python2.7/shelve.py", line 239, in open
[Sun Jun 18 20:08:35.074186 2017] [wsgi:error] [pid 2604] [client 10.164.136.102:16035] return DbfilenameShelf(filename, flag, protocol, writeback)
[Sun Jun 18 20:08:35.074190 2017] [wsgi:error] [pid 2604] [client 10.164.136.102:16035] File "/usr/lib64/python2.7/shelve.py", line 223, in __init__
[Sun Jun 18 20:08:35.074196 2017] [wsgi:error] [pid 2604] [client 10.164.136.102:16035] Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback)
[Sun Jun 18 20:08:35.074201 2017] [wsgi:error] [pid 2604] [client 10.164.136.102:16035] File "/usr/lib64/python2.7/anydbm.py", line 85, in open
[Sun Jun 18 20:08:35.074207 2017] [wsgi:error] [pid 2604] [client 10.164.136.102:16035] return mod.open(file, flag, mode)
[Sun Jun 18 20:08:35.074211 2017] [wsgi:error] [pid 2604] [client 10.164.136.102:16035] File "/usr/lib64/python2.7/dbhash.py", line 19, in open
[Sun Jun 18 20:08:35.074218 2017] [wsgi:error] [pid 2604] [client 10.164.136.102:16035] return bsddb.hashopen(file, flag, mode)
[Sun Jun 18 20:08:35.074223 2017] [wsgi:error] [pid 2604] [client 10.164.136.102:16035] File "/usr/lib64/python2.7/bsddb/__init__.py", line 366, in hashopen
[Sun Jun 18 20:08:35.074230 2017] [wsgi:error] [pid 2604] [client 10.164.136.102:16035] d.open(file, db.DB_HASH, flags, mode)
[Sun Jun 18 20:08:35.074246 2017] [wsgi:error] [pid 2604] [client 10.164.136.102:16035] DBAccessError: (13, 'Permission denied')
It looks like the user httpd is running as does not have permission to read or write to the locations specified by sid_store or identity_cache in who.ini. I suspect it's the latter but I'm unsure without checking the code.

RuntimeError: populate() isn't reentrant on CentOS 7 | django 1.9 | python3

Im deploying a django application on a intranet environment. I've already set up a testing server and everything is fine (after breaking my head fixing errors).
This time, im seting up the production server and after configuring everything, i got an error 500, here is the httpd/logs/error_log:
traceback
[Thu Oct 27 09:44:15.480662 2016] [:error] [pid 15250] [remote 10.105.40.106:200] mod_wsgi (pid=15250): Target WSGI script '/home/rortega/smce/smce/wsgi.py' cannot be loaded as Python module.
[Thu Oct 27 09:44:15.480706 2016] [:error] [pid 15250] [remote 10.105.40.106:200] mod_wsgi (pid=15250): Exception occurred processing WSGI script '/home/rortega/smce/smce/wsgi.py'.
[Thu Oct 27 09:44:15.480736 2016] [:error] [pid 15250] [remote 10.105.40.106:200] Traceback (most recent call last):
[Thu Oct 27 09:44:15.480764 2016] [:error] [pid 15250] [remote 10.105.40.106:200] File "/home/rortega/smce/smce/wsgi.py", line 16, in <module>
[Thu Oct 27 09:44:15.480805 2016] [:error] [pid 15250] [remote 10.105.40.106:200] application = get_wsgi_application()
[Thu Oct 27 09:44:15.480823 2016] [:error] [pid 15250] [remote 10.105.40.106:200] File "/home/rortega/smce_env/lib/python3.5/site-packages/django/core/wsgi.py", line 13, in get_wsgi_application
[Thu Oct 27 09:44:15.480852 2016] [:error] [pid 15250] [remote 10.105.40.106:200] django.setup()
[Thu Oct 27 09:44:15.480868 2016] [:error] [pid 15250] [remote 10.105.40.106:200] File "/home/rortega/smce_env/lib/python3.5/site-packages/django/__init__.py", line 18, in setup
[Thu Oct 27 09:44:15.480892 2016] [:error] [pid 15250] [remote 10.105.40.106:200] apps.populate(settings.INSTALLED_APPS)
[Thu Oct 27 09:44:15.480908 2016] [:error] [pid 15250] [remote 10.105.40.106:200] File "/home/rortega/smce_env/lib/python3.5/site-packages/django/apps/registry.py", line 78, in populate
[Thu Oct 27 09:44:15.480932 2016] [:error] [pid 15250] [remote 10.105.40.106:200] raise RuntimeError("populate() isn't reentrant")
[Thu Oct 27 09:44:15.480958 2016] [:error] [pid 15250] [remote 10.105.40.106:200] RuntimeError: populate() isn't reentrant
[Thu Oct 27 09:44:15.561544 2016] [:error] [pid 15250] [remote 10.105.40.106:54216] mod_wsgi (pid=15250): Target WSGI script '/home/rortega/smce/smce/wsgi.py' cannot be loaded as Python module.
[Thu Oct 27 09:44:15.561571 2016] [:error] [pid 15250] [remote 10.105.40.106:54216] mod_wsgi (pid=15250): Exception occurred processing WSGI script '/home/rortega/smce/smce/wsgi.py'.
[Thu Oct 27 09:44:15.561597 2016] [:error] [pid 15250] [remote 10.105.40.106:54216] Traceback (most recent call last):
[Thu Oct 27 09:44:15.561623 2016] [:error] [pid 15250] [remote 10.105.40.106:54216] File "/home/rortega/smce/smce/wsgi.py", line 16, in <module>
[Thu Oct 27 09:44:15.561658 2016] [:error] [pid 15250] [remote 10.105.40.106:54216] application = get_wsgi_application()
[Thu Oct 27 09:44:15.561675 2016] [:error] [pid 15250] [remote 10.105.40.106:54216] File "/home/rortega/smce_env/lib/python3.5/site-packages/django/core/wsgi.py", line 13, in get_wsgi_application
[Thu Oct 27 09:44:15.561703 2016] [:error] [pid 15250] [remote 10.105.40.106:54216] django.setup()
[Thu Oct 27 09:44:15.561719 2016] [:error] [pid 15250] [remote 10.105.40.106:54216] File "/home/rortega/smce_env/lib/python3.5/site-packages/django/__init__.py", line 18, in setup
[Thu Oct 27 09:44:15.561743 2016] [:error] [pid 15250] [remote 10.105.40.106:54216] apps.populate(settings.INSTALLED_APPS)
[Thu Oct 27 09:44:15.561774 2016] [:error] [pid 15250] [remote 10.105.40.106:54216] File "/home/rortega/smce_env/lib/python3.5/site-packages/django/apps/registry.py", line 78, in populate
[Thu Oct 27 09:44:15.561800 2016] [:error] [pid 15250] [remote 10.105.40.106:54216] raise RuntimeError("populate() isn't reentrant")
[Thu Oct 27 09:44:15.561824 2016] [:error] [pid 15250] [remote 10.105.40.106:54216] RuntimeError: populate() isn't reentrant
Another things i noticed before cheking funtionality:
When executing makemigrations, only one model file of my 4 apps made the migrations, like if there is only one app
python manage.py runserver without errors
RuntimeError: populate() isn't reentrant
In my experience this usually means there is an error in the Django project somewhere. It can be hard to locate. Also, don't forget to restart apache.
When executing makemigrations, only one model file of my 4 apps made the migrations, like if there is only one app
Try pointing makemigrations to the specific app:
python manage.py makemigrations appname
Don't forget to apply migrations afterward:
python manage.py migrate
For everyone getting this problem, it can be anything, like a wrong django configuration or something with de mod_wsgi.
in my case it was that i needed to build python 3 with the --enable-shared tag.
if this is also your case, you can follow this.

Centos httpd apache http server fails to start

I have open stack running and it was working fine I've rebooted and since have been unable to restart httpd
[root#h30 ~]# systemctl status httpd.service
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
Drop-In: /usr/lib/systemd/system/httpd.service.d
└─openstack-dashboard.conf
Active: failed (Result: exit-code) since Thu 2016-09-01 14:11:07 BST; 2min 13s ago
Docs: man:httpd(8)
man:apachectl(8)
Process: 10030 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=1/FAILURE)
Process: 10027 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
Process: 9944 ExecStartPre=/usr/bin/python /usr/share/openstack-dashboard/manage.py compress --force (code=exited, status=0/SUCCESS)
Process: 9919 ExecStartPre=/usr/bin/python /usr/share/openstack-dashboard/manage.py collectstatic --noinput --clear (code=exited, status=0/SUCCESS)
Main PID: 10027 (code=exited, status=1/FAILURE)
Sep 01 14:10:46 h30 python[9919]: Copying '/usr/lib/python2.7/site-packages/horizon/static/framework/widgets/help-panel/help...ive.js'
Sep 01 14:10:46 h30 python[9919]: Copying '/usr/lib/python2.7/site-packages/horizon/static/framework/widgets/help-panel/help...pec.js'
Sep 01 14:10:46 h30 python[9919]: Copying '/usr/lib/python2.7/site-packages/horizon/static/framework/widgets/help-panel/help...l.html'
Sep 01 14:10:46 h30 python[9919]: Copying '/usr/lib/python2.7/site-packages/horizon/static/framework/widgets/help-panel/help...ule.js'
Sep 01 14:10:46 h30 python[9919]: Copying '/usr/lib/python2.7/site-packages/horizon/static/framework/widgets/help-panel/help...pec.js'
Sep 01 14:11:07 h30 systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Sep 01 14:11:07 h30 systemd[1]: httpd.service: control process exited, code=exited status=1
Sep 01 14:11:07 h30 systemd[1]: Failed to start The Apache HTTP Server.
Sep 01 14:11:07 h30 systemd[1]: Unit httpd.service entered failed state.
Sep 01 14:11:07 h30 systemd[1]: httpd.service failed.
Hint: Some lines were ellipsized, use -l to show in full.
and I have no idea whats causing the issue to be honest, any help would be great.
Here is the error log
[Wed Aug 31 17:23:03.796739 2016] [core:notice] [pid 4346] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
[Wed Aug 31 17:23:06.653781 2016] [mpm_prefork:notice] [pid 4346] AH00170: caught SIGWINCH, shutting down gracefully
[Wed Aug 31 17:23:31.884455 2016] [core:notice] [pid 7547] SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0
[Wed Aug 31 17:23:31.885805 2016] [suexec:notice] [pid 7547] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Wed Aug 31 17:23:31.902192 2016] [so:warn] [pid 7547] AH01574: module php5_module is already loaded, skipping
[Wed Aug 31 17:23:31.902233 2016] [so:warn] [pid 7547] AH01574: module wsgi_module is already loaded, skipping
[Wed Aug 31 17:23:31.905613 2016] [auth_digest:notice] [pid 7547] AH01757: generating secret for digest authentication ...
[Wed Aug 31 17:23:32.100865 2016] [mpm_prefork:notice] [pid 7547] AH00163: Apache/2.4.6 (CentOS) PHP/5.4.16 mod_wsgi/3.4 Python/2.7.5 configured -- resuming normal operations
[Wed Aug 31 17:23:32.100922 2016] [core:notice] [pid 7547] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
[Wed Aug 31 18:35:11.515126 2016] [mpm_prefork:notice] [pid 7547] AH00170: caught SIGWINCH, shutting down gracefully
[Wed Aug 31 19:22:27.955740 2016] [core:notice] [pid 17956] SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0
[Wed Aug 31 19:22:27.968206 2016] [suexec:notice] [pid 17956] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Wed Aug 31 19:22:27.984913 2016] [so:warn] [pid 17956] AH01574: module php5_module is already loaded, skipping
[Wed Aug 31 19:22:27.984949 2016] [so:warn] [pid 17956] AH01574: module wsgi_module is already loaded, skipping
[Wed Aug 31 19:22:27.988204 2016] [auth_digest:notice] [pid 17956] AH01757: generating secret for digest authentication ...
[Wed Aug 31 19:22:28.303754 2016] [mpm_prefork:notice] [pid 17956] AH00163: Apache/2.4.6 (CentOS) PHP/5.4.16 mod_wsgi/3.4 Python/2.7.5 configured -- resuming normal operations
[Wed Aug 31 19:22:28.303816 2016] [core:notice] [pid 17956] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
[Thu Sep 01 09:35:49.397054 2016] [core:notice] [pid 20080] SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0
[Thu Sep 01 09:35:49.399094 2016] [suexec:notice] [pid 20080] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Thu Sep 01 09:35:49.415550 2016] [so:warn] [pid 20080] AH01574: module php5_module is already loaded, skipping
[Thu Sep 01 09:35:49.415588 2016] [so:warn] [pid 20080] AH01574: module wsgi_module is already loaded, skipping
[Thu Sep 01 09:35:49.418833 2016] [auth_digest:notice] [pid 20080] AH01757: generating secret for digest authentication ...
[Thu Sep 01 09:35:49.712957 2016] [mpm_prefork:notice] [pid 20080] AH00163: Apache/2.4.6 (CentOS) PHP/5.4.16 mod_wsgi/3.4 Python/2.7.5 configured -- resuming normal operations
[Thu Sep 01 09:35:49.713022 2016] [core:notice] [pid 20080] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
[Thu Sep 01 10:19:18.114919 2016] [mpm_prefork:notice] [pid 20080] AH00170: caught SIGWINCH, shutting down gracefully
[Thu Sep 01 10:22:37.210697 2016] [core:notice] [pid 5401] SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0
[Thu Sep 01 10:22:37.212740 2016] [suexec:notice] [pid 5401] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Thu Sep 01 10:22:37.228616 2016] [so:warn] [pid 5401] AH01574: module php5_module is already loaded, skipping
[Thu Sep 01 10:22:37.228654 2016] [so:warn] [pid 5401] AH01574: module wsgi_module is already loaded, skipping
[Thu Sep 01 10:22:37.231944 2016] [auth_digest:notice] [pid 5401] AH01757: generating secret for digest authentication ...
[Thu Sep 01 10:22:37.522692 2016] [mpm_prefork:notice] [pid 5401] AH00163: Apache/2.4.6 (CentOS) PHP/5.4.16 mod_wsgi/3.4 Python/2.7.5 configured -- resuming normal operations
[Thu Sep 01 10:22:37.522741 2016] [core:notice] [pid 5401] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
[Thu Sep 01 13:20:14.419086 2016] [mpm_prefork:notice] [pid 5401] AH00170: caught SIGWINCH, shutting down gracefully
[Thu Sep 01 13:20:48.116596 2016] [core:notice] [pid 41924] SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0
[Thu Sep 01 13:20:48.118260 2016] [suexec:notice] [pid 41924] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Thu Sep 01 13:20:48.133601 2016] [so:warn] [pid 41924] AH01574: module php5_module is already loaded, skipping
[Thu Sep 01 13:20:48.133632 2016] [so:warn] [pid 41924] AH01574: module wsgi_module is already loaded, skipping
[Thu Sep 01 13:20:48.136768 2016] [auth_digest:notice] [pid 41924] AH01757: generating secret for digest authentication ...
[Thu Sep 01 13:20:48.396768 2016] [mpm_prefork:notice] [pid 41924] AH00163: Apache/2.4.6 (CentOS) PHP/5.4.16 mod_wsgi/3.4 Python/2.7.5 configured -- resuming normal operations
[Thu Sep 01 13:20:48.396822 2016] [core:notice] [pid 41924] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
[Thu Sep 01 13:21:00.502249 2016] [mpm_prefork:notice] [pid 41924] AH00170: caught SIGWINCH, shutting down gracefully
[Thu Sep 01 13:21:25.497407 2016] [core:notice] [pid 44854] SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0
[Thu Sep 01 13:21:25.498739 2016] [suexec:notice] [pid 44854] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Thu Sep 01 13:21:25.514803 2016] [so:warn] [pid 44854] AH01574: module php5_module is already loaded, skipping
[Thu Sep 01 13:21:25.514842 2016] [so:warn] [pid 44854] AH01574: module wsgi_module is already loaded, skipping
[Thu Sep 01 13:21:25.518264 2016] [auth_digest:notice] [pid 44854] AH01757: generating secret for digest authentication ...
[Thu Sep 01 13:21:25.709404 2016] [mpm_prefork:notice] [pid 44854] AH00163: Apache/2.4.6 (CentOS) PHP/5.4.16 mod_wsgi/3.4 Python/2.7.5 configured -- resuming normal operations
[Thu Sep 01 13:21:25.709456 2016] [core:notice] [pid 44854] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
[Thu Sep 01 13:27:32.427493 2016] [mpm_prefork:notice] [pid 44854] AH00170: caught SIGWINCH, shutting down gracefully
[Thu Sep 01 13:30:35.056150 2016] [core:notice] [pid 5096] SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0
[Thu Sep 01 13:30:35.058238 2016] [suexec:notice] [pid 5096] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Thu Sep 01 13:30:35.075005 2016] [so:warn] [pid 5096] AH01574: module php5_module is already loaded, skipping
[Thu Sep 01 13:30:35.075040 2016] [so:warn] [pid 5096] AH01574: module wsgi_module is already loaded, skipping
[Thu Sep 01 13:30:35.078421 2016] [auth_digest:notice] [pid 5096] AH01757: generating secret for digest authentication ...
[Thu Sep 01 13:30:35.374300 2016] [mpm_prefork:notice] [pid 5096] AH00163: Apache/2.4.6 (CentOS) PHP/5.4.16 mod_wsgi/3.4 Python/2.7.5 configured -- resuming normal operations
[Thu Sep 01 13:30:35.374357 2016] [core:notice] [pid 5096] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
[Thu Sep 01 13:37:17.885730 2016] [mpm_prefork:notice] [pid 5096] AH00170: caught SIGWINCH, shutting down gracefully
Have you made any configuration changes? Does just rebooting the system is causing the issue? The error log does not showing any error.Can you enable the 'debug' level logging and try to restart your httpd service? and share the logs.
From the logs it seems you apache was started but immediately after few seconds it's shutdown.So,something is causing this shutdown.Have you configured any cron job for such service?
Thu Sep 01 13:20:48.396768 2016] [mpm_prefork:notice] [pid 41924] AH00163: Apache/2.4.6 (CentOS) PHP/5.4.16 mod_wsgi/3.4 Python/2.7.5 configured -- resuming normal operations
...
[Thu Sep 01 13:21:00.502249 2016] [mpm_prefork:notice] [pid 41924] AH00170: caught SIGWINCH, shutting down gracefully
Turns out SSLSessionCache was causing the issue
I had to go into /etc/httpd/conf.d ssl.conf
and comment out
#SSLSessionCache shmcb:/run/httpd/sslcache(512000)