OpenWetWare:Administration/Installation: Difference between revisions
No edit summary |
|||
(9 intermediate revisions by 2 users not shown) | |||
Line 2: | Line 2: | ||
'''[[User:Ilya|Ilya]] 18:02, 25 September 2006 (EDT)''': These instructions are for installing the latest MediaWiki version (1.7.1 as of today) with Apache on RedHat Enterprise Linux 4 and are specific to OpenWetWare. | '''[[User:Ilya|Ilya]] 18:02, 25 September 2006 (EDT)''': These instructions are for installing the latest MediaWiki version (1.7.1 as of today) with Apache on RedHat Enterprise Linux 4 and are specific to OpenWetWare. | ||
Adapted from [http://www.mediawiki.org/wiki/Sysadmin_hub Sysadmin hub @ mediawiki.org] | |||
==Prerequisites== | ==Prerequisites== | ||
*Install PHP5 | *Install PHP5 | ||
**Installer will add <tt>LoadModule php5_module modules/libphp5.so</tt> into <tt>/etc/httpd/conf.httpd.conf</tt>. Move this line to <tt>/etc/httpd/conf.d/php.conf</tt> and comment out the corresponding PHP4 line. | **Need to compile PHP with the following options at minimum: | ||
***<tt>--with-curl</tt> | |||
**Installer from tar file will add <tt>LoadModule php5_module modules/libphp5.so</tt> into <tt>/etc/httpd/conf.httpd.conf</tt>. Move this line to <tt>/etc/httpd/conf.d/php.conf</tt> and comment out the corresponding PHP4 line. | |||
==Installation== | ==Installation== | ||
The idea is to have the OpenWetWare customizations separate from the MediaWiki software installation by placing them in two different directories (<tt>/data/web/openwetware</tt> and <tt>/data/web/mediawiki</tt> respectively) with appropriate symlinks setup between them. | |||
*[http://www.mediawiki.org/wiki/Download Download] the latest version of MediaWiki ([http://www.mediawiki.org/wiki/Download_from_SVN downloading via SVN] may be easier that using the tar file) | *[http://www.mediawiki.org/wiki/Download Download] the latest version of MediaWiki ([http://www.mediawiki.org/wiki/Download_from_SVN downloading via SVN] may be easier that using the tar file) | ||
*Change DocumentRoot in <tt>/etc/httpd/conf/httpd.conf</tt> to <tt>/data/web/mediawiki</tt> | |||
*Create wiki folder in DocumentRoot: | *Create wiki folder in DocumentRoot: | ||
$ sudo mkdir / | $ sudo mkdir /data/web/mediawiki | ||
*Create a group that would have write access to the wiki folder: | *Create a group that would have write access to the wiki folder: | ||
$ sudo groupadd www | $ sudo /usr/sbin/groupadd www | ||
*Change ownership of the folder: | *Change ownership of the folder: | ||
$ sudo chown -R root:www / | $ sudo chown -R root:www /data/www/html/openwetware | ||
$ sudo chmod -R g+ws /var/www/html/openwetware | $ sudo chmod -R g+ws /var/www/html/openwetware | ||
*Extract mediawiki code into wikifolder or follow [http://www.mediawiki.org/wiki/Download_from_SVN SVN instructions] | *Extract mediawiki code into wikifolder or follow [http://www.mediawiki.org/wiki/Download_from_SVN SVN instructions] | ||
Line 31: | Line 37: | ||
*Add extensions after require_once( "includes/DefaultSettings.php" ); | *Add extensions after require_once( "includes/DefaultSettings.php" ); | ||
*Specify access rights (to be added) | *Specify access rights (to be added) | ||
*Set PHP memory limit to 64MB (increase needed to allow import of multiple wiki pages): | |||
ini_set( 'memory_limit', '64M' ); | |||
*To allow easier file uploads | *To allow easier file uploads | ||
$wgFileExtensions = array('png','gif','jpg','jpeg','ogg','doc','xls','ppt','sxc','pdf'); | $wgFileExtensions = array('png','gif','jpg','jpeg','ogg','doc','xls','ppt','sxc','pdf'); | ||
Line 57: | Line 65: | ||
$wgLogo = "$wgStylePath/common/images/newlogoname.jpg"; | $wgLogo = "$wgStylePath/common/images/newlogoname.jpg"; | ||
*Copyright info | *Copyright info | ||
*Google search | |||
*[[OpenWetWare:Administration/Wikitex|Wikitex]] | |||
==End== | ==End== | ||
Line 98: | Line 108: | ||
*SHOW DATABASES, CREATE TEMPORARY TABLES, LOCK TABLES ON *.* | *SHOW DATABASES, CREATE TEMPORARY TABLES, LOCK TABLES ON *.* | ||
*SELECT, INSERT, UPDATE, DELETE, DROP, CREATE, ALTER ON 'wikidbname'.* | *SELECT, INSERT, UPDATE, DELETE, DROP, CREATE, ALTER ON 'wikidbname'.* | ||
==Miscellaneous== | |||
===Locking database: read-only mode=== | |||
*From [http://meta.wikimedia.org/wiki/Lock_the_database Lock the database]: since mediawiki 1.5 you can set $wgReadOnly to a string describing the reason for read-only mode, instead of creating a file. (Usual wiki markup is allowed in this string). | |||
*[http://meta.wikimedia.org/wiki/MediaWiki_file_usage#Read-only_lock_file Read-only lock file]: create a file in an upload directory (must be writeable by the web server user), error message with the contents of the file will show up (e.g., "/var/www/html/openwetware/images/lock_yBgMBwiR"). | |||
*From [http://en.wikinews.org/wiki/Help:Special_pages Help on special pages]: | |||
**[[Special:Lockdb|Lockdb]]: Developer only. Puts the wiki in read only mode. | |||
**[[Special:Unlockdb|Unlockdb]]: Developer only. Puts the wiki in read/write mode. | |||
==Resources== | ==Resources== | ||
*[http://meta.wikimedia.org/wiki/Help:Installation Installation Help] | *[http://meta.wikimedia.org/wiki/Help:Installation Installation Help] | ||
*[http://meta.wikimedia.org/wiki/Help:Upgrading_MediaWiki Upgrading MediaWiki] | |||
*[http://meta.wikimedia.org/wiki/Running_MediaWiki_on_Linux Running MediaWiki on Linux] | *[http://meta.wikimedia.org/wiki/Running_MediaWiki_on_Linux Running MediaWiki on Linux] | ||
*[http://meta.wikimedia.org/wiki/Help:Running_MediaWiki_on_Mac_OS_X Running MediaWiki on Mac OS X] | *[http://meta.wikimedia.org/wiki/Help:Running_MediaWiki_on_Mac_OS_X Running MediaWiki on Mac OS X] | ||
*[http://meta.wikimedia.org/wiki/Uploading_files Uploading files] | *[http://meta.wikimedia.org/wiki/Uploading_files Uploading files] |
Latest revision as of 13:48, 10 December 2007
Ilya 18:08, 1 May 2006 (EDT): I've started this page to follow up on the discussion at today's Steering Committee Meeting. Below are some of my notes I have collected while installing/upgrading/moving OpenWetWare.
Ilya 18:02, 25 September 2006 (EDT): These instructions are for installing the latest MediaWiki version (1.7.1 as of today) with Apache on RedHat Enterprise Linux 4 and are specific to OpenWetWare.
Adapted from Sysadmin hub @ mediawiki.org
Prerequisites
- Install PHP5
- Need to compile PHP with the following options at minimum:
- --with-curl
- Installer from tar file will add LoadModule php5_module modules/libphp5.so into /etc/httpd/conf.httpd.conf. Move this line to /etc/httpd/conf.d/php.conf and comment out the corresponding PHP4 line.
- Need to compile PHP with the following options at minimum:
Installation
The idea is to have the OpenWetWare customizations separate from the MediaWiki software installation by placing them in two different directories (/data/web/openwetware and /data/web/mediawiki respectively) with appropriate symlinks setup between them.
- Download the latest version of MediaWiki (downloading via SVN may be easier that using the tar file)
- Change DocumentRoot in /etc/httpd/conf/httpd.conf to /data/web/mediawiki
- Create wiki folder in DocumentRoot:
$ sudo mkdir /data/web/mediawiki
- Create a group that would have write access to the wiki folder:
$ sudo /usr/sbin/groupadd www
- Change ownership of the folder:
$ sudo chown -R root:www /data/www/html/openwetware $ sudo chmod -R g+ws /var/www/html/openwetware
- Extract mediawiki code into wikifolder or follow SVN instructions
- Make config folder writeable by the webserver for setup:
sudo chown apache ./config
- Create a VirtualHost entry in Apache configuration file (/etc/httpd/conf/httpd.conf)
- Visit your wiki site/config and answer configuration questions
- Wiki name
- License
- DB user
- Sysop account name (e.g., Administrator)
- move LocalSettings.php from config folder to main wiki folder
sudo mv ./config/LocalSettings.php ./
LocalSettings.php
- Add extensions after require_once( "includes/DefaultSettings.php" );
- Specify access rights (to be added)
- Set PHP memory limit to 64MB (increase needed to allow import of multiple wiki pages):
ini_set( 'memory_limit', '64M' );
- To allow easier file uploads
$wgFileExtensions = array('png','gif','jpg','jpeg','ogg','doc','xls','ppt','sxc','pdf'); $wgStrictFileExtensions = false;
- Warn if uploaded files are larger than this (use this to prevent default warning about uploads larger than 100k)
$wgUploadSizeWarning = 10485760; #10M
- To enable image uploads, make sure the 'images' directory is writable, then uncomment this:
$wgDisableUploads = false;
- Top enable image manipulation:
$wgUseImageResize = true; $wgUseImageMagick = true; $wgImageMagickConvertCommand = "/usr/bin/convert"; # may need changing: /usr/X11R6/bin/convert
- If you have the appropriate support software installed you can enable inline LaTeX equations:
$wgUseTeX = true; $wgMathPath = "{$wgUploadPath}/math"; $wgMathDirectory = "{$wgUploadDirectory}/math"; $wgTmpDirectory = "{$wgUploadDirectory}/tmp";
- To install LaTeX support (OCaml software package required):
cd ./math make
Optional
- time zone fix to use local time (if hwtime is set to UTC)
$wgLocalTZoffset = date("Z") / 3600;
- custom wiki logo (upload the logo image and provide a path to it here)
$wgLogo = "$wgStylePath/common/images/newlogoname.jpg";
- Copyright info
- Google search
- Wikitex
End
- Disable interpretation of PHP in the upload directory (./images):
- create .htaccess file and with the following two lines:
php_value engine off AddType text/plain .html .htm .shtml
- Set permissions
sudo chown -R root:wiki wikifolder sudo chmod -R g+w wikifolder find ./ -type d -exec chmod g+s '{}' \;
- make config file read-only by the webserver, readable and writeable by wiki group and not accessible by anyone else (contains mysql user password)
sudo chown apache:wiki ./LocalSettings.php sudo chmod 460 ./LocalSettings.php
- make upload directory writeable by the webserver
sudo chown apache:wiki ./images sudo chmod -R g+w ./images sudo chown root:wiki ./images/.htaccess
- create/move favicon.ico file in/to the wikifolder
- add commands to daily backup script to dump the wiki database - IMPORTANT
Server-wide config
(to be done once per site)
- You may wish to turn register_globals off, because some programs may be insecure using that mode. See http://php.net/register_globals for how to disable it.
File uploading
(maximum file size)
php.ini
(changing this file requires Apache restart)
upload_max_filesize = <Number>M
where <Number> is the limit in MBytes.
post_max_size =<Number>M
httpd.conf
(/etc/httpd/conf/httpd.conf for Apache2 on Linux)
- Some versions of Apache2 have an additional limit which is enforced by default for PHP scripts (Content-length limit in Apache2).
LimitRequestBody 524288
- Sometimes php.ini file is ignored by Apache; workaround in httpd.conf or /etc/httpd/conf.d/php.conf
PHPIniDir /usr/local/pkg/php-5.1.2/etc
SpecialImport.php
This MediaWiki file has a hardcoded MAX_FILE_SIZE on the form that you may need to increase manually.
MySQL user priviliges
- SHOW DATABASES, CREATE TEMPORARY TABLES, LOCK TABLES ON *.*
- SELECT, INSERT, UPDATE, DELETE, DROP, CREATE, ALTER ON 'wikidbname'.*
Miscellaneous
Locking database: read-only mode
- From Lock the database: since mediawiki 1.5 you can set $wgReadOnly to a string describing the reason for read-only mode, instead of creating a file. (Usual wiki markup is allowed in this string).
- Read-only lock file: create a file in an upload directory (must be writeable by the web server user), error message with the contents of the file will show up (e.g., "/var/www/html/openwetware/images/lock_yBgMBwiR").
- From Help on special pages: