In this tutorial, we will show you how to install and configuration of PHP-Fusion on your CentOS 7. For those of you who didn’t know, PHP-Fusion is a lightweight open-source content management system (CMS) written in PHP. It uses a MySQL database to store your site content and includes a simple yet comprehensive administration system. PHP-Fusion includes the most common features you would expect to see in many other CMS packages including news, articles, forums, polls, shoutboxes, comments, ratings, much more.
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 of PHP-Fusion on the CentOS 7 server.
Install PHP-Fusion on CentOS 7
Step 1. First, let’s start by ensuring your system is up-to-date.
yum -y update
Step 2. Install 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 PHP-Fusion.
Download the latest stable version of PHP-Fusion, At the moment of writing this article it is version 7:
mkdir /var/www/html/mywebsite.com wget http://downloads.sourceforge.net/project/php-fusion/PHP-Fusion%20Archives/7.x/PHP-Fusion-7.02.07.zip unzip PHP-Fusion-7.02.07.zip cp -R PHP-Fusion-7.02.07/files/* /var/www/html/mywebsite.com/
Now, we’ll rename
_config.php file to config.php by running the command below:
cd /var/www/html/mywebsite.com/ mv _config.php config.php
We will need to change some folders permissions:
chown -R apache:apache /var/www/html/mywebsite.com/
Step 4. Configuring MariaDB.
By default, MariaDB is not hardened. You can secure MariaDB 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.
Configure it like this:
- Set root password? [Y/n] y - Remove anonymous users? [Y/n] y - Disallow root login remotely? [Y/n] y - Remove test database and access to it? [Y/n] y - Reload privilege tables now? [Y/n] y
Next, we will need to log in to the MariaDB console and create a database for the PHP-Fusion. 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 PHP-Fusion installation:
MariaDB > CREATE DATABASE phpfusion; MariaDB > GRANT ALL ON phpfusion.* to phpfusionuser@localhost identified by 'YOURPASSWORD'; MariaDB > FLUSH PRIVILEGES; MariaDB > \q
Step 5. Configuring Apache web server for PHP-Fusion.
It is time to configure Apache. Create a ‘
/etc/httpd/conf.d/vhosts.conf’ file with the following content
nano /etc/httpd/conf.d/vhosts.conf IncludeOptional vhosts.d/*.conf
Create a ‘
/etc/httpd/vhosts.d’ directory where we will put all our virtual hosts:
Create a virtual host for our domain:
cd /etc/httpd/vhosts.d nano yourdomain.com
Add the following lines at the end of the file:
<VirtualHost YOUR_SERVER_IP:80> ServerAdmin email@example.com DocumentRoot "/var/www/html/yourdomain.com" ServerName yourdomain.com ServerAlias www.yourdomain.com ErrorLog "/var/log/httpd/yourdomain.com-error_log" CustomLog "/var/log/httpd/yourdomain.com-access_log" combined <Directory "/var/www/html/yourdomain.com/"> DirectoryIndex index.php Options FollowSymLinks AllowOverride All Require all granted </Directory> </VirtualHost>
Step 6. Accessing PHP-Fusion.
PHP-Fusion will be available on HTTP port 80 by default. Open your favorite browser and navigate to
http://server-ip 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 PHP-Fusion. Thanks for using this tutorial for installing PHP-Fusion CMS in CentOS 7 system. For additional help or useful information, we recommend you to check the official PHP-Fusion website.