Changes
→Configuration of MySQL
{{H:h|system admin toc}}
<-[[MediaWiki User's Guide]]: [[Running MediaWiki]]
'''''Warning: no promises of security are made in this guide. It was intended to be run on an offline workstation.'''''
== System ==
*Slackware Linux full install: [http://www.slackware.com]
**Apache: [http://www.apache.org]
**MySQL: [http://www.mysql.org]
**MediaWiki: [http://sourceforge.net/projects/wikipedia]
**Cur dump of the database (20031231_cur_table.sql.bz2): [http://download.wikimedia.org]
Slackware's full installation includes Apache, MySQL, and PHP, though some administrative work is still needed to get them up and running.
== Settings ==
For this guide, I will make the following assumptions about names, directories, and the like, but you will want to make some of them different:
* '''name''' - The wiki needs a name; this example is called '''vicuna'''.
* '''database''' - It also needs a database, which will also be called '''vicuna''' in this example.
* '''passwords''' - There are several passwords involved, most importantly the password for the wiki database, and the initial administrator account you'll create when running the configuration page.
* '''directory''' - The directory where the wiki will be installed. In this example, it's '''/var/wiki'''.
== Configuration of Apache ==
At a minimum, the webserver must access your wiki on demand. There are better and more complex ways of setting it up, but this will suffice. In /etc/apache/httpd.conf, in the section <code>IfModule mod_alias.c</code>, add the following line:
Alias /wiki/ /var/wiki
Replace <code>/var/wiki</code> with the directory you've chosen.
Apache will not be configured to use PHP by default, so you may need to do the following.
# Edit <code>/etc/apache/httpd.conf</code> by uncommenting the line <code>#Include /etc/apache/mod_php.conf</code>
# Edit <code>/etc/apache/mod_php.conf</code> by adding <code>.phtml</code> to the line <code>AddType application/x-httpd-php .php</code>
# If Apache isn't running, enter <code>apachectl start</code>, otherwise, do <code>apachectl restart<code>.
== Configuration of MySQL ==
Perform the following commands as root.
# Copy one of the MySQL configuration files in /etc to my.cnf: <br><code>cp /etc/my-meduium.cnf /etc/my.cnf</code>
# Initialize the MySQL databases (only necessary once per system, but harmless):<br><code>su mysql -c mysql_install_db</code>
# Start the MySQL daemon:<br><code>mysqld_safe --user=mysql &</code>
# Set the root password:<br><code>mysqladmin -u root password '''''password'''''</code>
You probably want MySQL to start at system boot time. You must edit a couple of init scripts to accomplish this.
* Place the startup script:<br><code>cp /usr/share/mysql/mysql.server /etc/rc.d/rc.mysql</code>
* Edit <code>/etc/rc.d/rc.M</code> and add the following text near the end:
# Start the MySQL server
if [ -x /etc/rc.d/rc.mysql ]; then
. /etc/rc.d/rc.mysql start
fi
* Edit <code>/etc/rc.d/rc.K</code> and add the following text above the "Kill all processes" section:
# Shut down the MySQL server:
if [ -x /etc/rc.d/rc.mysql ]; then
/etc/rc.d/rc.mysql stop
fi
== Configuration of MediaWiki ==
# Go to the directory where you will install Mediawiki, such as <code>/var</code>, and unpack the package:<br><code>cd /var</code><br><code>tar xzvf ~/mediawiki-1.x.x.tar.gz</code>
# Rename the directory to something manageable:<br><code>mv mediawiki-1.x.x wiki</code>
# Make the config directory world-writable:<br><code>chmod o+w wiki/config</code>
# Load the configurating page in your web browser and use it. Go to <code>http://my.host/wiki/config/</code>.
# Once the configuration has completed successfully, shut off the config directory:<br><code>chmod 700 wiki/config</code>
# And get your LocalSettings.php file installed:<br><code>mv wiki/config/LocalSettings.php wiki</code>
# Edit LocalSettings.php as desired.
== Loading the dump ==
# Unzip the dump by typing: <code>bunzip2 20031231_cur_table.sql.bz2</code> (this will take a while depending on the size of the dump and the speed of your workstation).
# Import the dump in your database by starting a mysql session as above, if you have not done so, loading the wiki database (the name as you gave above), by typing: <code>use <wiki db></code> and then importing the data by typing: <code>source /path/20031231_cur_table.sql</code>. This will also take a long time.
At this point you should have a working install with some data in it. Other things will also need to be set up (classic TODO here).
==See also==
* [[Running MediaWiki on Linux]]
<-[[MediaWiki User's Guide]]: [[Running MediaWiki]]
'''''Warning: no promises of security are made in this guide. It was intended to be run on an offline workstation.'''''
== System ==
*Slackware Linux full install: [http://www.slackware.com]
**Apache: [http://www.apache.org]
**MySQL: [http://www.mysql.org]
**MediaWiki: [http://sourceforge.net/projects/wikipedia]
**Cur dump of the database (20031231_cur_table.sql.bz2): [http://download.wikimedia.org]
Slackware's full installation includes Apache, MySQL, and PHP, though some administrative work is still needed to get them up and running.
== Settings ==
For this guide, I will make the following assumptions about names, directories, and the like, but you will want to make some of them different:
* '''name''' - The wiki needs a name; this example is called '''vicuna'''.
* '''database''' - It also needs a database, which will also be called '''vicuna''' in this example.
* '''passwords''' - There are several passwords involved, most importantly the password for the wiki database, and the initial administrator account you'll create when running the configuration page.
* '''directory''' - The directory where the wiki will be installed. In this example, it's '''/var/wiki'''.
== Configuration of Apache ==
At a minimum, the webserver must access your wiki on demand. There are better and more complex ways of setting it up, but this will suffice. In /etc/apache/httpd.conf, in the section <code>IfModule mod_alias.c</code>, add the following line:
Alias /wiki/ /var/wiki
Replace <code>/var/wiki</code> with the directory you've chosen.
Apache will not be configured to use PHP by default, so you may need to do the following.
# Edit <code>/etc/apache/httpd.conf</code> by uncommenting the line <code>#Include /etc/apache/mod_php.conf</code>
# Edit <code>/etc/apache/mod_php.conf</code> by adding <code>.phtml</code> to the line <code>AddType application/x-httpd-php .php</code>
# If Apache isn't running, enter <code>apachectl start</code>, otherwise, do <code>apachectl restart<code>.
== Configuration of MySQL ==
Perform the following commands as root.
# Copy one of the MySQL configuration files in /etc to my.cnf: <br><code>cp /etc/my-meduium.cnf /etc/my.cnf</code>
# Initialize the MySQL databases (only necessary once per system, but harmless):<br><code>su mysql -c mysql_install_db</code>
# Start the MySQL daemon:<br><code>mysqld_safe --user=mysql &</code>
# Set the root password:<br><code>mysqladmin -u root password '''''password'''''</code>
You probably want MySQL to start at system boot time. You must edit a couple of init scripts to accomplish this.
* Place the startup script:<br><code>cp /usr/share/mysql/mysql.server /etc/rc.d/rc.mysql</code>
* Edit <code>/etc/rc.d/rc.M</code> and add the following text near the end:
# Start the MySQL server
if [ -x /etc/rc.d/rc.mysql ]; then
. /etc/rc.d/rc.mysql start
fi
* Edit <code>/etc/rc.d/rc.K</code> and add the following text above the "Kill all processes" section:
# Shut down the MySQL server:
if [ -x /etc/rc.d/rc.mysql ]; then
/etc/rc.d/rc.mysql stop
fi
== Configuration of MediaWiki ==
# Go to the directory where you will install Mediawiki, such as <code>/var</code>, and unpack the package:<br><code>cd /var</code><br><code>tar xzvf ~/mediawiki-1.x.x.tar.gz</code>
# Rename the directory to something manageable:<br><code>mv mediawiki-1.x.x wiki</code>
# Make the config directory world-writable:<br><code>chmod o+w wiki/config</code>
# Load the configurating page in your web browser and use it. Go to <code>http://my.host/wiki/config/</code>.
# Once the configuration has completed successfully, shut off the config directory:<br><code>chmod 700 wiki/config</code>
# And get your LocalSettings.php file installed:<br><code>mv wiki/config/LocalSettings.php wiki</code>
# Edit LocalSettings.php as desired.
== Loading the dump ==
# Unzip the dump by typing: <code>bunzip2 20031231_cur_table.sql.bz2</code> (this will take a while depending on the size of the dump and the speed of your workstation).
# Import the dump in your database by starting a mysql session as above, if you have not done so, loading the wiki database (the name as you gave above), by typing: <code>use <wiki db></code> and then importing the data by typing: <code>source /path/20031231_cur_table.sql</code>. This will also take a long time.
At this point you should have a working install with some data in it. Other things will also need to be set up (classic TODO here).
==See also==
* [[Running MediaWiki on Linux]]