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 tank.telindus.co.uk 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:
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!