Install PmWiki on an Ubuntu 14.04 VPS with Nginx

pmwikiIn this article we will show you how to install PmWiki on an Ubuntu 14.04 VPS with Nginx.

PmWiki a free PHP based wiki system which is designed to be easy to install and customize as an engine for creating professional web sites with one to any number of content authors. The software focuses on ease-of-use, it is extensible and customizable so people with little IT or wiki experience will be able to put it to use. It uses regular files to store content and each page of the wiki is stored in its own file on the web server. The PmWiki wiki markup shares similarities with MediaWiki (used by Wikipedia) and it’s markup engine is highly customizable, allowing adding, modifying or disabling markup rules. It can also support other markup languages.


PmWiki is designed to be able to store and retrieve the pages’ text and metadata on various systems and formats. It does not support databases in its default installation. However, via plug-ins, PmWiki can already use MySQL or SQLite databases for data storage.

REQUIREMENTS

– PHP 5+ version
– A web server that can run PHP scripts which in our case is Nginx

For our purposes we will be using our SSD 1 Linux VPS Hosting plan for this tutorial.

UPDATE THE SYSTEM

First of all, Log in to your server as user ‘root’ and make sure that all the packages are up to date:

# apt-get update
# apt-get upgrade

INSTALL NGINX

If you don’t have Nginx already installed on your server, the following command will take care of that procedure:

# apt-get install nginx

DOWNLOAD AND INSTALL PMWIKI

Let’s download the latest stable release of PmWiki from their official website. During the writing of this tutorial the current version of PmWiki is 2.2.72. We will download the archive in the /opt directory.Execute the below commands:

# cd /opt

# wget http://www.pmwiki.org/pub/pmwiki/pmwiki-latest.zip

Unpack the downloaded archive pmwiki-latest.zip in the document root directory of your Nginx web server. If you are not sure about the location, you can find out by executing:

# grep -i root /etc/nginx/sites-available/default

 root /usr/share/nginx/html;

As you can see the default path is ‘/usr/share/nginx/html’ . With that taken care of, let’s finally unzip the downloaded archive:

# unzip pmwiki-latest.zip -d /usr/share/nginx/html/

This will create a ‘pmwiki-2.2.72′ directory. We will rename it to a simpler name:

# mv /usr/share/nginx/html/pmwiki-2.2.72/ /usr/share/nginx/html/pmwiki

Now create a writable wiki.d/ directory:

# mkdir /usr/share/nginx/html/pmwiki/wiki.d

Change the owner of the PmWiki directory to the Nginx user:

# chown -R www-data: /usr/share/nginx/html/pmwiki

Create a directory index file in the main PmWiki directory using your favorite text editor:

# cd /usr/share/nginx/html/pmwiki

# vim index.php

Paste the following and change the owner to www:data :

<?php include('pmwiki.php');

# chown www-data: index.php

PmWiki’s configuration file does not exist by default, but we can create it by copying the sample configuration file that is located in the ‘/docs’ directory:

# cp docs/sample-config.php local/config.php

That’s it. You have successfully installed PmWiki on your server. Now open your favorite web browser and access PmWiki by navigating to: http://your_ip_address/pmwiki

For more information, please check out the official PmWiki website.

Of course you don’t have to do any of this if you use one of our Linux VPS Hosting services, in which case you can simply ask our expert Linux admins to install PmWiki for you. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.

Leave a Comment