{"id":2185,"date":"2017-12-21T17:52:04","date_gmt":"2017-12-21T14:52:04","guid":{"rendered":"https:\/\/www.howtoforge.com\/tutorial\/how-to-install-mediawiki-with-nginx-on-ubuntu-1604\/"},"modified":"2017-12-21T17:52:04","modified_gmt":"2017-12-21T14:52:04","slug":"how-to-install-mediawiki-with-nginx-on-ubuntu-16-04","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/how-to-install-mediawiki-with-nginx-on-ubuntu-16-04\/","title":{"rendered":"How to Install MediaWiki with Nginx on Ubuntu 16.04"},"content":{"rendered":"<p>In this tutorial, I will show you step-by-step how to install MediaWiki with Nginx web server on Ubuntu 16.04. I will guide you on how to install and configure the LEMP stack for MediaWiki installation, including generating and configuring new free SSL Letsencrypt for MediaWiki security.<\/p>\n<p>MediaWiki is one of the most popular wiki software that was originally developed for use on Wikipedia. It&#8217;s a free and open source software written in the PHP programming language, and has become the most dominant software in the wiki category. Originally developed by Magnus Manske in 2002, the tool is now on version 1.30. MediaWiki has been used by many big companies\/organizations including Nginx, Intel, Novell, and NASA.<\/p>\n<p><strong>What we will do:<\/strong><\/p>\n<ol>\n<li>Install Nginx on Ubuntu 16.04<\/li>\n<li>Install and Configure PHP-FPM<\/li>\n<li>Install and Configure MySQL Database<\/li>\n<li>Download and Configure MediaWiki<\/li>\n<li>Generate new SSL Letsencrypt on Ubuntu 16.04<\/li>\n<li>Configure Nginx Virtual Host for MediaWiki Installation<\/li>\n<li>MediaWiki Web-Based Installation<\/li>\n<li>Configure Default Skin MediaWiki<\/li>\n<\/ol>\n<p><strong>Prerequisites<\/strong><\/p>\n<ul>\n<li>Ubuntu 16.04 server<\/li>\n<li>Root privileges<\/li>\n<\/ul>\n<h2 id=\"step-install-nginx-on-ubuntu-\">Step 1 &#8211; Install Nginx on Ubuntu 16.04<\/h2>\n<p>The first step we must do for the MediaWiki installation is to install the web server. So in this section, we will install the Nginx web server, start the Nginx service, and then enable it to launch automatically at system boot.<\/p>\n<p>Before installing the Web server, connect to your server, update all repositories, and then upgrade.<\/p>\n<p class=\"command\">sudo apt update<br \/>sudo apt upgrade -y<\/p>\n<p>Now install Nginx using the following apt command.<\/p>\n<p class=\"command\">sudo apt install nginx -y<\/p>\n<p>After that, start nginx and enable it to launch at system boot.<\/p>\n<p class=\"command\">systemctl start nginx<br \/>systemctl enable nginx<\/p>\n<p>Now check the HTTP port using netstat and make sure you see port 80 being used by Nginx.<\/p>\n<p class=\"command\">netstat -plntu<\/p>\n<p><a class=\"fancybox\" id=\"img-1\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_and_configure_mediawiki_with_nginx_on_ubuntu_1604\/big\/1.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2017\/12\/how-to-install-mediawiki-with-nginx-on-ubuntu-16-04.png\" alt=\"Check that nginx is running\" width=\"500\" height=\"204\" title=\"\"><\/a><\/p>\n<p>The Nginx web server has been installed on Ubuntu 16.04.<\/p>\n<h2 id=\"step-install-and-configure-phpfpm\">Step 2 &#8211; Install and Configure PHP-FPM<\/h2>\n<p>Now we will install the PHP-FPM on Ubuntu 16.04. And we will be using PHP 7.0 for MediaWiki installation.<\/p>\n<p>Install PHP and PHP-FPM (along with all required extensions) using the apt command below.<\/p>\n<p class=\"command\">sudo apt install imagemagick php7.0-fpm php7.0-intl php7.0-xml php7.0-curl php7.0-gd php7.0-mbstring php7.0-mysql php-apcu<\/p>\n<p>And after the installation is complete, we need to change some default configuration for PHP-FPM. We need to increase the upload max file size as well as the memory limit configurations.<\/p>\n<p>Go to the PHP configuration directory and edit the php-fpm &#8216;php.ini&#8217; file using <a href=\"https:\/\/www.howtoforge.com\/vim-basics\" target=\"_blank\" rel=\"noopener noreferrer\">vim<\/a>.<\/p>\n<p class=\"command\">cd \/etc\/php\/7.0<br \/>vim fpm\/php.ini<\/p>\n<p>Increase the &#8216;upload_max_filesize&#8217; configuration to &#8217;20M&#8217;, and increase the &#8216;memory_limit&#8217; to &#8216;128M&#8217;.<\/p>\n<pre class=\"system\">upload_max_filesize = 20M<br\/>memory_limit = 128M<\/pre>\n<p>Save and exit.<\/p>\n<p>Now restart the PHP-FPM service and enable it to automatically launch at boot time using the following systemctl commands.<\/p>\n<p class=\"command\">systemctl restart php7.0-fpm<br \/>systemctl enable php7.0-fpm<\/p>\n<p>PHP-FPM now is running on Ubuntu 16.04, and it&#8217;s running under the sock file. Check it using the netstat command below.<\/p>\n<p class=\"command\">netstat -pl | grep php<\/p>\n<p>And you will get the PHP-FPM sock file as shown below.<\/p>\n<p><a class=\"fancybox\" id=\"img-2\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_and_configure_mediawiki_with_nginx_on_ubuntu_1604\/big\/2.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2017\/12\/how-to-install-mediawiki-with-nginx-on-ubuntu-16-04-1.png\" alt=\"Configure PHP-FPM socket\" width=\"500\" height=\"151\" title=\"\"><\/a><\/p>\n<h2 id=\"step-install-and-configure-mysql-database\">Step 3 &#8211; Install and Configure MySQL Database<\/h2>\n<p>MediaWiki stores all data and content in the database, and it&#8217;s compatible with a variety of database servers. For this guide, we will be using the MySQL database for MediaWiki installation.<\/p>\n<p>In this step, we will install the MySQL database server and then create a new database and user for MediaWiki.<\/p>\n<p>Install MySQL database on Ubuntu 16.04 using the following apt command.<\/p>\n<p class=\"command\">sudo apt install mysql-server mysql-client -y<\/p>\n<p>You will be asked for the MySQL &#8216;root&#8217; password &#8211; type your own password and press &#8216;Enter&#8217;.<\/p>\n<p><a class=\"fancybox\" id=\"img-3\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_and_configure_mediawiki_with_nginx_on_ubuntu_1604\/big\/3.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2017\/12\/how-to-install-mediawiki-with-nginx-on-ubuntu-16-04-2.png\" alt=\"Set MySQL root password\" width=\"500\" height=\"169\" title=\"\"><\/a><\/p>\n<p>Repeat your MySQL &#8216;root&#8217; password.<\/p>\n<p><a class=\"fancybox\" id=\"img-4\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_and_configure_mediawiki_with_nginx_on_ubuntu_1604\/big\/4.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2017\/12\/how-to-install-mediawiki-with-nginx-on-ubuntu-16-04-3.png\" alt=\"Retype root password\" width=\"429\" height=\"286\" title=\"\"><\/a><\/p>\n<p>MySQL installation is complete. Now start MySQL and enable it to launch at boot time using the systemctl commands below.<\/p>\n<p class=\"command\">systemctl start mysql<br \/>systemctl enable mysql<\/p>\n<p>Next, we will create a new database and user for MediaWiki. We will create a new database named &#8216;<strong>mediawikidb<\/strong>&#8216; with the user &#8216;<strong>mediawiki<\/strong>&#8216; and password &#8216;<strong>mypassword<\/strong>&#8216;.<\/p>\n<p>Connect to the mysql server using the mysql command below.<\/p>\n<p class=\"command\">mysql -u root -p<\/p>\n<p>Now create the database and user with the following MySQL queries.<\/p>\n<p class=\"command\">create database mediawikidb;<br \/>grant all privileges on mediawikidb.* to <a href=\"https:\/\/www.howtoforge.com\/cdn-cgi\/l\/email-protection\" class=\"__cf_email__\" data-cfemail=\"2f424a4b464e584644466f\" target=\"_blank\" rel=\"noopener\">[email\u00a0protected]<\/a>&#8216;localhost&#8217; identified by &#8216;mypassword&#8217;;<br \/>flush privileges;<br \/>exit;<\/p>\n<p>MySQL server installed on Ubuntu 16.04, and the database for MediaWiki installation has been created.<\/p>\n<p><a class=\"fancybox\" id=\"img-5\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_and_configure_mediawiki_with_nginx_on_ubuntu_1604\/big\/5.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2017\/12\/how-to-install-mediawiki-with-nginx-on-ubuntu-16-04-4.png\" alt=\"Create MediaWiki database\" width=\"500\" height=\"343\" title=\"\"><\/a><\/p>\n<p>For this guide, we will be using the latest MediaWiki version 1.30. And before we download MediaWiki, we need to install some packages on the server.<\/p>\n<p>Run the apt command below to install new packages.<\/p>\n<p class=\"command\">sudo apt install composer git zip unzip -y<\/p>\n<p>Now create new &#8216;mediawiki&#8217; directory and clone mediawiki source code to that directory.<\/p>\n<p class=\"command\">mkdir -p \/var\/www\/mediawiki<br \/>git clone https:\/\/gerrit.wikimedia.org\/r\/p\/mediawiki\/core.git \/var\/www\/mediawiki<\/p>\n<p><a class=\"fancybox\" id=\"img-6\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_and_configure_mediawiki_with_nginx_on_ubuntu_1604\/big\/6.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2017\/12\/how-to-install-mediawiki-with-nginx-on-ubuntu-16-04-5.png\" alt=\"Download MediaWiki\" width=\"500\" height=\"178\" title=\"\"><\/a><\/p>\n<p>Next, go to the &#8216;\/var\/www\/mediawiki&#8217; directory and install some PHP dependencies needed for the MediaWiki installation using the composer command.<\/p>\n<p class=\"command\">cd \/var\/www\/mediawiki<br \/>composer install &#8211;no-dev<\/p>\n<p><a class=\"fancybox\" id=\"img-7\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_and_configure_mediawiki_with_nginx_on_ubuntu_1604\/big\/7.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2017\/12\/how-to-install-mediawiki-with-nginx-on-ubuntu-16-04-6.png\" alt=\"Run composer\" width=\"412\" height=\"550\" title=\"\"><\/a><\/p>\n<p>After all PHP dependencies installation is complete, change the owner of the mediawiki directory to &#8216;www-data&#8217; user and group.<\/p>\n<p class=\"command\">chown -R www-data:www-data \/var\/www\/mediawiki<\/p>\n<p>The latest version of MediaWiki 1.30 is downloaded in the &#8216;\/var\/www\/mediawiki&#8217; directory.<\/p>\n<h2 id=\"step-generate-ssl-letsencrypt-on-ubuntu-\">Step 5 &#8211; Generate SSL Letsencrypt on Ubuntu 16.04<\/h2>\n<p>For security reasons, we will run MediaWiki under the HTTPS connection. All HTTP connections will be automatically redirect to HTTPS. And for this purpose, we need SSL certificates. We will be using free SSL from Letsencrypt.<\/p>\n<p>In order to generate new SSL certificates from Letsencrypt, we need to install letsencrypt command line on to the server. Use the following command to do this:<\/p>\n<p class=\"command\">sudo apt install letsencrypt -y<\/p>\n<p>After the installation is complete, stop the Nginx web server.<\/p>\n<p class=\"command\">systemctl stop nginx<\/p>\n<p>Next, generate new SSL certificates using the letsencrypt command below.<\/p>\n<p class=\"command\">letsencrypt certonly<\/p>\n<p>You will be asked for your email address &#8211; it&#8217;s used for certificate renew notification.<\/p>\n<p>So, type your email address and choose &#8216;OK&#8217;.<\/p>\n<p><a class=\"fancybox\" id=\"img-8\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_and_configure_mediawiki_with_nginx_on_ubuntu_1604\/big\/8.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2017\/12\/how-to-install-mediawiki-with-nginx-on-ubuntu-16-04-7.png\" alt=\"Generate Let&#039;s encrypt certificate\" width=\"500\" height=\"186\" title=\"\"><\/a><\/p>\n<p>For the Letsencrypt TOS (Terms Of Service), choose &#8216;Agree&#8217; and press Enter.<\/p>\n<p><a class=\"fancybox\" id=\"img-9\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_and_configure_mediawiki_with_nginx_on_ubuntu_1604\/big\/9.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2017\/12\/how-to-install-mediawiki-with-nginx-on-ubuntu-16-04-8.png\" alt=\"Lets encyrpt terms of service\" width=\"500\" height=\"404\" title=\"\"><\/a><\/p>\n<p>And now type your wiki domain name, mine is &#8216;wiki.hakase-labs.co&#8217;.<\/p>\n<p><a class=\"fancybox\" id=\"img-10\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_and_configure_mediawiki_with_nginx_on_ubuntu_1604\/big\/10.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2017\/12\/how-to-install-mediawiki-with-nginx-on-ubuntu-16-04-9.png\" alt=\"Enter domain name\" width=\"500\" height=\"207\" title=\"\"><\/a><\/p>\n<p>And when it&#8217;s all done, you will get the result as shown below.<\/p>\n<p><a class=\"fancybox\" id=\"img-111\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_and_configure_mediawiki_with_nginx_on_ubuntu_1604\/big\/111.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2017\/12\/how-to-install-mediawiki-with-nginx-on-ubuntu-16-04-10.png\" alt=\"SSL Certificate created\" width=\"500\" height=\"336\" title=\"\"><\/a><\/p>\n<p>SSL certificates for MediaWiki installation has been generated in the &#8216;\/etc\/letsencrypt\/live&#8217; directory.<\/p>\n<p>The LEMP stack (Linux, Nginx, MySQL, and PHP-FPM) for MediaWiki installation has been set up, and the MediaWiki source code has been downloaded in the &#8216;\/var\/www\/mediawiki&#8217; directory.<\/p>\n<p>In this step, we will create a new Nginx virtual host file &#8216;mediawiki&#8217;, and then activate the virtual host.<\/p>\n<p>Go the Nginx configuration directory and create a new virtual host file &#8216;mediawiki&#8217; using vim.<\/p>\n<p class=\"command\">cd \/etc\/nginx\/<br \/>vim sites-available\/mediawiki<\/p>\n<p>Paste the following Nginx virtual host for MediaWiki configuration there.<\/p>\n<pre class=\"system\" readability=\"43\"># HTTP Request will be Redirected to the HTTPS<br\/>server {<br\/>\u00a0\u00a0\u00a0 listen 80;<br\/>\u00a0\u00a0\u00a0 listen [::]:80;<br\/>\u00a0\u00a0\u00a0 server_name wiki.hakase-labs.co;<br\/>\u00a0\u00a0\u00a0 return 301 https:\/\/$host$request_uri;<br\/>}<p># HTTPS Configuration<br\/>server {<\/p><p>\u00a0\u00a0\u00a0 listen 443 ssl;<br\/>\u00a0\u00a0\u00a0 listen [::]:443;<br\/>\u00a0\u00a0\u00a0 <br\/>\u00a0\u00a0\u00a0 server_name wiki.hakase-labs.co;<br\/>\u00a0\u00a0\u00a0 root \/var\/www\/mediawiki;<\/p><p>\u00a0\u00a0\u00a0 index index.php;<br\/>\u00a0\u00a0\u00a0 autoindex off;<\/p><p>\u00a0\u00a0\u00a0 # SSL Certificate Configuration<br\/>\u00a0\u00a0\u00a0 ssl_certificate \/etc\/letsencrypt\/live\/wiki.hakase-labs.co\/fullchain.pem;<br\/>\u00a0\u00a0\u00a0 ssl_certificate_key \/etc\/letsencrypt\/live\/wiki.hakase-labs.co\/privkey.pem;<\/p><p>\u00a0\u00a0\u00a0 client_max_body_size 5m;<br\/>\u00a0\u00a0\u00a0 client_body_timeout 60;<\/p><p>\u00a0\u00a0\u00a0 location \/ {<br\/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 try_files $uri $uri\/ @rewrite;<br\/>\u00a0\u00a0\u00a0 }<\/p><p>\u00a0\u00a0\u00a0 location @rewrite {<br\/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 rewrite ^\/(.*)$ \/index.php?title=$1&amp;$args;<br\/>\u00a0\u00a0\u00a0 }<\/p><p>\u00a0\u00a0\u00a0 location ^~ \/maintenance\/ {<br\/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 return 403;<br\/>\u00a0\u00a0\u00a0 }<\/p><p>\u00a0\u00a0\u00a0 # PHP Configuration<br\/>\u00a0\u00a0\u00a0 location ~ \\.php$ {<br\/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 fastcgi_pass unix:\/run\/php\/php7.0-fpm.sock;<br\/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;<br\/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 include fastcgi_params;<br\/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 include snippets\/fastcgi-php.conf;<br\/>\u00a0\u00a0\u00a0 }<\/p><p>\u00a0\u00a0\u00a0 location ~* \\.(js|css|png|jpg|jpeg|gif|ico)$ {<br\/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 try_files $uri \/index.php;<br\/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 expires max;<br\/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 log_not_found off;<br\/>\u00a0\u00a0\u00a0 }<\/p><p>\u00a0\u00a0\u00a0 location = \/_.gif {<br\/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 expires max;<br\/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 empty_gif;<br\/>\u00a0\u00a0\u00a0 }<\/p><p>\u00a0\u00a0\u00a0 location ^~ ^\/(cache|includes|maintenance|languages|serialized|tests|images\/deleted)\/ {<br\/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 deny all;<br\/>\u00a0\u00a0\u00a0 }<\/p><p>\u00a0\u00a0\u00a0 location ^~ ^\/(bin|docs|extensions|includes|maintenance|mw-config|resources|serialized|tests)\/ {<br\/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 internal;<br\/>\u00a0\u00a0\u00a0 }<\/p><p>\u00a0\u00a0\u00a0 # Security for 'image' directory<br\/>\u00a0\u00a0\u00a0 location ~* ^\/images\/.*.(html|htm|shtml|php)$ {<br\/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 types { }<br\/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 default_type text\/plain;<br\/>\u00a0\u00a0\u00a0 }<\/p><p>\u00a0\u00a0\u00a0 # Security for 'image' directory<br\/>\u00a0\u00a0\u00a0 location ^~ \/images\/ {<br\/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 try_files $uri \/index.php;<br\/>\u00a0\u00a0\u00a0 }<\/p><p>}<\/p><\/pre>\n<p>Change as per your requirement\/case, and then save and exit.<\/p>\n<p>Next, activate a new mediawiki virtual host using the following command.<\/p>\n<p class=\"command\">ln -s \/etc\/nginx\/sites-available\/mediawiki \/etc\/nginx\/sites-enabled\/<\/p>\n<p>Test nginx configuration and make sure there is no error. Then restart the service.<\/p>\n<p class=\"command\">nginx -t<br \/>systemctl restart nginx<\/p>\n<p>A new HTTPS port 443 is opened on your server &#8211; check it using the netstat command in the following way.<\/p>\n<p class=\"command\">netstat -plntu<\/p>\n<p>Shown below is the result.<\/p>\n<p><a class=\"fancybox\" id=\"img-12\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_and_configure_mediawiki_with_nginx_on_ubuntu_1604\/big\/12.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2017\/12\/how-to-install-mediawiki-with-nginx-on-ubuntu-16-04-11.png\" alt=\"Configure Nginx\" width=\"500\" height=\"313\" title=\"\"><\/a><\/p>\n<p>Now open your web browser and type your domain name into the address bar.<\/p>\n<p><a href=\"http:\/\/wiki.hakase-labs.co\" target=\"_blank\" rel=\"noopener\">http:\/\/wiki.hakase-labs.co<\/a><\/p>\n<p>And you will be redirected to the HTTPS connection.<\/p>\n<p><a class=\"fancybox\" id=\"img-13\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_and_configure_mediawiki_with_nginx_on_ubuntu_1604\/big\/13.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2017\/12\/how-to-install-mediawiki-with-nginx-on-ubuntu-16-04-12.png\" alt=\"MediaWiki installer\" width=\"500\" height=\"150\" title=\"\"><\/a><\/p>\n<p>Click the &#8216;set up the wiki&#8217; link on the page to configure MediaWiki.<\/p>\n<p><strong>&#8211; Language Configuration<\/strong><\/p>\n<p>Choose your own language, we will choose &#8216;English&#8217; and click &#8216;Continue&#8217;.<\/p>\n<p><a class=\"fancybox\" id=\"img-14\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_and_configure_mediawiki_with_nginx_on_ubuntu_1604\/big\/14.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2017\/12\/how-to-install-mediawiki-with-nginx-on-ubuntu-16-04-13.png\" alt=\"Language Configuration\" width=\"500\" height=\"262\" title=\"\"><\/a><\/p>\n<p><strong>&#8211; Environment Checking<\/strong><\/p>\n<p>And now, MediaWiki will perform environment checking. Make sure you get the result as shown below.<\/p>\n<p><a class=\"fancybox\" id=\"img-15\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_and_configure_mediawiki_with_nginx_on_ubuntu_1604\/big\/15.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2017\/12\/how-to-install-mediawiki-with-nginx-on-ubuntu-16-04-14.png\" alt=\"Check installation environment\" width=\"500\" height=\"285\" title=\"\"><\/a><\/p>\n<p>Click &#8216;Continue&#8217; for installation.<\/p>\n<p><strong>&#8211; Database Configuration<\/strong><\/p>\n<p>Now for the Database configuration. In the &#8216;Database name&#8217; field, type &#8216;mediawikidb&#8217; with prefix &#8216;wiki_&#8217;. Next, type the database user &#8216;mediawiki&#8217; and password &#8216;mypassword&#8217;.<\/p>\n<p><a class=\"fancybox\" id=\"img-16\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_and_configure_mediawiki_with_nginx_on_ubuntu_1604\/big\/16.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2017\/12\/how-to-install-mediawiki-with-nginx-on-ubuntu-16-04-15.png\" alt=\"Database configuration\" width=\"500\" height=\"287\" title=\"\"><\/a><\/p>\n<p>And click &#8216;Continue&#8217;.<\/p>\n<p><strong>&#8211; Database Settings<\/strong><\/p>\n<p>As for the Database settings, just leave it default and click &#8216;Continue&#8217;.<\/p>\n<p><a class=\"fancybox\" id=\"img-17\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_and_configure_mediawiki_with_nginx_on_ubuntu_1604\/big\/17.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2017\/12\/how-to-install-mediawiki-with-nginx-on-ubuntu-16-04-16.png\" alt=\"Database settings\" width=\"500\" height=\"231\" title=\"\"><\/a><\/p>\n<p><strong>&#8211; Create an Admin User<\/strong><\/p>\n<p>Now we need to create the administrator account. Type your own user, password, and email as shown below.<\/p>\n<p><a class=\"fancybox\" id=\"img-18\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_and_configure_mediawiki_with_nginx_on_ubuntu_1604\/big\/18.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2017\/12\/how-to-install-mediawiki-with-nginx-on-ubuntu-16-04-17.png\" alt=\"Create admin user\" width=\"500\" height=\"288\" title=\"\"><\/a><\/p>\n<p>And click &#8216;Continue&#8217;.<\/p>\n<p><strong>&#8211; MediaWiki Additional Configuration<\/strong><\/p>\n<p>And you should get to the page about &#8216;MediaWiki Additional Configuration&#8217;.<\/p>\n<p><a class=\"fancybox\" id=\"img-19\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_and_configure_mediawiki_with_nginx_on_ubuntu_1604\/big\/19.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2017\/12\/how-to-install-mediawiki-with-nginx-on-ubuntu-16-04-18.png\" alt=\"Additional configuration\" width=\"500\" height=\"287\" title=\"\"><\/a><\/p>\n<p>Leave it with default values, and click &#8216;Continue&#8217;.<\/p>\n<p><strong>&#8211; MediaWiki Installation<\/strong><\/p>\n<p>Now click &#8216;Continue&#8217; again to install MediaWiki.<\/p>\n<p><a class=\"fancybox\" id=\"img-20\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_and_configure_mediawiki_with_nginx_on_ubuntu_1604\/big\/20.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2017\/12\/how-to-install-mediawiki-with-nginx-on-ubuntu-16-04-19.png\" alt=\"MediaWiki Installation\" width=\"500\" height=\"257\" title=\"\"><\/a><\/p>\n<p>And you will get to the page similar to the one shown below.<\/p>\n<p><a class=\"fancybox\" id=\"img-21\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_and_configure_mediawiki_with_nginx_on_ubuntu_1604\/big\/21.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2017\/12\/how-to-install-mediawiki-with-nginx-on-ubuntu-16-04-20.png\" alt=\"Installation continues\" width=\"500\" height=\"257\" title=\"\"><\/a><\/p>\n<p>Click &#8216;Continue&#8217; again.<\/p>\n<p>Now you will see the page says installation is complete. You will be prompted for downloading new file &#8216;LocalSettings.php&#8217; &#8211; download the file.<\/p>\n<p><a class=\"fancybox\" id=\"img-22\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_and_configure_mediawiki_with_nginx_on_ubuntu_1604\/big\/22.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2017\/12\/how-to-install-mediawiki-with-nginx-on-ubuntu-16-04-21.png\" alt=\"Locale settings\" width=\"500\" height=\"236\" title=\"\"><\/a><\/p>\n<p>And upload the &#8216;LocalSetting.php&#8217; file to the server mediawiki directory &#8216;\/var\/www\/mediawiki&#8217;. Also, do not forget to change the owner of the file to &#8216;www-data&#8217; user and group.<\/p>\n<p class=\"command\">scp LocalSettings.php <a href=\"https:\/\/www.howtoforge.com\/cdn-cgi\/l\/email-protection\" class=\"__cf_email__\" data-cfemail=\"20524f4f546048414b4153450d4c4142530e434f\" target=\"_blank\" rel=\"noopener\">[email\u00a0protected]<\/a>:\/var\/www\/mediawiki\/<br \/>chown -R www-data:www-data \/var\/www\/mediawiki<\/p>\n<p>Now, come back to your web browser MediaWiki installation page, and click the link &#8216;enter your wiki&#8217;. You will be told that MediaWiki has been installed with Nginx web server on Ubuntu 16.04 server.<\/p>\n<p><a class=\"fancybox\" id=\"img-23\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_and_configure_mediawiki_with_nginx_on_ubuntu_1604\/big\/23.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2017\/12\/how-to-install-mediawiki-with-nginx-on-ubuntu-16-04-22.png\" alt=\"MediaWiki installed\" width=\"500\" height=\"260\" title=\"\"><\/a><\/p>\n<h2 id=\"step-download-and-configure-default-skin\">Step 8 &#8211; Download and Configure Default Skin<\/h2>\n<p>At this stage, mediawiki installation has been completed. And in this step, we will configure the default skin\/theme.<\/p>\n<p>Go to the &#8216;\/var\/www\/mediawiki\/skins&#8217; directory and clone the default skin &#8216;Vector&#8217;.<\/p>\n<p class=\"command\">cd \/var\/www\/mediawiki\/skins\/<br \/>sudo git clone https:\/\/gerrit.wikimedia.org\/r\/mediawiki\/skins\/Vector<\/p>\n<p><a class=\"fancybox\" id=\"img-24\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_and_configure_mediawiki_with_nginx_on_ubuntu_1604\/big\/24.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2017\/12\/how-to-install-mediawiki-with-nginx-on-ubuntu-16-04-23.png\" alt=\"Download MediaWiki skin\" width=\"500\" height=\"156\" title=\"\"><\/a><\/p>\n<p>Now edit the &#8216;LocalSettings.php&#8217; file using the vim editor.<\/p>\n<p class=\"command\">vim \/var\/www\/mediawiki\/LocalSettings.php<\/p>\n<p>And paste the following php code towards the end of file.<\/p>\n<pre class=\"system\">wfLoadSkin( 'Vector' );<\/pre>\n<p>That&#8217;s it. Save and exit.<\/p>\n<p>Come back to your web browser and refresh the MediaWiki page. Make sure you get the MediaWiki with &#8216;Vector&#8217; skin as shown below.<\/p>\n<p><a class=\"fancybox\" id=\"img-25\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_and_configure_mediawiki_with_nginx_on_ubuntu_1604\/big\/25.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2017\/12\/how-to-install-mediawiki-with-nginx-on-ubuntu-16-04-24.png\" alt=\"Vector skin\" width=\"500\" height=\"222\" title=\"\"><\/a><\/p>\n<p>MediaWiki installation and configuration with Nginx web server on Ubuntu 16.04 has been completed successfully.<\/p>\n<h2 id=\"reference\">Reference<\/h2>\n<div>\n<p><b>Share this page:<\/b><\/p>\n<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial, I will show you step-by-step how to install MediaWiki with Nginx web server on Ubuntu 16.04. I will guide you on how to install and configure the LEMP stack for MediaWiki installation, including generating and configuring new free SSL Letsencrypt for MediaWiki security. MediaWiki is one of the most popular wiki software &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[36],"tags":[],"class_list":["post-2185","post","type-post","status-publish","format-standard","hentry","category-36"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/2185","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/comments?post=2185"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/2185\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=2185"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=2185"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=2185"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}