Setting up Wordpress, Gallery2, and Mediawiki on Fedora

From Web3us, LLC
Jump to: navigation, search

This page outlines the steps needed to setup a LAMP Server for wiki and blog use.

Installing

Fedora tips

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.

<pre> AliasMatch ^/phpMyAdmin(?:/(?:de|en|fr|ja|ko|ru))?(/.*)?$ "/var/www/phpMyAdmin$1"

<Directory "/var/www/phpMyAdmin"> Options Indexes AllowOverride None Order allow,deny Allow from all </Directory> </pre> <ol start="2"> <li> Create /opt/www <li> edit http.conf so that the Document Root is /opt/www <li> Changed Web Root to link to /opt/www <li> restart Apache server /etc/rc.d/init.d/httpd restart <li> Check the status of apache /etc/rc.d/init.d/httpd status </ol>

Virtual Root

<pre>#

  1. VirtualHost example:
  2. Almost any Apache directive may go into a VirtualHost container.
  3. The first VirtualHost section is used for requests without a known
  4. server name.
  5. <VirtualHost *:80>
  6. ServerAdmin webmaster@dummy-host.example.com
  7. DocumentRoot /www/docs/dummy-host.example.com
  8. ServerName dummy-host.example.com
  9. ErrorLog logs/dummy-host.example.com-error_log
  10. CustomLog logs/dummy-host.example.com-access_log common
  11. </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> </pre>

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.

<pre>

  1. !/bin/sh

php /opt/scripts/backup_dbs.php </pre> <ol start="4"> <li>Create a file named backup_dbs_config.php in the scripts directory. <li>Create another file named backup_dbs.php also in the scripts directory. </ol>

  1. add the following to remove old backups

<pre>

  1. !/bin/bash

find /opt/db_backups -type f -mtime +22 -exec rm {} \; </pre>

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

<pre> <?php phpinfo(); ?> </pre>

  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

<pre> $ sudo yum install gcc $ sudo yum install make $ sudo yum install php-devel (needed to get phpize) </pre>

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 <pre> ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/ ORACLE_SID=XE export ORACLE_HOME ORACLE_SID export </pre>

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 <pre> $ mysql -u adminusername -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 5340 to server version: 3.23.54

Type '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> EXIT Bye $ </pre>

  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

<pre>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 phpMyAdmin mkdir config # create directory for saving chmod o+rw config # give it world writable permissions

And to edit an existing configuration, copy it over first:

cp config.inc.php config/ # copy current configuration for editing chmod o+w config/config.inc.php # give it world writable permissions

On 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 directory chmod o-rw config.inc.php # remove world read and write permissions

Now 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. </pre>

  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 here
  4. ffmpeg use yumex after adding the repository above
  5. To view movies in Firefox you need to install the plugin here
  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:

<pre>

                          1. Jeffs Extensions ####################

$wgSitename = "Wiki"; $wgLogo = "http://orasos/mediawiki/images/nse-wiki-logo.gif%22; </pre>

  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

  • 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 screen of death add the following to your LocalSettings.php on the line after the <?php

<pre> error_reporting( E_ALL ); ini_set( 'display_errors', 1 ); </pre>

  • 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

<pre>$wgParserConf['preprocessorClass'] = 'Preprocessor_Hash';</pre>

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