Mediawiki Install FC6

From Aktivix
Revision as of 16:06, 20 January 2007 by Chris (Talk | contribs)

Jump to: navigation, search

See also MediaWiki_Install

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

 rpm -e mod_python mod_perl squid
 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@aktivix.org
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'
   -> IDENTIFIED BY '****' WITH GRANT OPTION;
 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

Then

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:


 #!/bin/bash
 
 if [[ -z $1 ]]; then
   echo "The first argument should be the new wiki name"
 fi
 
 BASE_DIR="/var/www"
 WIKI_NAME="$1"
 
 if [[ -d $BASE_DIR/$WIKI_NAME ]]; then
   echo "$WIKI_NAME appears to be in use"
   exit
 fi
 
 # make the directory for the site
 mkdir $BASE_DIR/$WIKI_NAME
 
 # change to the sites directory
 cd $BASE_DIR/$WIKI_NAME
 
 #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`
 do
   if [[ -e $name ]]; then
     echo "$name exists already, skipping" 
   else
     ln -s ../mediawiki/$name
   fi
 done
 
 # remove the LocalSettings.php sym link
 if [[ -L LocalSettings.php ]]; then
   rm LocalSettings.php
 else
   if [[ -f LocalSettings.php ]]; then
     echo "LocalSettings.php already exists"
   else
     echo "LocalSettings.php doesn't exist"
   fi
 fi