Install Mediawiki and Lighttpd on Fedora 10

Posted in Linux , howto

Install lighttpd and lighttpd-fastcgi. My version is 1.4.20-6.fc10 but it shouldn’t matter what version you’re using as long as it’s not ancient.

$ sudo yum install lighttpd lighttpd-fastcgi

Install php. My version happens to be 5.2.6-5. If you’re trying to install on an older version of Fedora, you will get different versions of all your software, but this should all still work just fine since you’ll grab all binary distributions from the repositories, making upgrading in the future a breeze.

$ sudo yum install php php-common php-pgsql

Install postgres (or some other database if you want, mediawiki can use several different ones, just look in config/index.php after you install it and it has sections for all the databases it supports). My version is version 8.3.6-1.fc10

$ sudo yum install postgresql postgresql-server postgresql-devel postgresql-libs

Install mediawiki and then move it under your webserver root. My version: 1.14.0-45.fc10

$ sudo yum install mediawiki
$ sudo mv /usr/share/mediawiki /var/www/lighttpd/wiki

Edit /etc/lighttpd/lighttpd.conf and enable mod_rewrite, mod_redirect, mod_fastcgi, and optionally mod_status and mod_accesslog (this will allow you to quickly test to see if everythings working by checking the status and current running config, but you could leave this out if you want) If you plan on running in a hostile environment, you probably want to configure mod_auth with ldap or something (i’ll write that up next) and enable logging.

To allow for clean SEO urls, add this: (If you put your mediawiki directory under something else, you’ll want to change the redirect location to something other than wiki.)

url.redirect = ( “^/(?!w|wiki|robots\.txt|server-status|server-config|favicon\.ico)(.*)” => “/wiki/$1″ )

And make sure you’ve got this enabled so they don’t get cached along with everything else, (I can’t remember if it was commented out to begin with or not, so just check…)

static-file.exclude-extensions = ( “.php”, “.pl”, “.fcgi” )

Now enable php by adding this to that same config file:

fastcgi.server = ( “.php” =>
( “localhost” =>
(
“socket” => “/var/run/lighttpd/php-fastcgi.socket”,
“bin-path” => “/usr/bin/php-cgi”
) ) )

If you run the latest up-to-date version of php like I do, then dont forget to change the “bin-path” to your php-cgi installation. I unpack php source in /opt and build it to run from there, so I end up with /opt/php-5.2.9/ and /opt/php-fcgi/ so my bin-path is “/opt/php-fcgi/bin/php-cgi”

Start your database and lighttpd.

$ sudo /etc/init.d/postgres initdb
$ sudo /etc/init.d/postgres start
$ sudo /etc/init.d/lighttpd start

If you have any issues, they’ll show up in /var/log/lighttpd/error.log (unless you change the location of this log of course)

Now open your browser and point to the wiki. In my case this was just http://localhost/wiki. Fill out the information, and install. I used postgres/postgres for my super user because it’s a basic installation for testing purposes. If you’re installing a bunch of apps that use the same DBMS on this system then use something like wikidb and wikiuser for the db and user names, or at least something descriptive so you’ll know what you’re looking at when you go digging into the database later on.

Checking environment…
Please include all of the lines below when reporting installation problems.
* PHP 5.2.6 installed
* Found database drivers for: MySQL PostgreSQL
* PHP server API is cgi-fcgi; using ugly URLs (index.php?title=Page_Title)
* Have XML / Latin1-UTF-8 conversion support.
* Warning: Your session.save_path value (/var/lib/php/session) appears to be invalid or is not writable. PHP needs to be able to save data to this location for correct session operation.
* PHP’s memory_limit is 32M.
* Couldn’t find Turck MMCache, eAccelerator, APC or XCache; cannot use these for object caching.
* Found GNU diff3: /usr/bin/diff3.
* Found ImageMagick: /usr/bin/convert; image thumbnailing will be enabled if you enable uploads.
* Found GD graphics library built-in.
* Installation directory: /var/www/lighttpd/wiki
* Script URI path: /wiki
* Installing MediaWiki with php file extensions
* Environment checked. You can install MediaWiki.

“To complete the installation, move config/LocalSettings.php to the parent directory.” just like it says…

I noticed with the default fedora php, you ccan’t log in to your wiki, so I tailed the error.log and saw the problem:

(mod_fastcgi.c.2618) FastCGI-stderr: PHP Warning: Unknown: open(/var/lib/php/session/sess_abcdefg123456789c5, O_RDWR) failed: Permission denied (13) in Unknown on line 0
PHP Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/lib/php/session) in Unknown on line 0

Change the ownership of the directories to lighttpd:lighttpd and you’re all set. Fedora assumes you’re going to be using apache, so the owner is apache by default.

$ sudo chown -R lighttpd:lighttpd /var/lib/php

Posted by admica   @   4 March 2009

Related Posts

Like this post? Share it!

Digg Twitter StumbleUpon Delicious Technorati Facebook RSS

0 Comments

No comments yet. Be the first to leave a comment !
Leave a Comment

Name

Email

Website

Previous Post
« The Linux Foundation is relaunching Linux.com
Next Post
LDAP + Lighttpd :: Easy setup »
Powered by Wordpress   |   Lunated designed by ZenVerse