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!

Leave a comment

 

Test – new version of ITauthor notes

December 2nd, 2004

This is the first entry in the new incarnation of this weblog.

Leave a comment



Site notes

August 14th, 2004

At some point, I really must get round to designing this weblog. There is some interesting information about using stylesheets on an MT blog here: http://weblog.burningbird.net/archives/2004/06/30/mary-janes-and-site-design/ I like the idea of being able to choose your preferred style, particularly if the site uses a cookie to remember the style you chose for next time you visit. But right now, I need to find out how to delete all the spam comments I've been getting. The standard design I chose for this blog when I set it up had a comment facility turned on. I didn't think it would get much use, but I thought there was no harm in having it there. WRONG! People set up irritating scripts that go around searching for weblog comment forms and post comments automatically with links to their sites (usually porn sites). Why? Well, when Google is working out how to rank sites found in a search it takes into consideration the number of other sites that link to the site. So the BBC get a high rank, because lots of sites contain links to the BBC website, but www.itauthor.com gets a low rank because (as of today) no one has linked to it. So far I've found out how to remove comments in MT if your blog is saved in a mySQL database, but mine isn't (my ISP doesn't allow it) so I need to keep looking. I will also remove the comments form. What I'm also looking for is a form that will email comments to me, so that I can vet them and add them to the blog if I choose. I could write this myself in Perl, but there must be an MT module out there that I can use.

Leave a comment



Perl Coding Standards

August 12th, 2004

A colleague pointed out this page: www.bbc.co.uk/guidelines/webdev/AppA.Perl_Coding_Standards.htm This is a set of Perl coding guidelines for developers working for the BBC. Most of what's in it is straightforward good sense. One thing I hadn't come across, and hadn't considered before is flagged up by the following paragraph: "You MUST NOT put markup language in code. CPAN provides several good templating modules, and a stripped-down version of an HTML::Template (called BBC::CGI::Template) can also be used. There should not be any situation where you need to put HTML or other markup into Perl code." This caused me to go away and look at the HTML::Template module. I use HTML in my Perl CGI scripts all the time. Using templates seems like a much better idea and I intend to start using templates from now on.

Leave a comment



Setting a maximum width for a table

June 29th, 2004

I often seem to need to create tables that shrink and grow in width within a minimum and maximum limit. This should be easy with CSS, using the max-width table property. However, this isn't supported in IE, so I used to use some fiendishly complex ways of achieving this.

The minimum width bit is simple. Just put something in the table that can't break. For example, you can use a 1x1 pixel gif image, stretched to the desired width.

It's the maximum width bit that's the difficult part. However, the following bit of code shows how to achieve this easily. I found this somewhere and have unfortunately forgotten where it came from. So apologies for not crediting the original author.

<html>
<head>
  <style type="text/css">
  .MaxWidthTable {
    width: 100%;
    max-width: 500px;
    width: expression(document.body.clientWidth > 500 ? "500px" : "100%" );
    border: solid black 1px;
  }
  </style>
</head>

<body>
  <table class="MaxWidthTable">
    <tr>
      <td>Contents of table here ...</td>
    </tr>
  </table>
</body>
</html>

Fill the table up with content and check out how it expands to 500 pixels wide and then stops. The CSS uses the max-width property, but also uses an expression to say: IF the width is more than 500 pixels THEN make the width 500 pixels ELSE make the width 100%.

Leave a comment



^ back to top ^

Page 84 of 98« FirstNewer102030828384858690OlderLast »