Difference between revisions of "Install a MediaWiki codebase"

From Organic Design wiki
(Download: BASH details)
({{legacy}})
 
(26 intermediate revisions by 6 users not shown)
Line 1: Line 1:
 +
{{legacy}}
 
{{procedure
 
{{procedure
|description = This process defines the steps involved in adding a new version of the MediaWiki software to an existing environment created by [[Install a new server|installing up a new server]].
+
|description = This process defines the steps involved in adding a new version of the MediaWiki software to an existing environment created by [[Install a new server|installing a new server]].
 
|role = Sysop
 
|role = Sysop
 
|status = in use
 
|status = in use
 
}}
 
}}
 
 
This article describes installing a new version of the MediaWiki software itself. This is a framework which can be thought of as a class which provides the interface structure and database schema for any instances of the software which are separate evolving databases. This process is also useful for creating a duplicate of an existing codebase for experimentation.
 
This article describes installing a new version of the MediaWiki software itself. This is a framework which can be thought of as a class which provides the interface structure and database schema for any instances of the software which are separate evolving databases. This process is also useful for creating a duplicate of an existing codebase for experimentation.
  
 
== File structure ==
 
== File structure ==
{{code|<bash>
+
<source lang="bash">
# Installed versions
+
# Shared extensions dir primarily from OD extensions svn repo then others added from wikimedia etc
/var/www/mediawiki-1.6.7/  
+
/var/www/extensions
/var/www/mediawiki-1.9.3/  
+
 
/var/www/mediawiki-1.10.0/  
+
# Database dumps used as initial templates for new wikis
/var/www/mediawiki-1.11.0/  
+
/var/www/empty-1.15.1.sql
 +
/var/www/empty-1.16.sql
 +
 
 +
# Tools and system-wide OD/Wikia configuration from the OD tools svn repo
 +
/var/www/tools
 +
 
 +
# Installed MediaWiki codebases
 +
/var/www/mediawiki-1.6.7/
 +
/var/www/mediawiki-1.9.3/
 +
/var/www/mediawiki-1.10.0/
 +
/var/www/mediawiki-1.11.0/
 +
/var/www/mediawiki-1.15.1/
 +
/var/www/mediawiki-1.16alpha/
 +
/var/www/mediawiki-svn/
 +
 
 
# Example of template filesystem Symbolic link to common MediaWiki instance
 
# Example of template filesystem Symbolic link to common MediaWiki instance
/var/www/wikis/template/wiki -> /var/www/mediawiki-1.10.0/ </bash>}}
+
/var/www/wikis/template/wiki -> /var/www/mediawiki-svn/
 +
</source>
  
 
== Download ==
 
== Download ==
# [[MW:Download|Download]] a version of MediaWiki to the server you want to install it on. Using wget on a server to download a version e.g.
+
[[MW:Download|Download]] a version of MediaWiki to the server you want to install it on. Using wget on a server to download a version e.g.
cd /tmp
+
<source lang="bash">
wget --proxy http://download.wikimedia.org/mediawiki/1.13/mediawiki-1.13.2.tar.gz
+
cd /tmp
tar -zxvf mediawiki-1.13.2.tar.gz   
+
wget --proxy http://download.wikimedia.org/mediawiki/1.19/mediawiki-1.19.2.tar.gz
su
+
tar -zxvf mediawiki-1.19.2.tar.gz   
mv /tmp/mediawiki-1.13.2 /var/www
+
mv /tmp/mediawiki-1.19.2 /var/www
 +
</source>
 +
 
  
;Codebase hacks
+
Or if you prefer, obtain the current development version from the Subversion repository:
# Change the constants in ''Article.php'' functions ''getBlankingAutosummary'', ''getAutosummary'' and the end of ''delete'' to ''$GLOBALS['wgTruncatedCommentLength']'' (bugzilla report 2007-10-02 [http://bugzilla.wikimedia.org/show_bug.cgi?id=11543 11543])
+
<source lang="bash">
 +
svn co http://svn.wikimedia.org/svnroot/mediawiki/trunk/phase3 /var/www/mediawiki-svn
 +
</source>
 +
 
 +
 
 +
You may like to checkout the source tree of the latest skins:
 +
<source lang="bash">
 +
svn co http://svn.wikimedia.org/svnroot/mediawiki/trunk/phase3/skins /var/www/skins-phase3-trunk
 +
</source>
  
 
== Installation steps ==
 
== Installation steps ==
 
# Unpack the ''tar.gz'' distribution into ''/var/www'' leaving the directory name of the version untouched. The ''config'' directory must be set to ''chmod a+w config''
 
# Unpack the ''tar.gz'' distribution into ''/var/www'' leaving the directory name of the version untouched. The ''config'' directory must be set to ''chmod a+w config''
# Set the ''/var/www/domains/setup.organicdesign.co.nz'' symlink to point to the new codebase
+
# Set the ''/var/www/domains/setup.organicdesign.co.nz'' symlink to point to the new codebase. If it is a local installation ''/var/www/domains/setup.localhost'' and include setup.localhost in your etc/hosts: <tt>127.0.0.1 localhost setup.localhost</tt>
 
# A symlink needs to be added in the codebase during initial setup called ''wiki'' which points to it's parent, the codebase dir e.g. <code>ln -s /var/www/mediawiki-1.11.1/ wiki</code>
 
# A symlink needs to be added in the codebase during initial setup called ''wiki'' which points to it's parent, the codebase dir e.g. <code>ln -s /var/www/mediawiki-1.11.1/ wiki</code>
# Go to http://setup.organicdesign.co.nz/wiki/config in your browser and run through the install the db user '''bender''', and any template db name. Use your own account for sysop rather than "WikiSysop".
+
# Go to http://setup.organicdesign.co.nz/wiki/mw-config in your browser and run through the install the db user '''bender''', and any template db name (but please note, '''you must use a table prefix with trailing underscore for add-db to work with it as a template!'''). Use your own account for sysop rather than "WikiSysop". If it is a local installation http://setup.localhost
# Move the config/LocalSettings.php into the main /wiki directory
+
# Download the LocalSettings.php offered by the installer and copy into the main /wiki directory
# Edit the LocalSettings.php file, remove the db user, password and prefix and append ''include('extensions/wikia.php');''
+
# Edit the LocalSettings.php file, remove the db user, password and prefix and append to the end of the script: ''require_once('extensions/wikia.php');''
# Replace the ''extensions'' directory with a symlink to ''/var/www/extensions''
+
# Add symlinks for any required extensions from the shared repository into the codebase's ''extensions'' directory.
 
# Run ''make'' in the ''wiki/math'' directory
 
# Run ''make'' in the ''wiki/math'' directory
 
# Add the DPL DB update shown at [[DPL:DPL:Manual - Source and Installation]] (after we figure out why it's not working!)
 
# Add the DPL DB update shown at [[DPL:DPL:Manual - Source and Installation]] (after we figure out why it's not working!)
# Create a template database (either copy and upgrade an existing template, or add to the base install)
+
# Create a template database for major releases of MediaWiki (either copy and upgrade an existing template, or add to the base install)
 
:<tt>mysqldump -u user -p db-name > /var/www/empty-x.xx.sql</tt>
 
:<tt>mysqldump -u user -p db-name > /var/www/empty-x.xx.sql</tt>
 
:'''Note:''' see section below for DB user details
 
:'''Note:''' see section below for DB user details
# Not sure if this is still relavent, but the template-db's may need a column added for DPL, see [[OD:01 May 2007]]
 
 
== MediaWiki MySQL user ==
 
Mediawiki is setup with the mysql user account ''Bender'' with the password specified as in [[MW:LocalSettings.php]] through the include of [[Wikia.php]]. User ''Bender'' has privileges to create and access all the wikia databases.
 
 
== BASH commands ==
 
This is currently an overview of the process.
 
<bash>
 
version=1.11.0
 
documentroot=/var/www
 
  
mirror=http://download.wikimedia.org/mediawiki/1.11/
+
== Wiki Database Details ==
+
Note that the wiki DB settings are now managed and set from ''/var/www/tools/wikid.conf'', see the [http://svn.organicdesign.co.nz/filedetails.php?repname=tools&path=%2Fwikid.conf.sample wikid.conf.sample] file for an example. The [http://svn.organicdesign.co.nz/filedetails.php?repname=extensions&path=%2Fwikia.php wikia.php] file which is automatically included in all wikis in the wikia will extract the DB details from the ''wikid.conf'' file.
# 1) Download MediaWiki
 
cd $documentroot
 
if [ ! -e mediawiki-${version}.tar.gz ]
 
then
 
  wget --proxy ${mirror}/mediawiki-${version}.tar.gz
 
fi
 
 
# 2) Unpack and remove
 
tar -zxvf mediawiki-${version}.tar.gz
 
rm mediawiki-${version}.tar.gz
 
cd $documentroot/mediawiki-${version}
 
chmod a+w config
 
  
# 3) Remove extensions directory and create symbolic link
+
== Next ==
rm -rf extensions
+
*[[Install a new wiki]]
ln -s /var/www/extensions extensions
 
 
# 4) Follow the configuration instructions on the wikipage $domain/${wikidir}
 
cat <<EOF
 
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.
 
Now its time to configure your MediaWiki installation at:
 
${htdocs}/${wikidir}
 
Using a web browser, follow the instructions at:
 
http://$domain/${wikidir}
 
When you have finished type: y
 
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.
 
EOF
 
finished=N
 
while [ $finished != "y" ]
 
do
 
    echo "Press 'y' when you have configured MediaWiki"
 
    read finished
 
done
 
# 5) Move default LocalSettings.php from /wiki/config into /wiki
 
cd ${htdocs}/mediawiki-${version}
 
mv ./config/LocalSettings.php .
 
echo "include('extensions/wikia.php');" >> LocalSettings.php
 
chmod 600 ${htdocs}/${wikidir}/config
 
</bash>
 
  
 
== See also ==
 
== See also ==
 +
*[[Talk:Install a MediaWiki code-base]] for a overview BASH script
 
*[[OD:OD/Wikia]]
 
*[[OD:OD/Wikia]]
 
*[[MW:Installation]]
 
*[[MW:Installation]]
 
*[[MW:Manual:Wiki_family]]
 
*[[MW:Manual:Wiki_family]]
 
*[[MW:Category:Upgrading]]
 
*[[MW:Category:Upgrading]]
[[Category:Installation]]
+
[[Category:Installation]][[Category:Wikia]]

Latest revision as of 21:26, 3 June 2018

Legacy.svg Legacy: This article describes a concept that has been superseded in the course of ongoing development on the Organic Design wiki. Please do not develop this any further or base work on this concept, this is only useful for a historic record of work done. You may find a link to the currently used concept or function in this article, if not you can contact the author to find out what has taken the place of this legacy item.
Procedure.svg Install a MediaWiki codebase
Organic Design procedure

This article describes installing a new version of the MediaWiki software itself. This is a framework which can be thought of as a class which provides the interface structure and database schema for any instances of the software which are separate evolving databases. This process is also useful for creating a duplicate of an existing codebase for experimentation.

File structure

# Shared extensions dir primarily from OD extensions svn repo then others added from wikimedia etc
/var/www/extensions

# Database dumps used as initial templates for new wikis
/var/www/empty-1.15.1.sql
/var/www/empty-1.16.sql

# Tools and system-wide OD/Wikia configuration from the OD tools svn repo
/var/www/tools

# Installed MediaWiki codebases
/var/www/mediawiki-1.6.7/
/var/www/mediawiki-1.9.3/
/var/www/mediawiki-1.10.0/
/var/www/mediawiki-1.11.0/
/var/www/mediawiki-1.15.1/
/var/www/mediawiki-1.16alpha/
/var/www/mediawiki-svn/

# Example of template filesystem Symbolic link to common MediaWiki instance
/var/www/wikis/template/wiki -> /var/www/mediawiki-svn/

Download

Download a version of MediaWiki to the server you want to install it on. Using wget on a server to download a version e.g.

cd /tmp
wget --proxy http://download.wikimedia.org/mediawiki/1.19/mediawiki-1.19.2.tar.gz
tar -zxvf mediawiki-1.19.2.tar.gz  
mv /tmp/mediawiki-1.19.2 /var/www


Or if you prefer, obtain the current development version from the Subversion repository:

svn co http://svn.wikimedia.org/svnroot/mediawiki/trunk/phase3 /var/www/mediawiki-svn


You may like to checkout the source tree of the latest skins:

svn co http://svn.wikimedia.org/svnroot/mediawiki/trunk/phase3/skins /var/www/skins-phase3-trunk

Installation steps

  1. Unpack the tar.gz distribution into /var/www leaving the directory name of the version untouched. The config directory must be set to chmod a+w config
  2. Set the /var/www/domains/setup.organicdesign.co.nz symlink to point to the new codebase. If it is a local installation /var/www/domains/setup.localhost and include setup.localhost in your etc/hosts: 127.0.0.1 localhost setup.localhost
  3. A symlink needs to be added in the codebase during initial setup called wiki which points to it's parent, the codebase dir e.g. ln -s /var/www/mediawiki-1.11.1/ wiki
  4. Go to http://setup.organicdesign.co.nz/wiki/mw-config in your browser and run through the install the db user bender, and any template db name (but please note, you must use a table prefix with trailing underscore for add-db to work with it as a template!). Use your own account for sysop rather than "WikiSysop". If it is a local installation http://setup.localhost
  5. Download the LocalSettings.php offered by the installer and copy into the main /wiki directory
  6. Edit the LocalSettings.php file, remove the db user, password and prefix and append to the end of the script: require_once('extensions/wikia.php');
  7. Add symlinks for any required extensions from the shared repository into the codebase's extensions directory.
  8. Run make in the wiki/math directory
  9. Add the DPL DB update shown at DPL:DPL:Manual - Source and Installation (after we figure out why it's not working!)
  10. Create a template database for major releases of MediaWiki (either copy and upgrade an existing template, or add to the base install)
mysqldump -u user -p db-name > /var/www/empty-x.xx.sql
Note: see section below for DB user details

Wiki Database Details

Note that the wiki DB settings are now managed and set from /var/www/tools/wikid.conf, see the wikid.conf.sample file for an example. The wikia.php file which is automatically included in all wikis in the wikia will extract the DB details from the wikid.conf file.

Next

See also