How to Install phpwcms on a CentOS 7 VPS

template_r1_c1

phpwcms is a free and open source content management system and PHP development framework. It is very powerful, fast and flexible. It’s used by developers to create thousands of websites around the world. With its extensibility, phpwcms can create powerful websites with a lot of features. The admin area is easy to use with great user interface and beginners can easily adapt to it. In this tutorial we will guide you through the process of installing phpwcms on a CentOS 7 VPS with Apache web server, PHP and MariaDB

To start the installation, login to your CentOS 7 server as user root

ssh root@IP

As usual, run the following command to update all installed packages

yum -y update

Next, install Apache web server

yum -y install httpd

Once the installation of the web server is completed, start it and set it to start automatically on boot.

systemctl start httpd
systemctl enable httpd

phpwcms is a PHP based application and we need to install PHP with the ‘mysql’ extensions installed

yum -y install php php-mysql

Run the following command on your terminal to install MariaDB server on your CentOS 7 server

yum -y install mariadb mariadb-server

Once the installation is completed start the MariaDB server and set it to start on system boot

systemctl start mariadb
systemctl enable mariadb

Then, run the mysql_secure_installation script. This script will help you to improve the security of your MariaDB installation and set your MariaDB root password.

phpwcms requires an empty database, so login to the MariaDB server with the root user and create a new user and database that will be used by phpwcms to store information

mysql -u root -p

CREATE DATABASE phpwcms;
CREATE USER 'phpwcmsuser'@'localhost' IDENTIFIED BY 'PASSWORD';
GRANT ALL PRIVILEGES ON `phpwcms`.* TO 'phpwcmsuser'@'localhost';
FLUSH PRIVILEGES;
exit

Don’t forget to replace ‘PASSWORD’ with an actual strong password.

Download the latest available phpwcms release from their official website to your server. Make sure that you are downloading the full release, and not a patch package.

wget https://github.com/slackero/phpwcms/archive/phpwcms-1.8.2.zip

Unpack the downloaded ZIP archive to the document root directory on your server

unzip phpwcms-1.8.2.zip -d /var/www/html/

This will create a new directory for phpwcms with the version number. Change the name of the directory to something simpler.

cd /var/www/html/
mv phpwcms-phpwcms-1.8.2 phpwcms

Set the Apache user as the owner of the phpwcms files and directories

Need a fast and easy fix?
✔ Unlimited Managed Support
✔ Supports Your Software
✔ 2 CPU Cores
✔ 2 GB RAM
✔ 50 GB PCIe4 NVMe Disk
✔ 1854 GeekBench Score
✔ Unmetered Data Transfer
NVME 2 VPS

Now just $43 .99
/mo

GET YOUR VPS
chown -R apache: /var/www/html/phpwcms

On the next step we will create an Apache virtual host for your phpwcms based website. Create a ‘/etc/httpd/conf.d/vhosts.conf’ file with the following content:

IncludeOptional vhosts.d/*.conf

Create a ‘vhosts.d/’ directory

mkdir /etc/httpd/vhosts.d/

and create the virtual host with the following content

vim /etc/httpd/vhosts.d/yourdomain.com.conf

<VirtualHost YOUR_SERVER_IP:80>
ServerAdmin webmaster@yourdomain.com
DocumentRoot "/var/www/html/phpwcms/"
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/phpwcms/">
DirectoryIndex index.html index.php
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>

Save the file and restart the Apache web server for the changes to take effect.

systemctl restart httpd

With this step the installation from the command line is completed. Now, open a web browser and navigate it to http://yourdomain.com/setup/index.php, accept their terms and conditions and follow the on-screen instructions to complete the phpwcms installation.


Of course you don’t have to do any of this if you use one of our Blazing-Fast CMS Hosting services, in which case you can simply ask our expert Linux admins to install phpwcms 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