Open main menu

Changes

3,245 bytes added ,  16:33, 7 May 2018
add login info
[[File:MediaWiki-Vagrant.png]]
Using [[mw:MediaWiki-Vagrant]], you can setup a development instance of MediaWiki in a snap. Specifically tuned for development of the MediaWiki software, you get all the tools needed to dive right in to coding and patching. To make it even easier to use, you can start off with https://github.com/dan-nl/mw-vagrant-prep MediaWiki-Vagrant uses [[Puppet]] for configuration management and automation (not [[Ansible]]).
You'll notice in the screenshot that the VM comes pre-configured with shared folders to the host system so that you do not even need to SSH to the VM to see the puppet modules and logs. You can work right on these from your host system.
[[File:MediaWiki-Vagrant.screenshot.png | thumb | screenshot showing aspects of the MediaWiki-Vagrant system]]
== Engineering / Architecture ==
MediaWiki-Vagrant runs on <strike>HHVM</strike><ref>[[mw:HHVM]]</ref><ref>Facecrook announced in Sept. 2017 that HHVM would not aim for PHP compatibility in the future.[https://hhvm.com/blog/2017/09/18/the-future-of-hhvm.html 1] After discussion[https://lists.wikimedia.org/pipermail/wikitech-l/2017-September/088784.html 2] WMF adopted a plan to [https://phabricator.wikimedia.org/T176370 migrate the WMF production cluster to PHP 7], first [https://phabricator.wikimedia.org/T174431 migrating appservers from Jessie to Stretch]. Once that's done, HHVM support will likely be dropped from MediaWiki (exact details tbd). See [https://phabricator.wikimedia.org/T176209 task T176209].</ref> PHP7-FPM with Apache etc. Of course it all relies on [[Vagrant]] and [[VirtualBox]]
 
Meanwhile, current versions of [[VirtualBox]] have [https://www.virtualbox.org/ticket/17490 problems with running Guest Additions on Linux]. This is but one ticket. There are tons of examples of breakage, and fixes haven't landed yet in a stable release. Current solution: run development? (I'm checking on compatibility)
 
== Quick Tips ==
Be sure to check the documentation at [[mw:MediaWiki-Vagrant]]
 
* wiki login is 'Admin' 'vagrant'
* local shell user is 'vagrant' 'vagrant'
* ssh: <code>vagrant ssh</code>
 
<code>vagrant roles list</code> To enable certain roles in your MediaWiki Vagrant: <code>vagrant roles enable <role> -- provision</code> Once you do this, and visit http://localhost:8080/wiki/Special:Version, you can check the product box showing the currently running versions of 'MediaWiki, PHP, MySQL, ICU' and extensions.
 
== DNS ==
MediaWiki Vagrant docs will tell you to visit http://dev.wiki.local.wmftest.net:8080/wiki which is fine, because this specific domain routes to 127.0.0.1 (your local host). There's nothing you have to do with DNS. All three of the following are equivalent.
* http://localhost:8080/wiki/Special:Version
* http://127.0.0.1:8080/wiki/Special:Version
* http://dev.wiki.local.wmftest.net:8080/wiki/Special:Version
== Deploy MediaWiki-Vagrant to Amazon ==
There is [http://www.iheavy.com/2014/01/16/how-to-deploy-on-amazon-ec2-with-vagrant/ this article] that explains how to do this, but I didn't want to create a separate VagrantFile. After not succeeding, I should probably go back and try that approach.
Using multiple [http://docs.vagrantup.com/v2/plugins/providers .html providers] (AWS, Rackspace, VirtualBox, VMWare) ''with the same virtual machine'' is not a feature of Vagrant. Supposedly this limitation will be removed in a future version of Vagrant. But there is a work-around that you can use to accomplish this -- by creating a multi-machine environment. We are describing that work-around. There are some "cheap" solutions that tell you to either delete, or rename the hidden <code>.virtualbox</code> directory in your project source. Don't do that. That's just deleting the information that you'd need for using the existing provider. Or, only do that if you are trying to permanently switch the provider used in your project -- which is not the case here. To get a fully compatible MediaWiki-Vagrant setup that works for both localhost VirtualBox deployments and cloud Amazon AWS deployments, then read on.
=== Caveats ===
The MediaWiki-Vagrant setup is designed for local development and NOT for security, so it may not be suitable for running in the cloud.
The MediaWiki-Vagrant box is setup with NFS shares. The Vagrant-aws plugin has nominal support for shared folders using rsync, so sharing the ~/vagrant folder might work, but it's unkown how well this works. And it's unknown exactly how to disable the sharing [http://docs.vagrantup.com/v2/synced-folders/basic_usage.html synced folders] in <code>Vagrantfile-extra.rb</code>that is defined in the Vagrantfile
=== Pre-requisites ===
==== AWS Account ====
You obviously need an AWS account, which you can get for free. So head over to Amazon and create one. You'll need to create a IAM user and a set of "Access" and "Secret" keys for this user at https://console.aws.amazon.com (Dashboard -> Users -> User Actions -> Manage Access Keys) Hint: if you want another user "Bob" to be able to login to your Amazon Console, they can't just use their email address. You'll want to create a "Login Alias" which is a custom URL for accessing Amazon e.g. https://example.signin.aws.amazon.com/console You also must assign Bob a password in IAM. Then Bob can signin at the Login Alias using the password that you gave him in IAM.
==== Console Tools ====
<pre>
Current machine states:
 
default poweroff (virtualbox)
 
The VM is powered off. To restart the VM, simply run `vagrant up`
 
</pre>
 
The machine is called '''default''' and the provider is '''virtualbox'''.
== Boxes ==
The base box that is used at this time is [https://vagrantcloud.com/debian/boxes/contrib-stretch64/versions/9.4.0/providers/virtualbox.box Debian stretch] (see also https://app.vagrantup.com/debian). If you <code>vagrant up --provision</code> an old box based on Ubuntu, then it will prompt you to destroy the existing box (so that it can re-provision with the right OS) <code>vagrant destroy -f; vagrant up</code>
 
Each '[http://docs.vagrantup.com/v2/providers/basic_usage.html box]' in vagrant is specific to a provider, so we'll need to get a new box that will run on AWS.
== Resources ==
[[ https://github.com/mitchellh/vagrant/issues/2733 | This is the official 'response' ]] to this issue. It offers a [[ https://gist.github.com/maxlinc/8c64c5e93734a3c939b8 | gist ]] that supposedly addresses the problem of running multiple providers, but I wasn't able to figure out how to apply that to the MediaWiki-Vagrant setup.
There is a somewhat related issue in Phabricator that requests a web front-end to make deployment easier.
[[Category:DevOps]]
[[Category:Wiki]]
[[Category:Virtualization]]
4,558

edits