Difference between revisions of "User:Aeric/Configuration"

From AgileApps Support Wiki
imported>Aeric
imported>Aeric
m (Text replace - 'agileappslive' to 'agileappscloud')
Β 
(12 intermediate revisions by the same user not shown)
Line 1: Line 1:
<noinclude>__TOC__</noinclude>
<noinclude>__TOC__</noinclude>
===How the Wiki Works===
===Configuration Notes===
Major concepts:
:* Mediawiki consists of a MySQL database, plus a collection of PHP scripts and supporting files in the Wiki directory.
:* The textual Wiki content is contained in a database.
:* Image files are stored in a hashed system of nested directory folders under <tt>{wiki}/images</tt>. (The database contains links to them.)
:* Together, the database plus the files and scripts contained in the wiki's directory folder make up the Wiki that the user sees.
Β 
The main configuration script:
:;LocalSettings.php:
::* <tt>$wgDBname</tt> - The variable that names the database in the MySQL space,
:::: accompanied by the login information and the mysql "secret key" for the space
::* <tt>$wgScriptPath</tt> - This variable is used to generate Wiki links. E.g. "/wiki".
:::: The wiki will start if it's wrong, but all of the links it generates will point to this location. Much internal processing will look there for scripts, as well.
Β 
Standard directories:
:;extensions/: MediaWiki plug-ins that have been downloaded and "installed" by referencing them in <tt>LocalSettings.php</tt>. (Since pages are loaded dynamically, once the extension is present, it is automatically part of the Wiki. No restart needed.)
Β 
:;images/: A directory hierarchy that contains the image files after they have been uploaded. The Wiki stores them there when you upload an image, and keeps a pointer to them in the database.
Β 
:;skins/: The images and CSS files that create the "wrapper context" (headers, nav pane, etc.) for the wiki content. (The lj7monobook skin was customized to make the nav pane wider.)
Β 
Added directories:
:;_v16_skins/: A copy of the skins that came with MW 1.16.5, before the nav pane was widened. Saved so that a diff tool can be used to identify those changes and any others.
Β 
:;custom_images/: Header images and favicons used by the browser for bookmarks and tabs.
Β 
:;download/: A directory we added to hold files we want to reference in the wiki. (Only image files can be uploaded to the Wiki. But that's ok. Image loads are done painfully, one at a time. Files in the <tt>download/</tt> folder can be easily updated en mass. (Image files need to be uploaded so that "links" to them coded in the wiki cause the image to be displayed.)
Β 
===How Links to the Wiki Work===
The mapping of URLs to Wiki's is set up in the <tt>mediawiki.conf</tt> file, which will be discussed momentarily.
Β 
;Current Version Links:
:These URLS always point to the latest released version of the Support Wiki:
:: http://{subdomain}.agileappslive.info/wiki - AgileApps Live support wiki
:: http://{subdomain}.platformatyourservice.com/wiki - Legacy LongJump wiki
Β 
:Those are the best links to send to current customers, as they’ll always point to the latest pages.Β  And they will always stay at the top of the Google search rankings, by virtue of being the most heavily accessed Wiki pages.
Β 
;Versioned links:
: Customers with an on-premise installation need to refer to a version of the wiki that matches their installation:
:: http://{subdomain}.agileappslive.info/aa90
:: http://{subdomain}.platformatyourservice.com/lj82Β  Β 
Β 
:Use <tt>scripts/versionProductionWiki</tt> to create an versioned copy of the production wiki when an installable version is released.
Β 
;Pre-Release Links:
:To review a pre-release version of AAL content, use this link:
:: http://{subdomain}.agileappslive.info/mw_dev
Β 
:That link points to the "development" (pre-release) version of the wiki.
:(Since updates happen every three or four weeks, customers will rarely need it.)
Β 
===Server Configuration===
Β 
====Configuration Notes====
:* The wiki is hosted at Rackspace. Β 
:* The wiki is hosted at Rackspace. Β 
:* The server can be accessed with a VPN connection, using either FTP or SSH.
:* The server can be accessed with a VPN connection, using either FTP or SSH.
:: FTP gives access to all of the Wiki files, which is generally sufficient.
:: FTP gives access to all of the Wiki files, which is generally sufficient.
:: (Access details are in emails.)
:: (Access details are in emails.)
:* DNS entries that point to the server are <tt>agileappslive.info</tt> and <tt>platformatyourservice.com</tt>.
:* DNS entries that point to the server are <tt>agileappscloud.info</tt> and <tt>platformatyourservice.com</tt>.
:* Location of any given wiki is /usr/share/mediawiki/{wikiName}
:* Location of any given wiki is /usr/share/mediawiki/{wikiName}
:* Multiple subdomains are set up using Apache, the DNS server, and <tt>LocalSettings.php</tt>. Β 
:* Multiple subdomains are set up using Apache, the DNS server, and <tt>LocalSettings.php</tt>. Β 
Line 67: Line 13:
:* The skin determines which logo is shown, which platform name to use, and the settings for several other variables, including the site name.
:* The skin determines which logo is shown, which platform name to use, and the settings for several other variables, including the site name.


====Configuring Apache====
;Organization of the mediawiki.conf Configuration File:
:* There are two <tt><VirtualHost></tt> sections, one for each virtual server:<br>(<tt>agileappscloud.info</tt> and <tt>platformatservice.com</tt>).
Β 
:* Inside each virtual host, there is a <tt><Directory></tt> section for each wiki that can be accessed, as well as an <tt>Alias</tt> setting that maps the <tt>{domain}/xyz</tt> URL to the <tt>/usr/share/mediawiki/xyz</tt> wiki folder.
Β 
:* In the AgileAppsLive domain, the "/wiki" alias points to the <tt>aawiki</tt> wiki, as does the "/aawiki" alias.
Β 
:* When <tt>scripts/versionProductionWiki</tt> is run to make a versioned copy of the production wiki, a new directory-section and alias are created for it. E.g. "aa90".
Β 
:* Each <tt><Directory></tt> contains a number of URL rewrites that are needed to make the wiki work properly. Unfortunately, they need to be copied for each directory.
::* Attempts to do global rewrites failed, as recorded in notes at the top of the file. However, the rewrites were ''not'' attempted inside the <tt><VirtualHost></tt> headings, as those came later.
::* So it is possible that a clever configuration could cut down the size of the <tt><Directory></tt> segments.
::* But, as the notes in the file attest, the Apache rewrites frequently do not work as documented--so the actual semantics must be discovered by trial and error. (A rainy day project for sure, not worth the time given that we have a working system.)
Β 
===Configuring Apache===
:* The Apache configuration file is <tt>/etc/httpd/conf.d/mediawiki.conf</tt>.
:* The Apache configuration file is <tt>/etc/httpd/conf.d/mediawiki.conf</tt>.


Line 76: Line 36:
::# Use FTP to bring the file back to your workstation, and use a terrific editor like NotePad++
::# Use FTP to bring the file back to your workstation, and use a terrific editor like NotePad++


====Organization of the Configuration File====
===Maintenance Scripts===
:* There are two <virtual host> sections, one for each virtual server:
To use these scripts:
:: (<tt>agileappslive.info</tt> and <tt>platformatservice.com</tt>).
# Using PuTTY, log in to Rackspace
# <tt>cd /usr/share/mediawiki/apache_config</tt>


:*
Scripts:
Β 
====Maintenance Scripts====
Maintenance scripts in <tt>/usr/share/mediawiki/apache_config</tt>:
:* <tt>./get_conf</tt> Β 
:* <tt>./get_conf</tt> Β 
:: Gets a copy of the three main configuration files, primarily for backup:
:: Gets a copy of the three main configuration files, primarily for backup:
Line 97: Line 55:
:: Put <tt>mediawiki.conf_new</tt> in place and restart the server.
:: Put <tt>mediawiki.conf_new</tt> in place and restart the server.
:: For a quick test, refresh the page for each of the main wikis:
:: For a quick test, refresh the page for each of the main wikis:
:::* http://agileappslive.info/wiki Β 
:::* http://agileappscloud.info/wiki Β 
:::* http://agileappslive.info/mw_dev
:::* http://agileappscloud.info/aadev
:::* http://lj.platformatyourservice.com/wiki
:::* http://lj.platformatyourservice.com/wiki
:: If you can see the page and the generated links are correct, the wiki is usable.
:: If you can see the page and the generated links are correct, the wiki is usable.
Line 110: Line 68:
:* http://www.addedbytes.com/download/regular-expressions-cheat-sheet-v2/png
:* http://www.addedbytes.com/download/regular-expressions-cheat-sheet-v2/png
:* http://www.addedbytes.com/cheat-sheets/mod_rewrite-cheat-sheet/
:* http://www.addedbytes.com/cheat-sheets/mod_rewrite-cheat-sheet/
===Backup Notes===
:* A MediaWiki site contains a number of ''wiki files'' and a ''database''.
:* The PHP files and wiki content files are in the {wikiName}/ directory.
:* Each Wiki has its own database.<br/>The database contains page contents and edit history. Data is exported to a <tt>.sql</tt> file using <tt>mysqldump</tt>, and imported using <tt>mysql</tt>.
:* <tt>scripts/backupDevWiki</tt> makes a dated zip file that contains the <tt>.sql</tt> file and the <tt>mw_dev/</tt> directory folder.
:* The archive of database backups maintained on the server is at <tt>/usr/share/mediawiki/archive</tt>.

Latest revision as of 23:56, 14 August 2015

Configuration Notes

  • The wiki is hosted at Rackspace.
  • The server can be accessed with a VPN connection, using either FTP or SSH.
FTP gives access to all of the Wiki files, which is generally sufficient.
(Access details are in emails.)
  • DNS entries that point to the server are agileappscloud.info and platformatyourservice.com.
  • Location of any given wiki is /usr/share/mediawiki/{wikiName}
  • Multiple subdomains are set up using Apache, the DNS server, and LocalSettings.php.
  • The DNS entries determine which subdomains are known to the world.
  • The wiki name in the url determines which wiki is accessed. (E.g. /wiki)
  • The LocalSettings.php file in that wiki uses the subdomain to determine which skin is used.
  • The skin determines which logo is shown, which platform name to use, and the settings for several other variables, including the site name.
Organization of the mediawiki.conf Configuration File
  • There are two <VirtualHost> sections, one for each virtual server:
    (agileappscloud.info and platformatservice.com).
  • Inside each virtual host, there is a <Directory> section for each wiki that can be accessed, as well as an Alias setting that maps the {domain}/xyz URL to the /usr/share/mediawiki/xyz wiki folder.
  • In the AgileAppsLive domain, the "/wiki" alias points to the aawiki wiki, as does the "/aawiki" alias.
  • When scripts/versionProductionWiki is run to make a versioned copy of the production wiki, a new directory-section and alias are created for it. E.g. "aa90".
  • Each <Directory> contains a number of URL rewrites that are needed to make the wiki work properly. Unfortunately, they need to be copied for each directory.
  • Attempts to do global rewrites failed, as recorded in notes at the top of the file. However, the rewrites were not attempted inside the <VirtualHost> headings, as those came later.
  • So it is possible that a clever configuration could cut down the size of the <Directory> segments.
  • But, as the notes in the file attest, the Apache rewrites frequently do not work as documented--so the actual semantics must be discovered by trial and error. (A rainy day project for sure, not worth the time given that we have a working system.)

Configuring Apache

  • The Apache configuration file is /etc/httpd/conf.d/mediawiki.conf.
  • Always preserve the original and edit a copy in /usr/share/mediawiki/apache_config
  • To edit, either:
  1. SSH to the server using PuTTY or the SSH shell, and use a line-oriented editor like nano.
  2. Use FTP to bring the file back to your workstation, and use a terrific editor like NotePad++

Maintenance Scripts

To use these scripts:

  1. Using PuTTY, log in to Rackspace
  2. cd /usr/share/mediawiki/apache_config

Scripts:

  • ./get_conf
Gets a copy of the three main configuration files, primarily for backup:
httpd.conf
phpMyAdmin.conf
mediawiki.conf
  • ./try_setup
Copies the current config file as mediawiki.conf_sav.
If no else is editing mediawiki.conf, then mediawiki.conf_new has the same content, and is ready to be edited. Otherwise, copy _sav to _new before you begin.
  • ./try
Put mediawiki.conf_new in place and restart the server.
For a quick test, refresh the page for each of the main wikis:
If you can see the page and the generated links are correct, the wiki is usable.
If you've done any work on the skins, then test the changes, as well
  • ./revert
Put mediawiki.conf_sav back in place, in case the _new version didn't work.
Apache References