User:Huji/Wikimedia clone

Start with a fresh Ubuntu installation for Virtualbox.

sudo su apt-get install vim apt-get install git apt-get install apache2 apt-get install mysql-server apt-get install php5 libapache2-mod-php5 /etc/init.d/apache2 restart

Transfer your private key to ~/.ssh then make it secure using  and then add it using

Then fetch the MediaWiki core and store it in /var/www/w using git:

git clone ssh://@gerrit.wikimedia.org:29418/mediawiki/core.git

This will look for some 300,000 objects on the remote side, but eventually you will download some 55,000 files.

Let's say you want to have two sister wikis: English Wiki and Persian Wiki. Install MediaWiki once into a database table called en_wiki. Once completed, store the LocalSettings.php into the w/ directory, but then rename it into LocalSettings_fa.php and then install MediaWiki again and save this new LocalSettings.php file into w/ directory.

Short URLs
The next step is to set up short URLs. Instructions are here.

In short, you add  to the file named   that you find in   and you also edit your LocalSettings.php file where $wgScriptPath is defined, to look like this:

Now if you restart apache using  you should be able to browse to http://localhost/wiki/ and get to the home page of your second wiki.

Subdomains
The next step is to add subdomain support, both on Apache's side and on MediaWiki's.

For apache, all you need to do is add  to the file named   that you find in

Now move all these variables to the end of your LocalSettings.php: $wgSiteName, $wgServer, $wgDBname, $wgLanguageCode, $wgSecretKey, and $wgUpgradekey

Find the same varibles in your LocalSettings_fa.php and put them together too. Now we should move all this stuff into our LocalSettings.php file, but help MediaWiki choose which to use based on the subdomain. It is explained here and you should end up with something more like this: