In this tutorial, we will show you how to install PhpWiki on CentOS 7 server. For those of you who didn’t know, PhpWiki is a wiki-based content management software written in PHP, used to create websites where anyone can edit or create the pages using a web browser.
This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple. I will show you the step-by-step installation PhpWiki on CentOS 7 server.
Prerequisites
- A server running one of the following operating systems: CentOS 7.
- It’s recommended that you use a fresh OS install to prevent any potential issues.
- SSH access to the server (or just open Terminal if you’re on a desktop).
- A
non-root sudo user
or access to theroot user
. We recommend acting as anon-root sudo user
, however, as you can harm your system if you’re not careful when acting as the root.
Install PhpWiki on CentOS 7
Step 1. First of all, make sure that all packages are up to date.
yum - update
Step 2. Install the LAMP server.
A CentOS 7 LAMP server is required. If you do not have LAMP installed, you can follow our guide here.
Step 3. Install Zikula.
Download the latest stable version of PhpWiki, At the moment of writing this article it is version 1.5.4:
wget http://downloads.sourceforge.net/project/phpwiki/phpwiki-1.5.4.zip unzip phpwiki-1.5.4.zip -d /var/www/html/ cd /var/www/html/ mv phpwiki-1.5.4 phpwiki
We will need to change some folders permissions:
chown apache:apache -R /var/www/html/phpwiki/
Step 4. Configuring MariaDB.
By default, MariaDB is not hardened. You can secure MySQL using the mysql_secure_installation
script. you should read and below each step carefully which will set a root password, remove anonymous users, disallow remote root login, and remove the test database and access to secure MariaDB.
mysql_secure_installation
Next, we will need to log in to the MariaDB console and create a database for the PhpWiki. Run the following command:
mysql -u root -p
This will prompt you for a password, so enter your MariaDB root password and hit Enter. Once you are logged in to your database server you need to create a database for PhpWiki installation:
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
Step 5. Configuring Apache webserver.
Create a new virtual host directive in Apache:
nano /etc/httpd/vhosts.d/yourdomain.conf
Add the following lines to it:
<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 </Directory> ErrorLog logs/yourdomain.com-error_log CustomLog logs/yourdomain.com-access_log common </VirtualHost>
Now, we can restart Apache so that the changes take place:
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:
- Enter the name of your website, administrator username, and password
- Make sure you select to use encrypted passwords to be stored in the ‘config.ini’ file and the user’s homepages metadata
- Set the path to access the log file (e.g.
/var/log/httpd/yourdomain.com-access_log
) - Set ‘COMPRESS_OUTPUT’ to true (Always try to compress output)
- Set ‘HTTP Cache-Control’ to ‘LOOSE’ so cached pages will be invalidated whenever they are edited
- Select the database backend type to SQL
- SQL Type (MySQL), SQL User (phpwikiuser) and its password, SQL Database Name (phpwikidb)
- Set ‘Allow anonymous edit’ and ‘Allow Bogo Login’ to false
- Set ‘PASSWORD_LENGTH_MINIMUM’ to at least 8 characters
- Edit part four: ‘Page appearance and layout’ according to your liking and finally click on the ‘Save config/config.ini’ button.
Step 6. Accessing PhpWiki.
PhpWiki content management system will be available on HTTP port 80 by default. Open your favorite browser and navigate to http://yourdomain.com
or http://server-ip-address
and complete the required steps to finish the installation. If you are using a firewall, please open port 80 to enable access to the control panel.
Congratulations! You have successfully installed PhpWiki. Thanks for using this tutorial for installing the PhpWiki content management system in CentOS 7 system. For additional help or useful information, we recommend you check the official PhpWiki website.