Difference between revisions of "User:Aeric/Configuration"

From AgileApps Support Wiki
imported>Aeric
imported>Aeric
m (Text replace - 'agileappslive' to 'agileappscloud')
Β 
(35 intermediate revisions by the same user not shown)
Line 1: Line 1:
<noinclude>__TOC__</noinclude>
<noinclude>__TOC__</noinclude>
===How the Wiki Works===
===Configuration Notes===
:* Mediawiki consists of a database and a bunch of PHP scripts and supporting files in the Wiki directory.
:* The wiki is hosted at Rackspace.
:* The actual Wiki content is contained in a database. Β 
:* The server can be accessed with a VPN connection, using either FTP or SSH.
:* Together, the file set and the database make up the Wiki that user sees.
:: 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 <tt>agileappscloud.info</tt> and <tt>platformatyourservice.com</tt>.
:* 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>.
:* The DNS entries determine which subdomains are known to the world.
:* The wiki name in the url determines which wiki is accessed. (E.g. <tt>/wiki</tt>)
:* The <tt>LocalSettings.php</tt> 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.


: The main configuration script:
;Organization of the mediawiki.conf Configuration File:
::;LocalSettings.php: The master control script where the wiki is configured.
:* There are two <tt><VirtualHost></tt> sections, one for each virtual server:<br>(<tt>agileappscloud.info</tt> and <tt>platformatservice.com</tt>).
:::* <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:
:* 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.
::*;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. Β 
:* In the AgileAppsLive domain, the "/wiki" alias points to the <tt>aawiki</tt> wiki, as does the "/aawiki" alias.


::*;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.)
:* 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".


:Added directories:
:* 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.
::;_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.
::* 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.)


::;custom_images/: Header images and favicons used by the browser for bookmarks and tabs.
===Configuring Apache===
:* The Apache configuration file is <tt>/etc/httpd/conf.d/mediawiki.conf</tt>.


::;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.)
:* Always preserve the original and edit a copy in <tt>/usr/share/mediawiki/apache_config</tt>


===How Links to the Wiki Work===
:* To edit, either:
(This is the email I sent to explain things for version 7.1.)
::# SSH to the server using PuTTY or the SSH shell, and use a line-oriented editor like nano.
::# Use FTP to bring the file back to your workstation, and use a terrific editor like NotePad++


;Current Version Links:
===Maintenance Scripts===
:As of today and going forward, these URLS will always point to the latest released version of the Support Wiki:
To use these scripts:
::Β  http://{subdomain}.platformatyourservice.com/wikiΒ 
# Using PuTTY, log in to Rackspace
# <tt>cd /usr/share/mediawiki/apache_config</tt>


: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.
Scripts:
:* <tt>./get_conf</tt>
:: Gets a copy of the three main configuration files, primarily for backup:
::: <tt>httpd.conf</tt>
::: <tt>phpMyAdmin.conf</tt>
::: <tt>mediawiki.conf</tt>


:Versioned links in bookmarks and emails will also work:
:* <tt>./try_setup</tt>
:: Β  http://{subdomain}.platformatyourservice.com/lj71Β  Β 
:: Copies the current config file as <tt>mediawiki.conf_sav</tt>.
:: If no else is editing mediawiki.conf, then <tt>mediawiki.conf_new</tt> has the same content, and is ready to be edited. Otherwise, copy <tt>_sav</tt> to <tt>_new</tt> before you begin.


:Those links will be automatically forwarded to the /wiki pages for as long as 7.1 is current.
:* <tt>./try</tt>
:But once 7.1 is no longer current, those links will go to the 7.1 version, not the latest version.
:: 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:
:::* http://agileappscloud.info/wiki Β 
:::* http://agileappscloud.info/aadev
:::* http://lj.platformatyourservice.com/wiki
:: 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


;Pre-Release Links:
:* <tt>./revert</tt>
:Customers who need pre-release information can get it using links like these:
:: Put <tt>mediawiki.conf_sav</tt> back in place, in case the _new version didn't work.
::Β  http://{subdomain}.platformatyourservice.com/lj72


:When version 7.2 is released, those links will be automatically redirected to the /wiki pages.
;Apache References:
:When 7.3 goes live, those links will once again point to the (now old) 7.2 pages.
Β 
;Old Version Links:
:Anyone who needs to reference prior-release information can use links like these:
:Β  http://{subdomain}.platformatyourservice.com/lj70
Β 
===Wiki/Server Configuration Notes===
:* The wiki is hosted at Racksace. The site name is "platformatyourservice.com".
:* Location is /usr/share/mediawiki/{wiki_name}
:* Multiple subdomains are set up using Apache, the DNS server, and <tt>LocalSettings.php</tt>.
:* The DNS server forwards platformatyourservice.com -> isv.platformatyourservice
:* The Wiki examines the server name (which includes the subdomain) to determine which logos to show and which platform name to use:
:** In <tt>{wiki_name}/LocalSettings.php</tt>, <tt>$wgSitename</tt> declares the name of the Wiki site.
:** That value is set conditionally, based on the subsomain used to access the PHP page.
:** So the same verison of the Wiki is launched in all three cases, but LocalSettings.php changes <tt>$wgSitename</tt> depending on the subdomain used to access it.
:** When that variable's value is "ISV Support Wiki", the unbranded, ISV version of the wiki pages are shown. Otherwise, a logo and platform name appears.
Β 
===Accessing the Server===
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.
(Details in emails.)
Β 
====Apache Modifications====
To modify the Apache configuration in /etc/httpd/conf.d/mediawiki.conf,
either:
# SSH to the server using PuTTY or the SSH shell, and use a line-oriented editor like nano.
# Set up [http://www.vanemery.com/Linux/VNC/vnc-over-ssh.html TightVnc] and use it to run a darn good editor like [http://www.nedit.org/features.php Nedit].
Β 
====Apache References====
:* http://net.tutsplus.com/tutorials/other/a-deeper-look-at-mod_rewrite-for-apache/
:* http://net.tutsplus.com/tutorials/other/a-deeper-look-at-mod_rewrite-for-apache/
:* 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 ''Wiki content files'' are in the <tt>images/</tt>, <tt>extensions/</tt>, and <tt>download/</tt> folders, plus some other files.
:* Each Wiki has its own database.<br/>The database contains page contents and edit history. It is created when the wiki is set up. Data is exported using <tt>mysqldump</tt>, and imported using <tt>mysql</tt>.
:* The backup script in the root user's home dir, is <tt>automysqlbackup.sh</tt>
:* The archive of database backups is at <tt>??</tt>
===Branching Notes===
:* The ''sandbox'' is the new wiki you are creating. There is (or will be) a local copy on your system, as well as the remote copy on the server.

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