Argh! Apache permissions on Fedora Core 4

2 01 2007

I’ve been installing a WordPress server in work to enable blogging by the engineers. The idea is that if everyone keeps an online notebook of what they’ve been doing, and we crawl it with our Sharepoint server, you’ll have ready access to everyone’s online notes… Nice idea – getting people to use it will be the difficult part of course.

I read the “famous 5-minute installation” notes, and the more detailed stuff, but couldn’t get past an apparent permissions problem.

I’d followed the WordPress installation guide as best I could, installing the required bits and pieces – mysql, php, etc. After all that, I found that I could get the basic httpd error page that proved the server was working. I wrote a PHP script as follows to make sure that PHP was working:


All that seemed to be fine. So I put my WordPress files into the /var/www/html/wordpress directory and hoped for the best. I edited the wp-config-sample.php with the appropriate settings and saved it as wp-config.php. All set to go – I thought.

When trying to get http://localhost/wordpress/wp-admin/install.php, however, I got the following:

You don't have permission to access /wordpress/wp-admin/install.php on this server.
Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.
Apache/2.0.54 (Fedora) Server at Port 80

Thinking back, I remembered I had a permissions problem on Fedora Core 5 at home when I was trying to teach myself some Perl. It drove me nuts for about a day. I tried all sorts of liberal filesystem permissions and messing with the user under which httpd was running – all to no avail. Little did I know, it has nothing to do with filesystem permissions! I solved it that time by removing the httpd RPM, downloading the source from Apache and compiling from scratch.

This time, I found that it is actually SELinux that causes this issue. If it is incorrectly configured it seems to cause the permissions problem. Here’s how to open up your security to get up and running. It is not advisable to do this and leave it this way on a server that will be public-facing though. I recommend tightening security again afterwards to be as safe as possible…

On the desktop, click Desktop | System Settings | Security Level and give the root user’s password.

A window like the following will appear (click the thumbnail to enlarge):


The option “Disable SELinux protection for httpd daemon” will be un-checked by default. Put a tick in the box and click the OK button.

I’m not sure if you need to do this, but I re-started the httpd daemon for good measure using the command:
/etc/init.d/httpd restart

Permissions problem solved – albeit a bit crudely. Since this is a test-server within a lab environment, it isn’t an issue, but more care should be taken if you’re installing a production server.

On to the next problem… PHP’s Mysql module isn’t installed for some reason.

Thanks to Wojciech Bednarski’s instructions – even though they are for Gentoo, some of the Mysql stuff helped!




2 responses

9 01 2007

You need to install the phpmysql extension in add and remove applications in linux. Myself I use slackware, mandrake 11, and fedora core. You can add this module by going to application, add and remove applications, then once opened goto the server area/mysql/ details and make sure that php-mysql module is checked. then click whatever/ next or what have you. The reboot the system, then the module will be setup and installed correctly.

9 01 2007

Ah Charles – thanks for taking the time to help out. I tried doing it a different way, by doing a “yum install php-mysql”, but it kept failing due to some dependency.

In the end, and since I’d been trying and failing to upgrade to Fedora Core 6, I did an FTP upgrade using disk 1 of FC6. Re-did the MySql stuff and ran through the WordPress 5 minute install – this time it worked first off!

A bit of a coward’s way out I suppose…

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: