Talk:Main Page

From CCARH Wiki
Jump to: navigation, search

1 How to edit the navigation aside on the left side of pages

The sidebar on the right, starting with "Main page", "Music 252", etc. can be changed by editing the MediaWiki:Sidebar page. See the documentation for the sidebar for more editing details.

2 Backing up the wiki

To backup the wiki (such as to re-install on a new server after the old one crashes), you must backup two main components:

  1. the MySQL database (called ccarhwiki)
  2. the local components of the MediaWiki website, particularly the images directory

Backing up the MySQL ccarhwiki database is done with this command:

    /usr/bin/mysqldump -u root -p ccarhwiki -c | \
           /bin/bzip2 -9 > ccarhwiki-$(date '+%Y%m%d').sql.bz2'

Most of the local webfiles are stored in /project/ccarhwiki/permanent-files/current/website. This is backed up as regular directories would.

3 Reinstalling the CCARH wiki

On the new server, delete any pre-existing ccarhwki database in the MySQL database:

     mysql -u root -p
     DROP DATABASE ccarhwiki;

Create a fresh ccarhwiki database:

    mysql -u root -p
    CREATE DATABASE ccarhwiki CHARACTER SET utf8 COLLATE utf8_general_ci;

Create an account to access the ccarhwiki MySQL database with a username such as ccarhwiki, with a password replacing "yourpassword" in the following command:

    mysql -u root -p
    CREATE USER 'ccarhwiki'@'localhost' IDENTIFIED BY 'yourpassword';
    GRANT ALL ON ccarhwiki.* to 'ccarhsiki'@'localhost' IDENTIFIED BY 'yourpassword';

Then insert the old MySQL database into the new server's MySQL database:

    bzcat ccarhwiki-*.sql.bz2 | mysql -u -ccarhwiki -p ccarhwiki

Then setup MediaWiki on the newserver, linking the "permanent-files" components into the MediaWiki installation. To setup the wiki, go to the website and run the MediaWiki installation script. This will update the MySQL ccarhwiki database (so the ccarhwiki database has to be loaded into MySQL before the website is installed).

The Apache web server should includes these lines for the virtual host:

    RewriteEngine On
    ScriptAlias ^$ /wiki/
    RewriteRule ^/?wiki(/.*)?$ %{DOCUMENT_ROOT}/index.php [L]

This is needed in order for wikipages in this form:

instead of:

4 WikiMedia Documentation