{"id":491,"date":"2016-06-16T12:55:37","date_gmt":"2016-06-16T17:55:37","guid":{"rendered":"https:\/\/tedstechshack.com\/?p=491"},"modified":"2016-06-16T12:57:05","modified_gmt":"2016-06-16T17:57:05","slug":"set-latest-mediawiki-lighttpd-ubuntu-14-04","status":"publish","type":"post","link":"https:\/\/tedstechshack.com\/2016\/06\/16\/set-latest-mediawiki-lighttpd-ubuntu-14-04\/","title":{"rendered":"How to Set up the Latest MediaWiki with Lighttpd on Ubuntu 14.04"},"content":{"rendered":"
MediaWiki<\/strong> is a popular open source wiki platform that can be used for public or internal collaborative content publishing. Originally designed in 2002 to render Wikipedia, MediaWiki is a proven, efficient, and powerful wiki platform.<\/p>\n In this guide, we will be setting up the latest version of MediaWiki on an Ubuntu 14.04 server. We will be using the Lighttpd<\/strong> web server to serve our content, PHP-FPM<\/strong> to handle dynamic processing, and MySQL<\/strong> to store our wiki’s data.<\/p>\n When you have finished with this tutorial, you will have a fully functional, lightweight, wiki. With your new wiki you will be able to collaborate and share any information you desire.<\/p>\n To complete this guide, you will need access to a fresh Ubuntu 14.04 server. For security reasons, you should have a non-root<\/em> user with sudo<\/em> privileges for administrative tasks.<\/p>\n Once you have your server set up, log in to your server with your user account and follow the rest of this guide below.<\/p>\n Now that you have a fresh system image, it is a good idea to go ahead and update your system to the latest packages. You can do this by entering the following commands:<\/p>\n The first command will update your package index files and the second will intelligently<\/em> upgrade all of your packages to the latest versions in the repositories. Once your system has come back up, go ahead and login and continue with this tutorial.<\/p>\n Lighttpd (pronounced “lighty”) is a lightweight, fully featured, open source, web server that scales excellently.<\/p>\n Since Lighttpd<\/b> is supported in the standard Ubuntu repositories all you need do is use the following command to install it:<\/p>\n This command will install the lighttpd<\/b> package on your system, as well as any of the Lighttpd package dependencies that are missing. <\/p>\n PHP-FPM (FastCGI Process Manager) is an alternative PHP CGI implementation that is fast, robust and particularly suited for busy sites. PHP-FPM has been bundled with the official PHP distribution since version 5.3.3.<\/p>\n As php5-fpm<\/b> is in the Ubuntu repositories, you can install the package with the command:<\/p>\n This will install the php5-fpm<\/b> package and all required dependencies, such as php5<\/b>. We also need the php5-mysql<\/b> package so MediaWiki can interface with our database.<\/p>\n Note:<\/b> Initially I was stumped when I was unable to get Lighttpd to work with php5-fpm<\/b>. It seems that on Ubuntu the php5-cgi<\/b> package is also required to use lighttpd<\/b> with php5-fpm<\/b>. The clue lied in the following comment in the \/etc\/lighttpd\/conf-enabled\/15-fastcgi-php.conf<\/b> file:<\/p>\n ## Start an FastCGI server for php (needs the php5-cgi package)<\/p><\/blockquote>\n<\/div>\n MySQL is a popular open source SQL database implementation. MediaWiki requires a database in which to store our information. The reader might also wish to explore MariaDB and PostgreSQL which are popular alternatives to MySQL.<\/p>\n Enter the following command to install MySQL:<\/p>\n This will install the MySQL server and required dependencies. In the process of installing MySQL you will be prompted to enter a password for the MySQL root<\/b> user.<\/p>\n <\/p>\n For security purposes, you will want to enter a unique, strong password and save it in a secure place. It is inadvisable to reuse your system root<\/b> or sudo<\/b> user’s password.<\/p>\n You can verify that MySQL installed OK by connecting to your MySQL server with the command:<\/p>\n You will be prompted for the MySQL root<\/b> password that you entered in the previous step. Enter that password and you will connect to the MySQL server. At the prompt you can enter the command status<\/b> to get some information about your MySQL server. You can enter the command quit<\/b> to get back to the shell prompt.<\/p>\n <\/p>\n An optional, but recommended step is to run the mysql_secure_installation<\/b> script. This script will improve your MySQL security. You should be fine accepting the default<\/i> answers. For more information see the mysql-secure-installation documentation<\/a>.<\/p>\n To run the script enter this command at your shell prompt:<\/p>\nPrerequisites<\/h2>\n
Step 1 \u2014 Update System<\/h2>\n
sudo apt-get update
\nsudo apt-get dist-upgrade<\/code><\/p>\n
\nOnce you have upgraded all your packages, it is not required, but it is probably a good idea to reboot your system. This way if your kernel or some other packages that could not be restarted were upgraded you will be starting with a clean boot. An easy way to reboot your system is to use the reboot<\/b> command.<\/p>\nsudo reboot<\/code><\/p>\n
Step 2 \u2014 Install Lighttpd<\/h2>\n
sudo apt-get install lighttpd<\/code><\/p>\n
\nYou can verify that Lighttpd is running on your server by directing your browser to your server’s FQDN or IP address http:\/\/your_server_ip<\/span>\/<\/b> and you should see something like this:<\/p>\nStep 3 \u2014 Install PHP<\/h2>\n
sudo apt-get install php5-cgi php5-fpm php5-mysql<\/code><\/p>\n
Step 4 \u2014 Install MySQL<\/h2>\n
sudo apt-get install mysql-server<\/code><\/p>\n
mysql -u root -p<\/code><\/p>\n