How to Run MediaWiki on Ubuntu

MediaWiki is a free software wiki package written in PHP, and it is currently used by several projects of non-profit Wikimedia Foundation and by several other projects like that of wikiHow . This guide may help you to run Mediawiki on...
Method 1 of 3:

Configure MySQL

  1. Note: You may skip this step if you were prompted to create a mysql root password during MySQL installation
  1. Set up a mysql root password. When you set it up, remember not to use the same password for mysql root and system root. Also note this password somewhere safe so that you could use it later when in need. For setting up a mysql password run the following command:mysqladmin -u root password ""

history -c

Method 2 of 3:

Configure PHP

  1. Mediawiki is completely based on PHP and therefore we have to configure it in order to run mediawiki. But these steps are optional. You can skip them entirely (or do them later) and MediaWiki should still work.
  1. Begin by editing your configuration file. They are located somewhere like, /etc/php5/apache2/php.ini or /etc/php5/php.ini or maybe /etc/apache2/php/php.ini .

sudo nano /etc/php5/apache2/php.ini

  1. Set or Adjust the Maximum Upload File size. Assuming that various files are going to uploaded to Wiki, upload limit should be maximized or adjusted .About one-half way down is the File Uploads section. Change 1=upload_max_filesize = 2M at least 10 MB with 1=upload_max_filesize = 10M. You can adjust it again in the future if you wish .
  2. Increase the memory limit of the script. Memory Limit . Some PHP scripts usually require a lot of memory to run. If it is already 12 or more , leave as it is .To increase the memory limit of a script, change the following entry1=memory_limit = 8M to 1=memory_limit = 12M
  3. Uncomment the line about extensions. Extensions. PHP MySQL support has to be enabled first . To do so , scroll down a little further and make sure to uncomment the following line 1=extension=mysql.so
  4. Save and exist gedit and restart the Apache web server sudo apache2ctl restart.
Method 3 of 3:

Configure Mediawiki

  1. Edit the apache.conf file at /etc/mediawiki/apache.conf. Use sudo gedit /etc/mediawiki/apache.conf
  2. Uncomment the following line.Alias /mediawiki /var/lib/mediawiki
  3. Replace /mediawiki with the name you want it to appear in the URL.
  4. Save and exit out of the editor and restart Apache. Use sudo apache2ctl restart
  5. Navigate to http://localhost/mediawiki or to http://wiki.hostname.com/ (if you own a domain pointing to that server) and continue with the setup . If everything goes right, you would be prompted to complete a form . Make sure you fill in all the essentials.
    1. Choose a name for your wiki and also choose a language and license
    2. Choose a suitable username and set a good password . You could also setup a contact mail
  6. Under Database Config, you may change the database name and DB username to new values, but you must turn on "Use superuser account", name root, giving the mysql root password you configured earlier .
  7. Under MySQL specific options, you can also configure-Data Table Prefix ,Storage Engine,Database character set .
  8. Click on Install Mediawiki. Well what are you waiting for , just click the install or the parent director button! Once configurations are done, you need to move LocalSettings.php to complete the installation .The configuration page will have the exact directory/filename that must be moved. Use sudo chmod a+rwx /var/lib/mediawiki/config

sudo mv /var/lib/mediawiki/config/LocalSettings.php /etc/mediawiki

  1. Remove the config subdirectly entirely for securing your site. Changesudo mv config/LocalSettings.php to sudo rm -rf config
  2. Navigate your browser to your wiki(ie http://server_ip_address/wiki or to http://server_ip_address/wiki/index.php . Possibly server_ip_address = localhost, so http://localhost/wiki may work.
  3. Invite everyone to your project and enjoy .
4.5 ★ | 2 Vote