How to setup a Wiki

This is how I setup MediaWiki.
Installing

Adding RPM repositories (Fedora 8)
Guides

  1. sudo yum install yumex to install yumex
  2. Setup Fedora repository
    • $ sudo rpm --import /etc/pki/rpm-gpg/*
  3. Add additional repositories


Misc

  1. Create File System for the Database (i.e /mysql/data)
  2. Create /opt/www/downloads
  3. Populate /opt/downloads with phpadmin, mediawiki, wordpress,and other apps.
  4. Create /opt/scripts, and configure backup scripts


Samba


Install Apache 2.x

  1. Edit /etc/httpd/conf.d/php.conf to add Directory entries for phpMyAdmin, gallery2, mediawiki, and scripts.

AliasMatch ^/phpMyAdmin(?:/(?:de|en|fr|ja|ko|ru))?(/.*)?$ "/var/www/phpMyAdmin$1"<Directory "/var/www/phpMyAdmin">Options IndexesAllowOverride NoneOrder allow,denyAllow from all</Directory>

  1. Create /opt/www
  2. edit http.conf so that the Document Root is /opt/www
  3. Changed Web Root to link to /opt/www
  4. restart Apache server /etc/rc.d/init.d/httpd restart
  5. Check the status of apache /etc/rc.d/init.d/httpd status


Virtual Root
## VirtualHost example:# Almost any Apache directive may go into a VirtualHost container.# The first VirtualHost section is used for requests without a known# server name.##<VirtualHost *:80># ServerAdmin webmaster@dummy-host.example.com# DocumentRoot /www/docs/dummy-host.example.com# ServerName dummy-host.example.com# ErrorLog logs/dummy-host.example.com-error_log# CustomLog logs/dummy-host.example.com-access_log common#</VirtualHost>NameVirtualHost 10.52.1.117:80<VirtualHost 10.52.1.117:80> DocumentRoot /opt/www ServerName witwicky ServerAlias witwicky.nuskin.net witwicky.nuskin.com</VirtualHost><VirtualHost 10.52.1.117:80> DocumentRoot /opt/www/blog ServerName insite ServerAlias insite.nuskin.net insite.nuskin.com insite4 DirectoryIndex index.php ErrorLog logs/insite-error_log CustomLog logs/insite-access_log common</VirtualHost>

mySQL

  1. # yum install mysql mysql-server
  2. Edit /etc/my.cnf and enter datadir information (i.e /mysql/data)
  3. Bring up /etc/init.d/mysqld start
  4. Start MySQL server
  5. Change the mysql root user password type: mysqladmin -u root password 'newpassword'
  6. Test connecting to mysql Type: mysql -u root -p enter the password when prompted.


phpMyAdmin

  1. Install phpadmin under /opt/www (untar package from /opt/downloads). Rename original phpadmin name to phpMyAdmin.


Setup mySQL backup scripts

  1. Create a directory for the mysql backup scripts for example /opt/scripts
  2. Create a directory for the mysql backup files for example /opt/db_backups
  3. Create a file in the backup scripts directory named backup_dbs.sh, set up a cron entry to call this file.

#!/bin/shphp /opt/scripts/backup_dbs.php

  1. Create a file named backup_dbs_config.php in the scripts directory.
  2. Create another file named backup_dbs.php also in the scripts directory.
  1. add the following to remove old backups

#!/bin/bashfind /opt/db_backups -type f -mtime +22 -exec rm {} \;

To restore a database type

  1. tar -xvf <database_backup_file>
  2. bunzip2 <database_backup_file>
  3. Login to mysql as root mysql -u root -p
  4. Drop the database (If the destination for restore already exists): mysql> drop database wikidb;
  5. Logout of mysql
  6. Create the databasemysqladmin -uroot -p<passwd>create wikidb
  7. mysql -uroot -p<password> wikidb < wikidb.sql
  8. restore the files from images and uploads directories


Oracle XE

  1. DownLoad and install the Oracle XE rpm
  2. As root run /etc/init.d/oracle-xe configure
    • Answer the configuration questions, remember the password.
  3. Open your browser to http://127.0.0.1:8080/apex


PHP 5

Test PHP
<?phpphpinfo();?>

  1. Creat a info.php file as above in webroot (/var/www/html):

From a browser window, type in the URL localhost/info.php You should see a description of your PHP installation Edit /etc/php.ini to change memory_limit = 32M, upload_max_filesize = 25M, and post_max_size = 28M

eAccelerator PHP cache

  1. Use Yumex to install php-eaccelerator


Adding compilers to Fedora 8

  1. Install gcc compiler
  2. Install gcc libraries
  3. Install gcc make
  4. Install phpize (using yumex)
  5. Download the PHP 5.2.4 source

$ sudo yum install gcc$ sudo yum install make$ sudo yum install php-devel (needed to get phpize)

Oracle PHP Connections

Oracle instant Client with oci8 extension

Oracle XE
If using Oracle XE then add the following to /etc/rc.d/rc.local file
ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/ORACLE_SID=XEexport ORACLE_HOME ORACLE_SIDexport

Build oci8

  1. Download php-5.2.4.tar or the version of your php
  2. Uncompress php-5.2.4
  3. Change to the php-5.2.4 directory you downloaded earlier
    • $ cd <your-download_path>/oci8/php-5.2.4/ext/oci8
  4. Run phpize
    • $ phpize
  5. Run configure
    • ./configure --with-oci8=instantclient,/usr/lib/oracle/10.2.0.3/client/lib \
    • --prefix=$HOME/php --with-apxs=$HOME/apache/bin/apxs \
    • --enable-sigchild --with-config-file-path=$HOME/apache/conf
  6. Run make
  7. Create a oci8.ini
    • cp /etc/php.d/pdo.ini /etc/php.d/oci8.ini
    • Edit the file changing the extension from pdo to oci8
  8. Copy the oci8.so module just created to /usr/lib/php/modules
    • cp /home/oracle/Download/oci8/php-5.2.4/ext/oci8/modules/oci8.so /usr/lib/php/modules
  9. Restart Apache server /etc/rc.d/init.d/httpd restart
  10. Test oci8 by creating a file named Oracletest.php like this in your web root
  11. If you get that means you need to start your oracle database and or unlock the hr user


Wordpress 2.3
The following are the instructions on creating database using mysql client
$ mysql -u adminusername -pEnter password:Welcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 5340 to server version: 3.23.54Type 'help;' or '\h' for help. Type '\c' to clear the buffer.mysql> CREATE DATABASE databasename;Query OK, 1 row affected (0.00 sec)mysql> GRANT ALL PRIVILEGES ON databasename.* TO "wordpressusername"@"hostname"-> IDENTIFIED BY "password";Query OK, 0 rows affected (0.00 sec)mysql> FLUSH PRIVILEGES;Query OK, 0 rows affected (0.01 sec)mysql> EXITBye$

  1. Wordpress install instructions are here.
  2. First Download and install the PlugInstaller plugin which helps install other plugins, download the file and extract it to the plugin directory
  3. Download and Install plugins - Category Posts Widget, Events Calendar, WP-Polls, WP-Polls Widget, WPG2. The zip files are in /opt/download

 

  1. Install gallery2, mediawiki, and wordpress similar to phpmyadmin, and rename worpress-ver-number to blog, mediawiki
  2. bunzip2 Joomla and install it under /opt/www/joomla
  3. unzip smf and install it under /opt/www/smf


Imagemagik

  1. For documentation see ImageMagick.org
  2. sudo yum install freetype freetype-devel libjpeg libjpeg-devel libpng libpng-devel libtiff libtiff-devel ImageMagick ImageMagick-devel ghostscript ghostscript-devel ghostscript-fonts libwmf libexif
  3. Install at least version ImageMagick-6.3.x for example:
    • rpm -Uvh ImageMagick-6.3.7-9.i386.rpm


GD Image Library
yum install php php-devel php-gd php-imap php-ldap php-mysql php-odbc php-pear php-xml php-xmlrpc curl curl-devel perl-libwww-perl ImageMagick libxml2 libxml2-devel

Install phpMyAdmin

  1. phpMyAdmin home page
  2. Here is a quick install

Instead of manually editing config.inc.php, you can use the Setup Script. First you must manually create a folder config in the phpMyAdmin directory. This is a security measure. On a Linux/Unix system you can use the following commands:cd phpMyAdminmkdir config # create directory for savingchmod o+rw config # give it world writable permissionsAnd to edit an existing configuration, copy it over first:cp config.inc.php config/ # copy current configuration for editingchmod o+w config/config.inc.php # give it world writable permissionsOn other platforms, simply create the folder and ensure that your web server has read and write access to it. FAQ 1.26 can help with this.Next, open setup/ in your browser. Note that changes are not saved to disk until explicitly choose Save from the Configuration area of the screen. Normally the script saves the new config.inc.php to the config/ directory, but if the webserver does not have the proper permissions you may see the error "Cannot load or save configuration." Ensure that the config/ directory exists and has the proper permissions - or use the Download link to save the config file locally and upload (via FTP or some similar means) to the proper location.Once the file has been saved, it must be moved out of the config/ directory and the permissions must be reset, again as a security measure:mv config/config.inc.php . # move file to current directorychmod o-rw config.inc.php # remove world read and write permissionsNow the file is ready to be used. You can choose to review or edit the file with your favorite editor, if you prefer to set some advanced options which the setup script does not provide.

  1. Run /localhost/phpMyAdmin after apache is running


Gallery2

  1. Gallery2 instructions can be found here.
  2. Follow the instructions on screen
  3. jpegtran rpm libjpeg-static-6b-37.cubbi2.fc8.i386.rpm
  4. ffmpeg use yumex after adding the repository above
  5. To view movies in Firefox you need to install the plugin
  6. Gallery2 security check list
  7. How To Add Google Analytics


Install MediaWiki

Install Extensions

    1. Contribution Scores
    2. Install Multilang Extension
    3. ExpandTemplates
    4. CategorySuggest
    5. ParserFunctions
    6. PropertyTable
    7. AnyWeb allows inclusion of a web site within a page.


Add entries to LocalSettings

  • Change the site name and add the logo as follows:

############# Jeffs Extensions ####################$wgSitename = "Wiki";$wgLogo = "http://orasos/mediawiki/images/nse-wiki-logo.gif";

  1. Add more entries from the following list LocalSettings
    • May also need to include ini_set("zend.ze1_compatibility_mode", false); in LocalSettings if nowiki tag is broken


Other steps

  1. Install CSS
  2. Copy Template source pages
  3. Export and Import pages to save
  4. Add service to startup mysql, apache
  5. Add Scripts to backup mysql
  6. Increase the Apache upload size
  7. Make the upload directory writable by everyone

Upgrade_to_Mediawiki_1.12
Upgrade to Mediawiki 1.12

  • Manual for upgrade
  • Save the file LocalSettings.php
  • Backup up both the DB and the mediawiki directory
  • Extract tar file over the top of existing install
  • Copy AdminSettings.sample to AdminSettings.php and edit the database user
  • Change to the maintenance directory and run the update script

$ php update.php

  • if you get a white (or blank) screen of death add the following to your LocalSettings.php on the line after the <?php

error_reporting( E_ALL );ini_set( 'display_errors', 1 );

  • if the error your getting is Fatal error: Class 'DOMDocument' not found in ...
    • Then read the instructions here

or there is a quick fix, Add this to LocalSettings.php
$wgParserConf['preprocessorClass'] = 'Preprocessor_Hash';

Desktop stuff

  • Install Flash

# yum install gnash gnash-plugin
Gnash for some reason installs its plugin into /usr/lib/mozilla/plugins when it needs to be in
/usr/lib/firefox.../plugins.
So to fix this navigate to the firefox plugin directory. On my computer it is: /usr/lib/firefox-2.0.0.8/plugins
Now run this command as root:
# ln -s /usr/lib/mozilla/plugins/libgnashplugin.so libgnashplugin.so

Drupal

Subject: