Importerror when running flask with uwsgi - nginx

My server is giving internal server errors and I have not been able to solve it on my own. The links are what I've tried so far. But nothing works. The site worked before I added bokeh. Can I get some help?
EDIT: I have noticed my /venv/lib/python3.7/site-packages is missing a few modules, including bokeh. Can this be the cause? And why is it not there after I pip3 install bokeh while in virtual environment?
EDIT2: I have made some progress. My activate script hade wrong virtualenvironment so now I corrected it. When I do pip freeze now I get the error Too many symbolic links -- Fixed this - updated the shebang, it was pointing to itself instead of python
logs from uwsgi
pi#rpi$ uwsgi --socket 0.0.0.0:5000 --protocol=http -w wsgi:app
*** Starting uWSGI 2.0.19.1 (32bit) on [Wed Apr 21 12:08:12 2021] ***
compiled with version: 8.3.0 on 03 April 2021 20:29:49
os: Linux-5.10.17-v7+ #1403 SMP Mon Feb 22 11:29:51 GMT 2021
nodename: rpi
machine: armv7l
clock source: unix
detected number of CPU cores: 4
current working directory: /home/pi/myproject
detected binary path: /home/pi/.local/bin/uwsgi
!!! no internal routing support, rebuild with pcre support !!!
*** WARNING: you are running uWSGI without its master process manager ***
your processes number limit is 5334
your memory page size is 4096 bytes
detected max file descriptor number: 1048576
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uwsgi socket 0 bound to TCP address 0.0.0.0:5000 fd 5
Python version: 2.7.16 (default, Oct 10 2019, 22:02:15) [GCC 8.3.0]
*** Python threads support is disabled. You can enable it with --enable-threads ***
Python main interpreter initialized at 0x132180
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 64408 bytes (62 KB) for 1 cores
*** Operational MODE: single process ***
Traceback (most recent call last):
File "./wsgi.py", line 4, in <module>
app = create_app()
File "./application/__init__.py", line 49, in create_app
from .mypage import mypageView
File "./application/mypage/mypageView.py", line 1, in <module>
from bokeh.models import BoxSelectTool, LassoSelectTool, BoxAnnotation, Toggle, HoverTool, ColumnDataSource, LinearAxis, Range1d
ImportError: No module named bokeh.models
unable to load app 0 (mountpoint='') (callable not found or import error)
*** no app loaded. going in full dynamic mode ***
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI worker 1 (and the only) (pid: 7081, cores: 1)
logs from service
apr 21 11:54:45 rpi systemd[1]: Started uWSGI instance to serve site.
apr 21 11:54:45 rpi uwsgi[4513]: [uWSGI] getting INI configuration from myproject.ini
apr 21 11:54:45 rpi uwsgi[4513]: *** Starting uWSGI 2.0.19.1 (32bit) on [Wed Apr 21 11:54:45 2021] ***
apr 21 11:54:45 rpi uwsgi[4513]: compiled with version: 8.3.0 on 17 June 2020 09:19:11
apr 21 11:54:45 rpi uwsgi[4513]: os: Linux-5.10.17-v7+ #1403 SMP Mon Feb 22 11:29:51 GMT 2021
apr 21 11:54:45 rpi uwsgi[4513]: nodename: rpi
apr 21 11:54:45 rpi uwsgi[4513]: machine: armv7l
apr 21 11:54:45 rpi uwsgi[4513]: clock source: unix
apr 21 11:54:45 rpi uwsgi[4513]: pcre jit disabled
apr 21 11:54:45 rpi uwsgi[4513]: detected number of CPU cores: 4
apr 21 11:54:45 rpi uwsgi[4513]: current working directory: /home/pi/myproject
apr 21 11:54:45 rpi uwsgi[4513]: detected binary path: /home/pi/myproject/venv/bin/uwsgi
apr 21 11:54:45 rpi uwsgi[4513]: your processes number limit is 5334
apr 21 11:54:45 rpi uwsgi[4513]: your memory page size is 4096 bytes
apr 21 11:54:45 rpi uwsgi[4513]: detected max file descriptor number: 1024
apr 21 11:54:45 rpi uwsgi[4513]: lock engine: pthread robust mutexes
apr 21 11:54:45 rpi uwsgi[4513]: thunder lock: disabled (you can enable it with --thunder-lock)
apr 21 11:54:45 rpi uwsgi[4513]: uwsgi socket 0 bound to UNIX address myproject.sock fd 3
apr 21 11:54:45 rpi uwsgi[4513]: Python version: 3.7.3 (default, Jan 22 2021, 20:04:44) [GCC 8.3.0]
apr 21 11:54:45 rpi uwsgi[4513]: PEP 405 virtualenv detected: /home/pi/myproject/venv
apr 21 11:54:45 rpi uwsgi[4513]: Set PythonHome to /home/pi/myproject/venv
apr 21 11:54:45 rpi uwsgi[4513]: *** Python threads support is disabled. You can enable it with --enable-threads ***
apr 21 11:54:45 rpi uwsgi[4513]: Python main interpreter initialized at 0x2db650
apr 21 11:54:45 rpi uwsgi[4513]: your server socket listen backlog is limited to 100 connections
apr 21 11:54:45 rpi uwsgi[4513]: your mercy for graceful operations on workers is 60 seconds
apr 21 11:54:45 rpi uwsgi[4513]: mapped 386448 bytes (377 KB) for 5 cores
apr 21 11:54:45 rpi uwsgi[4513]: *** Operational MODE: preforking ***
apr 21 11:54:45 rpi uwsgi[4513]: added /home/pi/myproject/venv/ to pythonpath.
apr 21 11:54:47 rpi uwsgi[4513]: Traceback (most recent call last):
apr 21 11:54:47 rpi uwsgi[4513]: File "./wsgi.py", line 4, in <module>
apr 21 11:54:47 rpi uwsgi[4513]: app = create_app()
apr 21 11:54:47 rpi uwsgi[4513]: File "./application/__init__.py", line 49, in create_app
apr 21 11:54:47 rpi uwsgi[4513]: from .mypage import mypageView
apr 21 11:54:47 rpi uwsgi[4513]: File "./application/mypage/mypageView.py", line 1, in <module>
apr 21 11:54:47 rpi uwsgi[4513]: from bokeh.models import BoxSelectTool, LassoSelectTool, BoxAnnotation, Toggle, HoverTool, ColumnDataSource, LinearAxis, Range1d
apr 21 11:54:47 rpi uwsgi[4513]: ModuleNotFoundError: No module named 'bokeh'
apr 21 11:54:47 rpi uwsgi[4513]: unable to load app 0 (mountpoint='') (callable not found or import error)
apr 21 11:54:47 rpi uwsgi[4513]: *** no app loaded. going in full dynamic mode ***
apr 21 11:54:47 rpi uwsgi[4513]: *** uWSGI is running in multiple interpreter mode ***
apr 21 11:54:47 rpi uwsgi[4513]: spawned uWSGI master process (pid: 4513)
apr 21 11:54:47 rpi uwsgi[4513]: spawned uWSGI worker 1 (pid: 4530, cores: 1)
apr 21 11:54:47 rpi uwsgi[4513]: spawned uWSGI worker 2 (pid: 4531, cores: 1)
apr 21 11:54:47 rpi uwsgi[4513]: spawned uWSGI worker 3 (pid: 4532, cores: 1)
apr 21 11:54:47 rpi uwsgi[4513]: spawned uWSGI worker 4 (pid: 4533, cores: 1)
apr 21 11:54:47 rpi uwsgi[4513]: spawned uWSGI worker 5 (pid: 4534, cores: 1)
apr 21 12:00:01 rpi uwsgi[4513]: SIGINT/SIGQUIT received...killing workers...
apr 21 12:00:01 rpi systemd[1]: Stopping uWSGI instance to serve site...
apr 21 12:00:02 rpi uwsgi[4513]: worker 1 buried after 1 seconds
apr 21 12:00:02 rpi uwsgi[4513]: worker 2 buried after 1 seconds
apr 21 12:00:02 rpi uwsgi[4513]: worker 3 buried after 1 seconds
apr 21 12:00:02 rpi uwsgi[4513]: worker 4 buried after 1 seconds
apr 21 12:00:02 rpi uwsgi[4513]: worker 5 buried after 1 seconds
apr 21 12:00:02 rpi uwsgi[4513]: goodbye to uWSGI.
apr 21 12:00:02 rpi uwsgi[4513]: VACUUM: unix socket myproject.sock removed.
apr 21 12:00:02 rpi systemd[1]: myproject.service: Succeeded.
apr 21 12:00:02 rpi systemd[1]: Stopped uWSGI instance to serve site.
apr 21 12:00:02 rpi systemd[1]: Started uWSGI instance to serve site.
apr 21 12:00:02 rpi uwsgi[5547]: [uWSGI] getting INI configuration from myproject.ini
apr 21 12:00:02 rpi uwsgi[5547]: *** Starting uWSGI 2.0.19.1 (32bit) on [Wed Apr 21 12:00:02 2021] ***
apr 21 12:00:02 rpi uwsgi[5547]: compiled with version: 8.3.0 on 17 June 2020 09:19:11
apr 21 12:00:02 rpi uwsgi[5547]: os: Linux-5.10.17-v7+ #1403 SMP Mon Feb 22 11:29:51 GMT 2021
apr 21 12:00:02 rpi uwsgi[5547]: nodename: rpi
apr 21 12:00:02 rpi uwsgi[5547]: machine: armv7l
apr 21 12:00:02 rpi uwsgi[5547]: clock source: unix
apr 21 12:00:02 rpi uwsgi[5547]: pcre jit disabled
apr 21 12:00:02 rpi uwsgi[5547]: detected number of CPU cores: 4
apr 21 12:00:02 rpi uwsgi[5547]: current working directory: /home/pi/myproject
apr 21 12:00:02 rpi uwsgi[5547]: detected binary path: /home/pi/myproject/venv/bin/uwsgi
apr 21 12:00:02 rpi uwsgi[5547]: your processes number limit is 5334
apr 21 12:00:02 rpi uwsgi[5547]: your memory page size is 4096 bytes
apr 21 12:00:02 rpi uwsgi[5547]: detected max file descriptor number: 1024
apr 21 12:00:02 rpi uwsgi[5547]: lock engine: pthread robust mutexes
apr 21 12:00:02 rpi uwsgi[5547]: thunder lock: disabled (you can enable it with --thunder-lock)
apr 21 12:00:02 rpi uwsgi[5547]: uwsgi socket 0 bound to UNIX address myproject.sock fd 3
apr 21 12:06:37 rpi uwsgi[6733]: --- no python application found, check your startup logs for errors ---
apr 21 12:06:37 rpi uwsgi[6733]: [pid: 6750|app: -1|req: -1/9] 192.168.50.36 () {40 vars in 893 bytes} [Wed Apr 21 12:06:37 2021] GET /%7B%7B%20url_for('static',%20filename='img/50x.gif')%20%7D%7D => generated 21 bytes in 0 msecs (HTTP/1.1 500) 2 headers in 83 bytes (0 switches on core 0)
apr 21 12:06:37 rpi uwsgi[6733]: --- no python application found, check your startup logs for errors ---
apr 21 12:06:37 rpi uwsgi[6733]: [pid: 6750|app: -1|req: -1/10] 192.168.50.36 () {44 vars in 860 bytes} [Wed Apr 21 12:06:37 2021] GET /favicon.ico => generated 21 bytes in 0 msecs (HTTP/1.1 500) 2 headers in 83 bytes (0 switches on core 0)
apr 21 12:06:38 rpi uwsgi[6733]: --- no python application found, check your startup logs for errors ---
apr 21 12:06:38 rpi uwsgi[6733]: [pid: 6752|app: -1|req: -1/11] 192.168.50.36 () {44 vars in 930 bytes} [Wed Apr 21 12:06:38 2021] GET / => generated 21 bytes in 0 msecs (HTTP/1.1 500) 2 headers in 83 bytes (0 switches on core 0)
apr 21 12:06:38 rpi uwsgi[6733]: --- no python application found, check your startup logs for errors ---
apr 21 12:06:38 rpi uwsgi[6733]: [pid: 6752|app: -1|req: -1/12] 192.168.50.36 () {40 vars in 755 bytes} [Wed Apr 21 12:06:38 2021] GET /main.css => generated 21 bytes in 0 msecs (HTTP/1.1 500) 2 headers in 83 bytes (0 switches on core 0)
apr 21 12:06:38 rpi uwsgi[6733]: --- no python application found, check your startup logs for errors ---
apr 21 12:06:38 rpi uwsgi[6733]: [pid: 6752|app: -1|req: -1/13] 192.168.50.36 () {40 vars in 738 bytes} [Wed Apr 21 12:06:38 2021] GET /main.js => generated 21 bytes in 0 msecs (HTTP/1.1 500) 2 headers in 83 bytes (0 switches on core 0)
apr 21 12:06:38 rpi uwsgi[6733]: --- no python application found, check your startup logs for errors ---
apr 21 12:06:38 rpi uwsgi[6733]: [pid: 6752|app: -1|req: -1/14] 192.168.50.36 () {40 vars in 893 bytes} [Wed Apr 21 12:06:38 2021] GET /%7B%7B%20url_for('static',%20filename='img/50x.gif')%20%7D%7D => generated 21 bytes in 0 msecs (HTTP/1.1 500) 2 headers in 83 bytes (0 switches on core 0)
apr 21 12:06:38 rpi uwsgi[6733]: --- no python application found, check your startup logs for errors ---
apr 21 12:06:38 rpi uwsgi[6733]: [pid: 6750|app: -1|req: -1/15] 192.168.50.36 () {44 vars in 860 bytes} [Wed Apr 21 12:06:38 2021] GET /favicon.ico => generated 21 bytes in 0 msecs (HTTP/1.1 500) 2 headers in 83 bytes (0 switches on core 0)

Related

EC2 Linux instance crashes every few hours

I have installed a WordPress site in AWS EC2 t3.micro on platform Linux/UNIX. The ec2 instance stops responding every few hours. That means if I try to call the website from the browser I get "This site can't be reached" message. The site starts to work again if I reboot the instance from the ec2 console. The inbound rules for HTTP and HTTPS set to 0.0.0.0/0. There is a number of website visitors. There is 4.2G available space on the EC2 instance. The latest error log entries are:
[Tue Jul 12 09:01:50.142638 2022] [mpm_prefork:notice] [pid 566] AH00163: Apache/2.4.52 (Ubuntu) OpenSSL/3.0.2 configured -- resuming normal operations
[Tue Jul 12 09:01:50.142711 2022] [core:notice] [pid 566] AH00094: Command line: '/usr/sbin/apache2'
[Tue Jul 12 10:23:11.216290 2022] [php:warn] [pid 1077] [client X.X.X.X:57861] PHP Warning: Undefined array key "referrer" in /var/www/html/wp-content/plugins/elementor-pro/modules/forms/classes/form-record.php on line 179, referer: https://SITE-NAME-REMOVED/contact-us/
[Tue Jul 12 10:23:11.217667 2022] [php:warn] [pid 1077] [client X.X.X.X:57861] PHP Warning: Undefined array key "referrer" in /var/www/html/wp-content/plugins/elementor-pro/modules/forms/classes/form-record.php on line 179, referer: https://SITE-NAME-REMOVED/contact-us/
sh: 1: /usr/sbin/sendmail: not found
[Mon Jul 11 00:00:01.527769 2022] [mpm_prefork:notice] [pid 570] AH00163: Apache/2.4.52 (Ubuntu) OpenSSL/3.0.2 configured -- resuming normal operations
[Mon Jul 11 00:00:01.527800 2022] [core:notice] [pid 570] AH00094: Command line: '/usr/sbin/apache2'
[Mon Jul 11 13:44:17.339898 2022] [mpm_prefork:notice] [pid 577] AH00163: Apache/2.4.52 (Ubuntu) OpenSSL/3.0.2 configured -- resuming normal operations
[Mon Jul 11 13:44:17.347833 2022] [core:notice] [pid 577] AH00094: Command line: '/usr/sbin/apache2'
[Mon Jul 11 13:44:26.721451 2022] [php:warn] [pid 727] [client x.X.x.x:35130] PHP Warning: Undefined array key "referrer" in /var/www/html/wp-content/plugins/elementor-pro/modules/forms/classes/form-record.php on line 179, referer: https://SITE-NAME-REMOVED/contact-us/
[Mon Jul 11 13:44:26.722285 2022] [php:warn] [pid 727] [client x.x.x.x:35130] PHP Warning: Undefined array key "referrer" in /var/www/html/wp-content/plugins/elementor-pro/modules/forms/classes/form-record.php on line 179, referer: https://SITE-NAME-REMOVED/contact-us/
sh: 1: /usr/sbin/sendmail: not found
[Mon Jul 11 14:37:11.427820 2022] [mpm_prefork:notice] [pid 577] AH00169: caught SIGTERM, shutting down
[Mon Jul 11 17:32:49.756249 2022] [mpm_prefork:notice] [pid 600] AH00163: Apache/2.4.52 (Ubuntu) OpenSSL/3.0.2 configured -- resuming normal operations
[Mon Jul 11 17:32:49.756835 2022] [core:notice] [pid 600] AH00094: Command line: '/usr/sbin/apache2'
[Mon Jul 11 20:15:40.358852 2022] [mpm_prefork:notice] [pid 600] AH00169: caught SIGTERM, shutting down
Could anyone please advise?

Debian 9 / Apache 2.4 / Radicale 2.1 / uWSGI

I'm trying to use Radicale via uWSGI and Apache.
After some struggle, I managed to use WSGI for radicale on Apache but I would like to offload the authentication to Apache.
So I created the apache conf as
<VirtualHost *:80>
ServerAdmin xxx#gmail.com
ServerName radicale.domain.com
ProxyPass / uwsgi://127.0.0.1:5232/
<Directory "/etc/radicale">
AllowOverride None
Require all granted
</Directory>
TransferLog /var/log/apache2/radicale_access.log
ErrorLog /var/log/apache2/radicale_error.log
</VirtualHost>
My uwsgi app is
[uwsgi]
http-socket = 127.0.0.1:5232
processes = 2
plugin = python3
#module = radicale
wsgi-file=/etc/radicale/radicale.wsgi
env = RADICALE_CONFIG=/etc/radicale/config
When I call http://radicale.domain.com, I get a generic 500 error but I can't see any errors in the apache error log or the uswgi log.
The uwsgi log shows (in verbose)
Thu May 7 17:40:39 2020 - *** Starting uWSGI 2.0.14-debian (64bit) on [Thu May 7 17:40:39 2020] ***
Thu May 7 17:40:39 2020 - compiled with version: 6.3.0 20170516 on 17 March 2018 15:41:47
Thu May 7 17:40:39 2020 - os: Linux-2.6.32-042stab128.2 #1 SMP Thu Mar 22 10:58:36 MSK 2018
Thu May 7 17:40:39 2020 - nodename: xxx
Thu May 7 17:40:39 2020 - machine: x86_64
Thu May 7 17:40:39 2020 - clock source: unix
Thu May 7 17:40:39 2020 - pcre jit disabled
Thu May 7 17:40:39 2020 - detected number of CPU cores: 8
Thu May 7 17:40:39 2020 - current working directory: /
Thu May 7 17:40:39 2020 - writing pidfile to /run/uwsgi/app/radicale/pid
Thu May 7 17:40:39 2020 - detected binary path: /usr/bin/uwsgi-core
Thu May 7 17:40:39 2020 - setgid() to 33
Thu May 7 17:40:39 2020 - set additional group 125 (redis)
Thu May 7 17:40:39 2020 - set additional group 5003 (ispapps)
Thu May 7 17:40:39 2020 - set additional group 5004 (ispconfig)
Thu May 7 17:40:39 2020 - setuid() to 33
Thu May 7 17:40:39 2020 - your processes number limit is 256137
Thu May 7 17:40:39 2020 - your memory page size is 4096 bytes
Thu May 7 17:40:39 2020 - detected max file descriptor number: 131072
Thu May 7 17:40:39 2020 - lock engine: pthread robust mutexes
Thu May 7 17:40:39 2020 - thunder lock: disabled (you can enable it with --thunder-lock)
Thu May 7 17:40:39 2020 - uwsgi socket 0 bound to UNIX address /run/uwsgi/app/radicale/socket fd 3
Thu May 7 17:40:39 2020 - uwsgi socket 1 bound to TCP address 127.0.0.1:5232 fd 5
Thu May 7 17:40:39 2020 - Python version: 3.5.3 (default, Sep 27 2018, 17:25:39) [GCC 6.3.0 20170516]
Thu May 7 17:40:39 2020 - *** Python threads support is disabled. You can enable it with --enable-threads ***
Thu May 7 17:40:39 2020 - Python main interpreter initialized at 0x7fc12c963dd0
Thu May 7 17:40:39 2020 - your server socket listen backlog is limited to 100 connections
Thu May 7 17:40:39 2020 - your mercy for graceful operations on workers is 60 seconds
Thu May 7 17:40:39 2020 - mapped 218304 bytes (213 KB) for 2 cores
Thu May 7 17:40:39 2020 - *** Operational MODE: preforking ***
Thu May 7 17:40:39 2020 - WSGI app 0 (mountpoint='') ready in 0 seconds on interpreter 0x7fc12c963dd0 pid: 23261 (defau
lt app)
Thu May 7 17:40:39 2020 - *** uWSGI is running in multiple interpreter mode ***
Thu May 7 17:40:39 2020 - spawned uWSGI master process (pid: 23261)
Thu May 7 17:40:39 2020 - spawned uWSGI worker 1 (pid: 23267, cores: 1)
Thu May 7 17:40:39 2020 - spawned uWSGI worker 2 (pid: 23268, cores: 1)
How can I debug uwsgi? How can I see why Apache returns the 500 error? Have I done anything wrong with the conf - I find the docs not very useful when it comes to error debugging or understanding how to define modules
Okay, after a week of contemplating, debugging and some swearing, I saw my quite stupid mistake :(
I configured a HTTP socket in UWSGI
http-socket = 127.0.0.1:5232
but specified the uwsgi protocol in Apache ...
ProxyPass / uwsgi://127.0.0.1:5232/

OpenStack Keystone Identity Service Httpd Failed (rocky version)

Hello and thanks for taking some of your time to check my problem
i'm following the detailed steps by openstack to install openstack in no avail (https://docs.openstack.org/keystone/rocky/install/keystone-install-rdo.html)
I've tried to change the 5000 port for the service but the result is the same
any insights are most welcomed
[root#localhost i-openstack]# systemctl enable httpd.service
[root#localhost i-openstack]# systemctl start httpd.service
Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details.
[root#localhost i-openstack]# journalctl -xe
Oct 08 05:12:39 localhost.localdomain systemd[1]: Failed to start The Apache HTTP Server.
-- Subject: Unit httpd.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit httpd.service has failed.
--
-- The result is failed.
Oct 08 05:12:39 localhost.localdomain systemd[1]: Unit httpd.service entered failed state.
Oct 08 05:12:39 localhost.localdomain systemd[1]: httpd.service failed.
Oct 08 05:12:39 localhost.localdomain polkitd[1824]: Unregistered Authentication Agent for unix-process:4229:106865 (system bus name :1.42, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8) (disconnected from bus)
Oct 08 05:27:21 localhost.localdomain polkitd[1824]: Registered Authentication Agent for unix-process:4930:195069 (system bus name :1.43 [/usr/bin/pkttyagent --notify-fd 5 --fallback], object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale
Oct 08 05:27:21 localhost.localdomain systemd[1]: Reloading.
Oct 08 05:27:21 localhost.localdomain polkitd[1824]: Unregistered Authentication Agent for unix-process:4930:195069 (system bus name :1.43, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8) (disconnected from bus)
Oct 08 05:27:26 localhost.localdomain polkitd[1824]: Registered Authentication Agent for unix-process:4950:195568 (system bus name :1.44 [/usr/bin/pkttyagent --notify-fd 5 --fallback], object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale
Oct 08 05:27:26 localhost.localdomain systemd[1]: Starting The Apache HTTP Server...
-- Subject: Unit httpd.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit httpd.service has begun starting up.
Oct 08 05:27:26 localhost.localdomain httpd[4956]: (13)Permission denied: AH00072: make_sock: could not bind to address [::]:5000
Oct 08 05:27:26 localhost.localdomain httpd[4956]: (13)Permission denied: AH00072: make_sock: could not bind to address 0.0.0.0:5000
Oct 08 05:27:26 localhost.localdomain httpd[4956]: no listening sockets available, shutting down
Oct 08 05:27:26 localhost.localdomain httpd[4956]: AH00015: Unable to open logs
Oct 08 05:27:26 localhost.localdomain systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Oct 08 05:27:26 localhost.localdomain kill[4958]: kill: cannot find process ""
Oct 08 05:27:26 localhost.localdomain systemd[1]: httpd.service: control process exited, code=exited status=1
Oct 08 05:27:26 localhost.localdomain systemd[1]: Failed to start The Apache HTTP Server.
-- Subject: Unit httpd.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit httpd.service has failed.
--
-- The result is failed.
Oct 08 05:27:26 localhost.localdomain systemd[1]: Unit httpd.service entered failed state.
Oct 08 05:27:26 localhost.localdomain systemd[1]: httpd.service failed.
Oct 08 05:27:26 localhost.localdomain polkitd[1824]: Unregistered Authentication Agent for unix-process:4950:195568 (system bus name :1.44, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8) (disconnected from bus)
Oct 08 05:34:01 localhost.localdomain polkitd[1824]: Registered Authentication Agent for unix-process:5222:235020 (system bus name :1.45 [/usr/bin/pkttyagent --notify-fd 5 --fallback], object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale
Oct 08 05:34:01 localhost.localdomain systemd[1]: Reloading.
Oct 08 05:34:01 localhost.localdomain polkitd[1824]: Unregistered Authentication Agent for unix-process:5222:235020 (system bus name :1.45, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8) (disconnected from bus)
Oct 08 05:34:03 localhost.localdomain polkitd[1824]: Registered Authentication Agent for unix-process:5240:235248 (system bus name :1.46 [/usr/bin/pkttyagent --notify-fd 5 --fallback], object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale
Oct 08 05:34:03 localhost.localdomain systemd[1]: Starting The Apache HTTP Server...
-- Subject: Unit httpd.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
SOLUTION : It seemed i had to disable SELinux
Disable temporaliy
sudo setenforce 0
Restart httpd service
service httpd restart
Disable SELinux persistently (reboot required)
nano /etc/selinux/config
SELINUX=disabled

mariadb on Ubuntu ignoring my.cnf

MariaDB version: 10.0.34
Ubuntu version: 16.04.4 LTS
I am trying to turn on log_bin in a newly installed mariadb. I created a binlog.cnf file in /etc/mysql/conf.d/:
[mysqld]
server_id=1
log_bin=/var/lib/mysql/mariadb-bin
log_bin_index=/var/lib/mysql/mariadb-bin.index
log_queries_not_using_indexes
binlog-ignore-db=mysql
binlog-ignore-db=performance_schema
binlog-ignore-db=information_schema
binlog-ignore-db=phpmyadmin
binlog-ignore-db=test
So mysqld --print-defaults indicates that the config is read, but show variables still shows that log_bin is off.
# mysqld --print-defaults
mysqld would have been started with the following arguments:
--server_id=1
--log_bin=/var/lib/mysql/mariadb-bin
--log_bin_index=/var/lib/mysql/mariadb-bin.index
--binlog-ignore-db=mysql
--binlog-ignore-db=performance_schema
--binlog-ignore-db=information_schema
--binlog-ignore-db=phpmyadmin
--binlog-ignore-db=test
[...]
> show variables like '%log_bin%';\G";
+---------------------------------+-------+
| Variable_name | Value |
+---------------------------------+-------+
| log_bin | OFF |
| log_bin_trust_function_creators | OFF |
| sql_log_bin | ON |
+---------------------------------+-------+
The file /etc/mysql/my.cnfwas a symlink to /etc/alternatives/my.cnf which symlinked to /etc/mysql/mariadb.cnf ... so I deleted the my.cnf link and created an actual my.cnf file instead as a copy of mariadb.cnf. According to https://stackoverflow.com/a/46246285/3319392 a bug could mean that mariadb can't follow symlinks... but this didn't change anything.
I have restarted mysql many times, and I even tried to put rubbish in my.cnf to see if mysql would complain, but it doesn't. There is nothing in the error log and this is syslog when mysql is restarted:
May 22 16:17:26 smtp2 systemd[1]: Stopping LSB: Start and stop the mysql database server daemon...
May 22 16:17:26 smtp2 mysql[29682]: * Stopping MariaDB database server mysqld
May 22 16:17:27 smtp2 mysql[29682]: ...fail!
May 22 16:17:27 smtp2 systemd[1]: mysql.service: Control process exited, code=exited status=1
May 22 16:17:27 smtp2 systemd[1]: Stopped LSB: Start and stop the mysql database server daemon.
May 22 16:17:27 smtp2 systemd[1]: mysql.service: Unit entered failed state.
May 22 16:17:27 smtp2 systemd[1]: mysql.service: Failed with result 'exit-code'.
May 22 16:17:27 smtp2 systemd[1]: Starting LSB: Start and stop the mysql database server daemon...
May 22 16:17:27 smtp2 mysql[29706]: * Starting MariaDB database server mysqld
May 22 16:17:27 smtp2 mysql[29706]: ...done.
May 22 16:17:27 smtp2 systemd[1]: Started LSB: Start and stop the mysql database server daemon.
Filepermissions in /etc/mysql/
drwxr-xr-x 4 root root 4096 May 22 16:50 .
drwxr-xr-x 108 root root 4096 May 17 06:33 ..
drwxr-xr-x 2 root root 4096 May 22 16:56 conf.d
-rw------- 1 root root 277 Mar 22 16:01 debian.cnf
-rwxr-xr-x 1 root root 1426 Mar 6 10:15 debian-start
-rw-r--r-- 1 root root 869 May 22 15:04 mariadb.cnf
drwxr-xr-x 2 root root 4096 Mar 22 16:01 mariadb.conf.d
-rw-r--r-- 1 root root 868 May 22 16:21 my.cnf
Filepermissions in /etc/mysql/conf.d/
-rw-r--r-- 1 mysql mysql 303 May 22 16:56 binlog.cnf
-rw-r--r-- 1 root root 8 Jan 21 2017 mysql.cnf
-rw-r--r-- 1 root root 55 Jan 21 2017 mysqldump.cnf
Filepermissions in /var/lib/mysql/:
drwxr-xr-x 7 mysql mysql 4096 May 22 16:00 .
drwxr-xr-x 48 root root 4096 May 2 06:16 ..
-rw-rw---- 1 mysql mysql 16384 Apr 11 16:43 aria_log.00000001
-rw-rw---- 1 mysql mysql 52 Apr 11 16:43 aria_log_control
-rw-r--r-- 1 root root 0 Mar 22 16:01 debian-10.0.flag
-rw-rw---- 1 mysql mysql 12582912 May 22 16:58 ibdata1
-rw-rw---- 1 mysql mysql 50331648 May 22 16:58 ib_logfile0
-rw-rw---- 1 mysql mysql 50331648 Mar 22 16:01 ib_logfile1
-rw-rw---- 1 mysql mysql 0 May 22 15:27 mariadb-bin.index
-rw-rw---- 1 mysql mysql 0 Mar 22 16:01 multi-master.info
drwx------ 2 mysql root 4096 Mar 22 16:01 mysql
-rw-rw---- 1 mysql mysql 0 May 22 14:48 mysql-bin.index
-rw------- 1 root root 15 Mar 22 16:01 mysql_upgrade_info
drwx------ 2 mysql mysql 4096 Mar 22 16:01 performance_schema
drwx------ 2 mysql mysql 4096 Apr 10 16:20 phpmyadmin
drwx------ 2 mysql mysql 4096 May 22 16:58 postfix
drwx------ 2 mysql mysql 4096 Mar 22 16:02 test
I got some help from a friend :-)
On this Ubuntu version the /etc/mysql dir has a few subdirs with numerous *.cnf files. I placed my binlog.cnf in subdir conf.d/ but another file with an empty [mysqld] section was later loaded in subdir mariadb.conf.d, overriding mine... so moving my binlog configuration to mariadb.conf.d/50-server.cnf solved the issue.

How to solve exit signal Segmentation fault (11)

After I migrated wordpress from a shared host to my own VPS I got the unpleasant surprise that half of the back-end pages on my websites rendered a No data receive ERR_EMPTY_RESPONSE.
Determined to find out what caused the problem I started troubleshooting. 7 of my 8 websites were affected, all running wordpress 4.1.5. Upgrading to 4.2.2 did not fix the problem.
The only unaffected website is an old website running on wordpress 3.3.1. Upgrading this website to run 4.2.2 results in the same errors. When I try to do a fresh wordpress install the same error pops up after step one (both when installing 4.2.2 and 3.3.1).
The 7 sites are running on 4 different themes, and I tried dis-enabling all plugins, still no luck.
I had a look at the error logs, I will copy a fragment here since they might provide some useful info. I've been googling all these lines but can't find the solution yet.
[Sun Jun 21 10:22:41 2015] [notice] caught SIGTERM, shutting down
[Sun Jun 21 10:22:42 2015] [notice] SSL FIPS mode disabled
[Sun Jun 21 10:22:42 2015] [warn] RSA server certificate CommonName (CN) `localhost' does NOT match server name!?
[Sun Jun 21 10:22:42 2015] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Sun Jun 21 10:22:43 2015] [notice] SSL FIPS mode disabled
[Sun Jun 21 10:22:43 2015] [warn] RSA server certificate CommonName (CN) `localhost' does NOT match server name!?
[Sun Jun 21 10:22:43 2015] [notice] Apache/2.2.22 (Unix) mod_ssl/2.2.22 OpenSSL/1.0.0-fips DAV/2 PHP/5.2.17 configured -- resuming normal operations
[Sun Jun 21 10:22:59 2015] [notice] child pid 3943 exit signal Segmentation fault (11)
[Sun Jun 21 10:23:00 2015] [notice] child pid 3944 exit signal Segmentation fault (11)
[Sun Jun 21 10:23:02 2015] [notice] child pid 3945 exit signal Segmentation fault (11)
[Sun Jun 21 10:23:03 2015] [notice] child pid 3942 exit signal Segmentation fault (11)
[Sun Jun 21 10:23:04 2015] [notice] child pid 4080 exit signal Segmentation fault (11)
[Sun Jun 21 10:23:05 2015] [notice] child pid 3946 exit signal Segmentation fault (11)
[Sun Jun 21 10:23:06 2015] [notice] child pid 4083 exit signal Segmentation fault (11)
[Sun Jun 21 10:23:07 2015] [notice] child pid 4082 exit signal Segmentation fault (11)

Resources