How to install PhpWiki on a CentOS 7 VPS

PhpWiki is a wiki-based content management software written in PHP, used to create web sites where anyone can edit or create the pages using a web browser.
In this tutorial we will show you the steps needed to install PhpWiki on a CentOS 7 VPS.

At the time of writing this tutorial, the latest stable version of PhpWiki is 1.5.3 and it requires:

This install guide assumes that Apache, MySQL (or MariaDB) and PHP are already installed and configured on your virtual server. If your server has a minimal CentOS 7 base installation, you can install Apache, MariaDB and PHP stack by following this tutorial.

Download the latest version of PhpWiki available at ‘http://downloads.sourceforge.net/project/phpwiki/’ to the server and extract it using the following commands:

cd /opt/
wget http://downloads.sourceforge.net/project/phpwiki/phpwiki-1.5.3.zip
unzip phpwiki-1.5.3.zip -d /var/www/html/
cd /var/www/html/
mv phpwiki-1.5.3 phpwiki

Create a new MySQL database for PhpWiki on your server:

mysql -u root -p
MariaDB > create database phpwikidb;
MariaDB > grant all privileges on phpwikidb.* to phpwikiuser@localhost identified by 'your-password';
MariaDB > > flush privileges;
MariaDB > quit;

Create tables inside your phpwikidb database:

cd /var/www/html/phpwiki/schemas
mysql -uphpwikiuser -pyour-password phpwikidb < mysql-initialize.sql

Create a new virtual host directive in Apache. For example, edit your Apache configuration file (‘/etc/httpd/conf/httpd.conf’ by default) and un-comment the following line:

#NameVirtualHost *:80

Then, add the following lines at the end:

<VirtualHost *:80>
ServerAdmin admin@yourdomain.com
DocumentRoot /var/www/html/phpwiki/
ServerName yourdomain.com
ServerAlias www.yourdomain.com
<Directory /var/www/html/phpwiki/>
    DirectoryIndex index.php
    Options FollowSymLinks
    AllowOverride All
    Require all granted
    ErrorLog logs/yourdomain.com-error_log
    CustomLog logs/yourdomain.com-access_log common

Restart the Apache service for the changes to take effect:

systemctl restart httpd.service

Create a subdirectory called ‘data’ in the ‘phpwiki’ directory:

mkdir -p /var/www/html/data/

Copy ‘/var/www/html/config/config-dist.ini’ to ‘/var/www/html/phpwiki/config/config.ini’ and edit the settings in ‘/var/www/html/phpwiki/config/config.ini’ file according to your needs. It may be simpler for you to use http://phpwiki.fr/configurator.php to generate the ‘config.ini’ configuration file for PhpWiki:

Copy the generated configuration to a file, and save it as ‘/var/www/html/phpwiki/config/config.ini’. Set the proper ownership of PhpWiki files and directories using the following command:

chown apache:apache -R /var/www/html/phpwiki/

That is it. The PhpWiki installation is now complete.

Open http://yourdomain.com in your favorite browser and once the initialization complete, open http://yourdomain.com/index.php/PhpWikiAdministration and log in using your Administrator login credentials.
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 PhpWiki 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.


Categories: Tutorials

View Comments

Leave a Comment