seLinux – Mordac the Preventer of Information Services

Written by James McDonald

October 19, 2011

The Problem:
I was trying to do a mkdir using php in a cakephp file upload script and I got an error:

2011-10-18 21:55:48 Warning: Warning (2): mkdir()
[http://php.net/function.mkdir]: No such file or directory in
[/home/user/public_html/mapdb-dev/app_controller.php, line 57]

The Cause
Sigh if only I had a greater understanding of seLinux like the rocket scientists at NASA who designed it. Then I wouldn’t keep having these annoying errors.

Anyway seeing as it’s a part of the system and traditionally I just turned seLinux off (i.e. set SELINUXTYPE=disabled in /etc/selinux/config).

The Resolution
I will give selinux a chance to do it’s job and put the fix into place:

chcon -Rv --type=httpd_user_content_rw_t /home/user/public_html/mapdb-dev/webroot/

Refs
Redhat Page on SeLinux Audit2Allow

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The reCAPTCHA verification period has expired. Please reload the page.

You May Also Like…

Squarespace Image Export

To gain continued access to your Squarespace website images after cancelling your subscription you have several...

MySQL 8.x GRANT ALL STATEMENT

-- CREATE CREATE USER 'tgnrestoreuser'@'localhost' IDENTIFIED BY 'AppleSauceLoveBird2024'; GRANT ALL PRIVILEGES ON...

Exetel Opt-Out of CGNAT

If your port forwards and inbound and/or outbound site-to-site VPN's have failed when switching to Exetel due to their...