Wednesday, February 21, 2007

Installing a Mediawiki Website for Computational Chemistry Portal at IIITMK







MediaWiki
is a free software wiki package originally written for Wikipedia. It is now used by several other projects of the non-profit Wikimedia Foundation and by many other wikis.







Requirements: To install and configure a MediaWiki website for Computational Chemistry Portal.



System :



Red Hat Enterprise Linux 4.0 server

RAM : 256 MB

Processor:2.4GHz


The recommended minimum settings is 256MB of RAM for a single-computer website, although this will not suffice for a busy public site. Some users have reported running MediaWiki on computers with as little as 48MB of RAM.

Prerequisites

Before you can install MediaWiki, there are four prerequisite components you must install. When you install these, remember to read the associated documentation. If your website is hosted for you then contact the server administrators or hosting company to ensure these are installed.

Instead of installing all that stuff you can use for windows eg WOS Mixer which includes a ready to run package.

  1. An Apache web server, available at the official download page.
  2. A recent version of PHP, the programming language in which MediaWiki is written. This is available from the official download page. As of version 1.7 PHP 5.x is required -- PHP 4.x is not supported from this version onwards.
    • See PHP config for compiling options
    • Some Linux servers may also require the equivalent MySQL package and PHP session management package; see the documentation for the operating system.
    • When installing on windows using the Microsoft installer, add the extension for your database of choice (MySQLi or PostgresSQL) to the features to be installed.
    • If your Apache server has the Hardened PHP patch, you may need to edit several variables in your /etc/php.ini file if you wish to have Wiki pages with large amounts of content. In particular, consider the settings for varfilter.max_value_length, hphp.post.max_value_length, and hphp.request.max_value_length. The default settings may limit your pages to less than 10k or 64k in size.
    • Many people report blank pages in recent versions after submitting articles to wiki. Most probable cause is the memory limit in default php installations (mostly 8M). Please check your php and/or apache error logs. Solution: Edit /etc/php.ini and change the "memory_limit" to f.e. 20M (memory_limit = 20M). Restart your apache after you have changed this value!
  3. A MySQL database server, which will be used to store all the text and data. This is available from the official download page.
    • As of version 1.8, Postgres is also supported. It should be noted that support for Postgres is very new and not as well tested as the MySQL equivalent.

Test : MySQL version 4.1 was pre-installed in the system and was working.

  1. MediaWiki itself, which is available from the official download page. Development versions are available from the Sourceforge.net project page.
  2. PHPMyAdmin for managing databases connected with the wiki.

Notes:

  • MediaWiki ships with an installation script which allows web-based configuration
  • MediaWiki can share the database of another web-based application, e.g. phpBB etc.
  • Knowledge of PHP is required in order to customize the software
  • PHP 5 support has been required since MediaWiki 1.7 - if you are using an older version of PHP and cannot upgrade then you should use MediaWiki 1.6.9 .
  • MySQL 4 support has been required since MediaWiki 1.6 - if you are using an older version of MySQL and cannot upgrade then you should use MediaWiki 1.5.8 . Note that this version is no longer supported.

System Audit

A close review of the system revealed that it doesn’t contain PHPMyadmin.PHP version 4.4.5 was pre-installed in the Server.For it to work with the Apache Webserver, checking was done with phpconfig().A new PHP file with this function was made and placed in a directory ‘ajith’ inside the webroot (or htdocs) of the webserver.Then, the file was called using URL :

http://localhost/ajith/test.php

This displayed the most common PHP options in the web page.Also,this showed that Apache was working with PHP support.So, first step was to install PHPMyAdmin.It needed the following to be installed:

  • PHP
    • You need PHP 4.1.0 or newer, with session support
    • You need GD2 support in PHP to display inline thumbnails of JPEGs ("image/jpeg: inline") with their original aspect ratio
    • You need PHP 4.3.0 or newer to use the "text/plain: external" MIME-based transformation
  • MySQL 3.23.32 or newer (details);
  • Not really a requirement but a strong suggestion: if you are using the "cookie" authentication method, having the mcrypt PHP extension on your web server accelerates not only the login phase but every other action that you do in phpMyAdmin.
  • Web browser with cookies enabled.

Install Process can be summarized in below link :

http://www.phpmyadmin.net/documentation/#quick_install

Now as the PHPMyAdmin tool is installed, we can proceed with the MediaWiki Installation.

Download and uncompress

Download MediaWiki to your local computer and uncompress the files, so that you can see the files and folders. This is usually done with software such as 7-Zip (open source software), WinZip or IZArc on Windows. On Linux, you can untar the file using this command:

# tar xvzf mediawiki-*.tar.gz
Change owner of the directory:
# chown -R apache:apache /var/www/html/mediawiki/*

Create a database

Currently, you must use either MySQL or Postgres to store the actual contents of your wiki.

MySQL

The MySQL database server stores the text and data of your wiki.

  • If you know the root password for your database, (the password for the user called "root") the MediaWiki setup script can automatically create a database and an account to access it.
  • If you don't know the root password for your MySQL server, for example if you don't have the password because you are using a shared host, you need to create a MySQL database and a user before installing MediaWiki. You can do this using various control panels such as PhpMyAdmin, which are often available from shared hosts, or you may be able to use ssh to login to your host and type the commands into a MySQL prompt. See the corresponding documentation. Alternatively, contact your host provider to have them create an account for you.

1. Download and install MySQL 5.0. It should put itself in /usr/local/mysql

2. Check and see if the database server is running ("/usr/local/mysql/bin/mysqladmin status"), If not, sudo /usr/local/mysql/bin/safe_mysqld &.

(For Fedora Core 5, use /usr/bin/mysqld_safe)

3. Set a password for the "root" account on your database server. /usr/local/mysql/bin/mysqladmin -u root password yourpassword

4. Set up a user in MySQL for your Wiki--do this in your terminal: /usr/local/mysql/bin/mysql -u root -p mysql

5. This starts up the MySQL command line client. Now, do this in the client:

mysql> create database wikidb;
mysql> grant create, select, insert, update, delete, lock tables on wikidb.* to 'wikiuser'@'localhost' identified by 'password';
mysql > flush privileges;
mysql> \q



If your database is not running on the same server as your web server, you need to give the appropriate web server hostname -- mediawiki.example.com in my example -- as follows:

 
Mysql > grant create, select, insert, update, delete, lock tables on wikidb.* to
 'wikiuser'@'mediawiki.example.com' identified by 'password';

Run the installation script

Use your browser to visit the wiki directory on your webserver to run the installation script.In my case, the installed directory was /var/www/html/mediawiki-1.6.9

It was called as:



http://localhost:8080/mediawiki-1.6.9



Fields – data to enter



Field Explanation



Database name The name of the MySQL or Postgres database you created

Note: If you run MySQL using a different socket file (e.g. mysql on localhost, using --socket=/tmp/mysocketfile), set the database name to:"localhost:/tmp/mysocketfile".



Database username The username used for accessing your wiki database.


Database password
The user password for accessing your wiki database.
Database table prefix (MySQL only) An optional prefix to prepend to the name of every table that will be created within your wiki database. If you plan to have several wikis, you might want use the prefix "w1" so that all the tables associated with your first wiki will have "w1_" prepended. This allows you to install multiple wikis using the same databases by making the name unique. For example the generic name "archive" becomes "w1_archive", so that it is possible to add another database with the same table names.



Database port Currently only used by Postgres, this is the port number Postgres is installed at. The default value of 5432 should work for most instances. If you are connecting by using a hostname, this should be blank.



Schema for mediawiki / Schema for tsearch2 (Postgres only) The name of the schema to put your wiki inside of. The default value of "mediawiki" should be fine for most purposes. The default value of "public" for tsearch2 should almost never have to be changed.
Superuser account / Superuser password The root database user and password, if you have it. If you don't have this password, leave it as it is. If you have the password, you may be able to skip the above stages of creating the database since MediaWiki will be able to do this for itself.

Configuration - Local settings

After setup, a file called LocalSettings.php is created in the "config" directory. This file contains all the information needed by MediaWiki to run. If it does not find the file in the main folder, it will launch the installation script to create a new one in the "config" directory.

  1. Move this file to the main wiki directory (if you installed MediaWiki to public_html/wiki, move it there). Do not leave a copy in the config folder, as this poses a severe security risk.
  2. Set stringent permissions on the LocalSettings.php file. ( chmod 600 and chown )
  3. Delete the entire "config" directory.
The mediawiki is to be shortly integrated to the project.It will keep track of the documentation of main developments and activities inside the portal and would initiate collaborative development.

Wednesday, February 14, 2007

How to access Linux filesystem from Windows in a dual-boot machine





A problem from a long time back was how to access files in Linux filesystem situated in a dual boot system having both linux and windows partitions.As linux-ntfs project was making it possible to access windows filesystem, from linux, there was an increasing need to make the viceversa possible.



Explore2fs is a GUI explorer tool for accessing ext2 and ext3 filesystems. It runs under all versions of Windows and can read almost any ext2 and ext3 filesystem.

























This is supported in various versions of Windows including 98/ME/XP/2000/2003 Server etc.



The latest binaries could be accessed from this link:



http://www.chrysocome.net/explore2fs

Monday, February 05, 2007

XMMS MP3 Plugin for Red Hat Linux and Fedora Core



Due to patent and licensing concerns, Red Hat Linux 8.0 and above does not include MP3 support. This isn't completely terrible as they includes full support for the OGG Vorbis ,which is an open licensed format. OGG Vorbis is widely regarded as a superior format to MP3. Anyways, back to MP3. To get MP3 support back in XMMS, you simply need to install the xmms-mp3 RPM created at Guru Labs and restart the XMMS. This RPM provides the file:



/usr/lib/xmms/Input/libmpg123.so



Also provided is the SRPM from which the binary RPM was built. The SRPM is identical to the XMMS SRPM shipped with Red Hat Linux and Fedora except that it uses the XMMS source (ie, has MP3 support).



Files for Fedora Core v4:(Supported by Enterprise Linux versions also)

Download RPM: xmms-mp3-1.2.10-16.i386.rpm

Download SRPM: xmms-1.2.10-16.src.rpm (Not normally needed)



Files for Fedora Core v3:

Download RPM: xmms-mp3-1.2.10-9.i386.rpm

Download SRPM: xmms-1.2.10-9.src.rpm (Not normally needed)



Files for Fedora Core v2:

Download RPM: xmms-mp3-1.2.10-2.p.i386.rpm

Download SRPM: xmms-1.2.10-2.p.src.rpm (Not normally needed)



Files for Fedora Core v1:

Download RPM: xmms-mp3-1.2.8-3.p.i386.rpm

Download SRPM: xmms-1.2.8-3.p.src.rpm (Not normally needed)



Files for Red Hat Linux 9:

Download RPM: xmms-mp3-1.2.7-21.p.i386.rpm

Download SRPM: xmms-1.2.7-21.p..src.rpm (Not normally needed)



Files for Red Hat Linux 8.0:

Download RPM: xmms-mp3-1.2.7-13.p.i386.rpm

Download SRPRM: xmms-1.2.7-13.p.src.rpm (Not normally needed)



License: GPL

Update: 03/02/2006

Source: Guru Labs