Movable Type unable to write files

December 2nd, 2004

I had a real struggle getting Movable Type to work after I'd installed it. The problem, and the solution are described below (from a Movable Type Support Forum):
"Permission Denied" but permissions are 777,
MT can't write files

alistairc
Posted: Dec 1 2004, 02:51 PM  
Group: Members
Posts: 4
Member No.: 28429
Joined: 1-December 04
I've installed MT 3.1
Everything seems to be okay, except when I try to add an entry.

The cgi files are installed in /var/www/cgi-bin/mt/
Other MT files are in /var/www/html/mt/ which I've blown wide open with chmod -R 777 /var/www/html/mt/

I have set
NoTempFiles 1
in mt.cfg

I created a new weblog, but when I edit the Core Setup and click Rebuild My Site I get:

Writing to '/var/www/html/mt/index.html' failed: Opening local file '/var/www/html/mt/index.html' failed: Permission denied

I don't understand this, as this directory has 777 permissions.

Can anyone help?
I've trawled about in Google but everything suggested has had not effect. I've tried deleting the weblog, deleting the mySQL database, re-running mt-load.cgi - but I get the same problem.

shelley
Posted: Dec 1 2004, 07:04 PM  
Group: Six Apart
Posts: 17192
Member No.: 22617
Joined: 8-November 01
Do you have an index.html that already exists in that folder? Perhaps try deleting it?

alistairc
Posted: Dec 2 2004, 04:10 AM  
Group: Members
Posts: 4
Member No.: 28429
Joined: 1-December 04
Nope, no index file in that folder.

I did have the static files/folders there. I tried moving them elsewhere (and changing the config file) but I get the same error message when I try to rebuild:

Writing to '/var/www/html/mt/index.html' failed: Opening local file '/var/www/html/mt/index.html' failed: Permission denied

alistairc
Posted: Dec 2 2004, 04:29 AM  
Group: Members
Posts: 4
Member No.: 28429
Joined: 1-December 04
I get the feeling this might be an Apache thing - something stopping CGI scripts writing files.

I moved the CGI files from /var/www/cgi-bin/mt/ to /var/www/cgi-bin/ just in case Apache was particular about where Perl scripts are run from, but that didn't help - same error message.

It seems like something is blocking mt.cgi from writing files, even though permissions are wide open.

alistairc
Posted: Dec 2 2004, 05:44 PM  
Group: Members
Posts: 4
Member No.: 28429
Joined: 1-December 04
OK, I finally found out what my problem was.
I wasn't an Apache problem as such, but I was close.

The problem was caused by using SELinux in Fedora Core 3.

(I don't know what SELinux is, except that it's something to do with security. I'll be reading up on it in the very near future.)

I found the answer while searching for help with another problem I was having (namely how to get past the error: "Can't connect to local MySQL server through socket /var/lib/mysql/mysql.sock" when trying to start up phpMyAdmin).

Google led me to this page:
http://groups-beta.google.com/group/alt.php.sql/...a983b3d20a60eda
where the answer is:
"adjust settings SELinux for httpd/apache"

As soon as I read that I reckonned these two problems might have a common cause. Sure enough, once I'd disabled SELinux, both problems were solved.

To disable SELinux (using the Gnome desktop), go to:
Applications > System Settings > Security Level
This opens the Security Level Configuration dialog box.
Go to the SELinux tab and clear the selection on the check boxes: "Enabled (Modification Requires Reboot)" and "Enforcing Current: Permissive".

You don't need to reboot, or restart httpd, the fix works as soon as you click OK.

However, I'm not happy about having to disable something that was obviously designed to increase security (even if I don't know much about SELinux yet). And I don't much care for having a subdirectory of my html directory that has 777 permissions.

But at least it all works now!

This website uses IntenseDebate comments, but they are not currently loaded because either your browser doesn't support JavaScript, or they didn't load fast enough.

Leave a comment