Mediawiki Install FC6

From Aktivix
Revision as of 01:14, 21 January 2007 by Chris (Talk | contribs)

Jump to: navigation, search

See also MediaWiki_Install

The documention here is based on the FC6 mediawiki and having multiple wiki's running all on the same ip address, on different domain names, with all http port 80 requests redirected to port 443 and a CAcert cert with all the domain names.


Fedora Core six has packaged mediawiki, and also seems to come with more apache packages that needed:

rpm -e mod_python mod_perl
yum install mediawiki mysql-server php-eaccelerator
chkconfig mysqld on
chkconfig httpd on
service mysqld start
service httpd start
mysqladmin -u root password 'new-password'

Then, following the wiki farm notes

elinks http://localhost/mediawiki/config/index.php

The fill in the following values (the rest can be the defaults):

Wiki name:             TestWiki1
Contact e-mail:        mediawiki @
Admin username:        WikiSysop
Password:              *****
Password cobfirm:      *****
Shared memory caching: 
  * (X) eAccelerator
Database name:         testwiki1
DB username:           testwiki1user
DB password:           *****
DB password confirm:   *****
Superuser account:     root
Superuser password:    *****

Create a MySQL account for AdminSettings.php:

mysql -uroot -p mysql
mysql> GRANT ALL PRIVILEGES ON *.* TO 'wikiadmin'@'localhost'
Query OK, 0 rows affected (0.00 sec)

And move the sample file and then add the password to it:

cd /var/www/mediawiki
mv AdminSettings.sample AdminSettings.php


cd /var/www/mediawiki
mv config/LocalSettings.php LocalSettings.php
chown root.root LocalSettings.php 
chmod 644 LocalSettings.php 

Then restart apache and the wiki should be working at http://localhost/mediawiki/

Next add a new wiki site.

Create this script, which is based on this document:

 if [[ -z $1 ]]; then
   echo "The first argument should be the new wiki name"
 if [[ -d $BASE_DIR/$WIKI_NAME ]]; then
   echo "$WIKI_NAME appears to be in use"
 # make the directory for the site
 # change to the sites directory
 #make some dirs 
 mkdir {images,config}
 # fix the ownership
 chown -R apache.apache {images,config}
 # create the sym link tree
 for name in `ls ../mediawiki`
   if [[ -e $name ]]; then
     echo "$name exists already, skipping" 
     ln -s ../mediawiki/$name
 # remove the LocalSettings.php sym link
 if [[ -L LocalSettings.php ]]; then
   rm LocalSettings.php
   if [[ -f LocalSettings.php ]]; then
     echo "LocalSettings.php already exists"
     echo "LocalSettings.php doesn't exist"

Redirecting port 80 to 443, create /var/www/cgi-bin/

#!/usr/bin/perl -wT 

# Redirect all http requests to https
my $server_name = "$ENV{'SERVER_NAME'}";
my $location = "";
my $path_info = "$ENV{'PATH_INFO'}";

# for some sites we need an extra redirect if www is missed off
if ($server_name eq "") {
  $server_name = "";
else {
  $server_name = "$ENV{'SERVER_NAME'}";

# construct the url and redirect
$location = "https://" . "$server_name" . "$path_info";
print qq~Location: $location



And an apache conf file, /etc/httpd/conf.d/vhosts.conf

# Editor: vim:syn=apache

NameVirtualHost *:80
  ServerSignature Off
  UseCanonicalName Off
  AddDefaultCharset UTF-8
  ScriptAlias / "/var/www/cgi-bin/"
  <Directory "/var/www/cgi-bin">
    AllowOverride None
    Options ExecCGI
    Order allow,deny
    Allow from all

NameVirtualHost *:443
Include vhosts.d/*

apache conf

The following things were changed from the defaults in /etc/httpd/conf/httpd.conf

# remove some modules
LoadModule auth_basic_module modules/
LoadModule auth_digest_module modules/
#LoadModule authn_file_module modules/
#LoadModule authn_alias_module modules/
#LoadModule authn_anon_module modules/
#LoadModule authn_dbm_module modules/
#LoadModule authn_default_module modules/
LoadModule authz_host_module modules/
LoadModule authz_user_module modules/
LoadModule authz_owner_module modules/
#LoadModule authz_groupfile_module modules/
#LoadModule authz_dbm_module modules/
#LoadModule authz_default_module modules/
#LoadModule ldap_module modules/
#LoadModule authnz_ldap_module modules/
#LoadModule include_module modules/
LoadModule log_config_module modules/
#LoadModule logio_module modules/
LoadModule env_module modules/
#LoadModule ext_filter_module modules/
LoadModule mime_magic_module modules/
LoadModule expires_module modules/
LoadModule deflate_module modules/
LoadModule headers_module modules/
#LoadModule usertrack_module modules/
LoadModule setenvif_module modules/
LoadModule mime_module modules/
#LoadModule dav_module modules/
LoadModule status_module modules/
LoadModule autoindex_module modules/
#LoadModule info_module modules/
#LoadModule dav_fs_module modules/
LoadModule vhost_alias_module modules/
LoadModule negotiation_module modules/
LoadModule dir_module modules/
#LoadModule actions_module modules/
#LoadModule speling_module modules/
#LoadModule userdir_module modules/
LoadModule alias_module modules/
LoadModule rewrite_module modules/
LoadModule proxy_module modules/
#LoadModule proxy_balancer_module modules/
#LoadModule proxy_ftp_module modules/
LoadModule proxy_http_module modules/
LoadModule proxy_connect_module modules/
LoadModule cache_module modules/
#LoadModule suexec_module modules/
#LoadModule disk_cache_module modules/
#LoadModule file_cache_module modules/
#LoadModule mem_cache_module modules/
LoadModule cgi_module modules/

UseCanonicalName On 

# don't log ip's
#LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat " %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined

General FC6 configuration

This server isn't doing anything apart from media wiki so some things can be turned off:

/sbin/chkconfig bluetooth off
/sbin/chkconfig cups off
/sbin/chkconfig firstboot off
/sbin/chkconfig isdn off
/sbin/chkconfig netfs off
/sbin/chkconfig nfslock off
/sbin/chkconfig portmap off