github.com/niedbalski/juju@v0.0.0-20190215020005-8ff100488e47/acceptancetests/repository/charms/mediawiki/README.md (about)

     1  # Overview
     2  
     3  MediaWiki is a free wiki software application. Developed by the Wikimedia Foundation and others, it is used to run all of the projects
     4  hosted by the Foundation, including Wikipedia, Wiktionary and Commons. Numerous other wikis around the world also use it to power their 
     5  websites. It is written in the PHP programming language and uses a backend database.
     6  
     7  This charm will deploy MediaWiki in to the cloud while applying best practices for running scale-out infrastructures, php based applications 
     8  and MediaWiki. In addition to the required minimum of MySQL -> MediaWiki; this charm also accepts several other services to provide a more robust service experience.
     9  
    10  # Usage
    11  
    12  This charm is available in the Juju Charm Store along with hundreds of others. To deploy this charm you will need: [a cloud environment][1], a working [Juju][2] 
    13  installation, and an already bootstrapped environment.
    14  
    15  Once bootstrapped, deploy the [MySQL][3] and MediaWiki charm:
    16  
    17      juju deploy mysql
    18      juju deploy mediawiki
    19  
    20  Add a relation between the two. Note: To avoid recieving "ambiguous relation" error, specify the "db" relation:
    21  
    22      juju add-relation mysql mediawiki:db
    23  
    24  Expose the MediaWiki service
    25  
    26      juju expose mediawiki
    27  
    28  ## Scale Out Usage
    29  
    30  MediaWiki is designed to cache against memcached to provide a faster and smoother site experience. To add memcached to your mediawiki service first 
    31  deploy memcached:
    32  
    33      juju deploy memcached
    34  
    35  then relate it to the mediawiki service
    36  
    37      juju add-relation memcached mediawiki
    38  
    39  Memcached is recommended for environments with more than one unit deployed. Otherwise there is very little advantage gained by using memcached since 
    40  MediaWiki will already use whatever byte-code cache is specified in the charm's configuration.
    41  
    42  ## MySQL Slave
    43  
    44  If you're running MySQL with a slave set up you can attach MediaWiki to those slaves directly as MediaWiki (both the application and service) can handle this. To 
    45  do this first set up a slave relation with MySQL (If you've already done so skip to the next set of commands):
    46  
    47      juju deploy mysql mysql-slave
    48      juju add-relation mysql mysql-slave
    49  
    50  Going forward you can scale out MySQL by adding slaves via `juju add-unit mysql-slave`.
    51  
    52  Create a relation between the new slave services and MediaWiki:
    53  
    54      juju add-relation mediawiki:slave mysql-slave
    55  
    56  ## Known Limitations and Issues
    57  
    58  ### Maintenance Scripts
    59  
    60  From time to time, during routine operation of a MediaWiki installation, maintenace via [the maintenace scripts directory][8] may need to be executed. Depending on the nature of the maintenance operation this might need to occur on one node or all nodes of a MediaWiki deployment.
    61  The following examples outline how to run maintenance on either a single machine or all units in a service.
    62  
    63  ### All units
    64  
    65  In the event you need to run a script on all machines at once you can use the following bash loop (replacing:
    66  
    67      maint_script_to_run=""
    68      
    69      for unit in `juju status mediawiki | egrep -E "machine: ([0-9])" | tr -d ' ' | cut -d ':' -f2`; do
    70          juju ssh $unit "php -q /var/www/maintenance/$maint_script_to_run"
    71      done
    72  
    73  # Configuration
    74  
    75  MediaWiki charm comes with a handful of settings designed to help streamline and manage your deployment. For convenience if any applicable MediaWiki setting variables are 
    76  associated with the change they'll be listed in parentheses ().
    77  
    78  ## MediaWiki name ($wgSitename)
    79  
    80  This will set the name of the Wiki installation.
    81  
    82      juju set mediawiki name='Juju Wiki!'
    83  
    84  ## Skin ($wgDefaultSkin)
    85  
    86  As the option implies, this sets the default skin for all new users and anonymous users.
    87  
    88      juju set mediawiki skin='monobook'
    89  
    90  One limitation is already registered users will have whatever Skin was set as the default applied to their account. This is a [MediaWiki "limitation"][4]. See caveats 
    91  for more information on running Maintenance scripts.
    92  
    93  ## Admins
    94  
    95  This will configure admin accounts for the MediaWiki instance. The expected format is user:pass
    96  
    97      juju set mediawiki admins="tom:swordfish"
    98  
    99  This creates a user "tom" and sets their password to "swordfish". In the even you wish to add more than one admin at a time you can provide a list of user:pass values separated by a space " ":
   100  
   101      juju set mediawiki admins="tom:swordfish mike:wazowsk1"
   102  
   103  This will create both of those users. At this time setting the admins option to noting ("") will neither add or remove any existing admins. It's simply skipped. To avoid having the password and usernames exposed consider running the following after you've set up admin accounts:
   104  
   105      juju set mediawiki admins=""
   106  
   107  ## Debug ($wgDebugLogFile)
   108  
   109  When set to true this option will enable the following MediaWiki options: `$wgDebugLogFile`, `$wgDebugComments`, `$wgShowExceptionDetails`, `$wgShowSQLErrors`, `$wgDebugDumpSql`, and `$wgShowDBErrorBacktrace`. A log file will be crated in the charm's root directory on each machine called "debug.log". For most providers this will be `/var/lib/juju/units/mediawiki-0/charm/debug.log`, where `mediawiki-0` is the name of the service and unit number.
   110  
   111  # Contact Information
   112  
   113  ## MediaWiki Project Information
   114  
   115  - [MediaWiki home page](http://www.mediawiki.org)
   116  - [MediaWiki bug tracker](http://www.mediawiki.org/wiki/Bugzilla)
   117  - [MediaWiki mailing lists](http://www.mediawiki.org/wiki/Mailing_lists)
   118  
   119  [1]: https://juju.ubuntu.com/docs/getting-started.html
   120  [2]: https://juju.ubuntu.com/docs/getting-started.html#installation
   121  [3]: http://jujucharms.com/charms/precise/mysql
   122  [4]: http://www.mediawiki.org/wiki/Manual:$wgDefaultSkin
   123  [5]: http://packages.ubuntu.com/precise/mediawiki
   124  [6]: http://www.mediawiki.org/wiki/Download_from_Git
   125  [7]: https://integration.mediawiki.org/nightly/mediawiki/core/?C=M;O=D
   126  [8]: http://www.mediawiki.org/wiki/Manual:Maintenance_scripts
   127  [9]: http://askubuntu.com/questions/152428/how-to-ssh-into-local-juju-instance