Difference between revisions of "User:Aeric/Wiki Admin Guide"
imported>Aeric m (moved User:Aeric/notes to User:Aeric/Admin Guide) |
imported>Aeric m (moved User:Aeric/Admin Guide to User:Aeric/Wiki Admin Guide) |
(No difference)
|
Revision as of 18:00, 19 October 2011
How stuff works. See also User:Aeric/tests.
1 Background Information
User:Aeric/Background Information
2 Customizing the Wiki Look and Feel
3 Backup Processes -- Deprecated
3.1 Backup the mySQL Database
This is the first part of the weekly backup.
- backupsql.php -- creates DB backup files in {curr_wiki}/dbbackup
- http://lj.platformatyourservice.com/{curr_wiki}/backupsql.php
- There is a nightly cron job in place on the standby server.
__TBD: Remove the cron job. Use the cPanel options in Siteground to setup a backup cron job there.__
3.2 Backup the entire Wiki
This is the second part of the weekly backup. __TBD__
__TBD: ToDo: Copy all images into image-files/ directory.__
3.3 Historical Backup Retention Policy
- Open FileZilla
- Open the ftp site (see emailed instructions)
- Clean out extra backup files in /dbbackup/lj{curr_version}
- Leave as many as seven (they take a lot of space)
- Ideal Ages: 1 wk, 2 wks, 1 mo., 2 mo.s, 6 mo.., 1 yr, 2 yrs
- Create a local folder for backup. Ex: /042810
- Download all files from /www/{curr_wiki} Ex: /www/lj71
3.4 Restoring a Backup (optionally in a New Location)
Set up the wiki database:
- Create a MySQL database for the Wiki content, if one does not already exist.
- Unzip the backup file: gunzip xyz.sql.gz
- Import the wiki content into the database: mysql xyz.sql
Set up MediaWiki:
- Unzip the HTML backup in the new directory location:
- cd {wiki_root_dir}
- gunzip xyz.gz
- mv xyz {new_wiki_name} # Rename it, if desired
- Modify LocalSettings.php:
- Complete the rename by telling the Wiki where it is:
- $wgScriptPath = "/path_from_server_root_to_wiki_dir";
- Ex: If the server root dir is /public_html, and the wiki is in /public_html/new, then the path to script dir is /new.
- Tell the Wiki where the database is:
- $wgDBserver = "localhost";
- $wgDBname = "{new_DB_name}";
- On Siteground, the DB name is always {username}_{nameYouSpecified}. That name strategy prevents name-collisions in their shared environment.
- Specify the username & password for the database:
- $wgDBuser = "{user}";
- $wgDBpassword = "{password}";
- Complete the rename by telling the Wiki where it is:
4 Rename the Wiki
5 Release a New Version of the Wiki
User:Aeric/Release a New Version
6 Create a New Branch
User:Aeric/Create a New Branch
7 Upgrading the Wiki
Note: This process is for upgrading a wiki in place. The process hasn't been fully tested, as it turns out that to Create a New Branch it is necessary to install the wiki, so the paths are configured right internally. We tend to upgrade only when creating a new branch, so this process generally isn't needed. It has been retained in case it turns out to be useful at some future date.)
7.1 Do the Update
This upgrade process is based on the one recommended at the MediaWiki site.
- First, find out if an upgrade is needed. Check Special:Version to see what we have.
- Create a new directory to put the update into.
- If needed: Create a new database.
(If you are doing the upgrade as part of creating a new branch, you have already created a new database, so you can skip this step.) - Unzip the latest production version of MediaWiki.
Get the latest stable production version (the latest version listed in green, or listed with a green checkmark, at
http://en.wikipedia.org/wiki/MediaWiki_version_history. - From the old directory:
- Copy the LocalSettings.php file
- Copy the extensions/ folder
- Copy the skins/ folder
- In the release notes for the new version, see if any changes need to be made to LocalSettings.php.
Note: It's possible that the upgrade script below does this. Maybe that's why it wasn't part of the procedure mentioned on the MediaWiki upgrade page. (Dunno) - Enable read-only mode in LocalSettings.php of the old directory:
- $wgReadOnly = 'Upgrading to MediaWiki {version}';
- Run the upgrade script in the new directory.
- Copy the images/ folder to the new directory.
- Swap the old directory and the new directory.
Learn more:
7.2 Test the update
Once the upgrade has been completed:
- Browse to the wiki and check that the following operations work as expected:
- Viewing pages
- Editing pages
- Uploading a file
- In Special:Version, check that the version shown is correct and that the extensions are present.
8 Appendix: Apache Notes
8.1 Commands
RedHat commands worth knowing:
- service httpd restart - Restart Apache (generally unnecessary. Sometimes useful, "just to be sure")
- service httpd reload - Reload the configuration files
8.2 mediawiki.conf
The configuration file for MediaWiki is /etc/httpd/conf.d. mediawiki.conf, where:
- etc (eht-cee) is the "et cetera" container for stuff added to the system
- httpd is the HTTP Daemon (Apache)
- conf.d is the directory of configuration files (all files in this directory are read by Apache when it starts or reloads.)
8.3 About that query string
- Motivation
- Pages with plain names seem to work properly. The incoming link is converted to the short URL form, and TOC entries have that form, as well.
- But bookmarks that go to old pages that have :, /, or ! in them don't get a URL rewrite, because those characters don't seem to be handled by the URL-segment-at-a-time matching rules. (They must be MediaWiki matching rules, because Apache is *not* doing the redirect. MediaWiki is.)
- Idea
- We could make a redirect.php page that parses the query string, creates the new URL, and sends a 301-redirect back to the browser. That would be cool. But it's a fair amount of work for a few special pages that, over time, will no longer be bookmarked.