I'm using the mySQLdb module within my django application which is linked to Apache via WSGI. However I'm getting permission issues (shown below). This is down to SElinux and if I set it to passive everything is ok.
ImproperlyConfigured: Error loading MySQLdb module: /opt/django/virtenv/django15/lib/python2.7/site-packages/_mysql.so: failed to map segment from shared object: Permission denied
What is the best way to update SELinux to include this without having to turn off the whole the thing. The error is shown below:
ImproperlyConfigured: Error loading MySQLdb module: /opt/django/virtenv/django1/lib/python2.7/site-packages/_mysql.so: cfailed to map segment from shared object: Permission denied
As @Gohn67 suggests, change the SELinux security context of the file in question, allowing the HTTPD process to execute it:
sudo chcon -R -h -t httpd_sys_script_exec_t /opt/django/virtenv/django15/lib/python2.7/site-packages/_mysql.so
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With