How to install ocPortal on a CentOS 7 VPS
ocPortal is a free and open souce, PHP based content management system. It can be thoroughly customized and it comes with lots of website features out of the box. In this tutorial we will install ocPortal on a CentOS 7 VPS with the Apache web server, PHP and MariaDB.
First of all update your system and install the necessary packages.
yum -y update yum -y install wget unzip
Install Apache web server
yum install httpd
Start the web server and enable it to start on boot
systemctl start httpd.service systemctl enable httpd.service
Install PHP and few additional PHP modules
yum install php php-fpm php-cli php-mbstring php-gd php-curl php-pdo php-xml
Next, we will install MariaDB on the server by executing the following commands:
yum install mariadb-server mariadb
To start MariaDB and enable it at the boot time run:
systemctl start mariadb.service systemctl enable mariadb.service/
In order to secure your MariaDB server and set a MySQL 'root' password, run the following script
and use the following options
- 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
Once you are finished with the step above, login as a MariaDB root and create an new database and user:
mysql -uroot -p
MariaDB [(none)]> CREATE DATABASE ocportal; MariaDB [(none)]> GRANT ALL ON ocportal.* to ocportaluser@localhost identified by 'YOURPASSWORD'; MariaDB [(none)]> FLUSH PRIVILEGES; MariaDB [(none)]> \q
Don’t forget to replace ‘YOURPASSWORD’ with an actual strong password.
Now, create a new directory for ocPortal inside the document root directory on your server.
mkdir /var/www/html/yourdomain.com cd /var/www/html/yourdomain.com
and go to ocPortal’s official website and download the latest stable release. At the moment of writing this article it is version 9.0.15.
Unpack the downloaded zip archive
Set the correct ownership
chown -R apache:apache /var/www/html/yourdomain.com/
Create a virtual host directive for your domain in the web server configuration file
<VirtualHost *:80> ServerAdmin firstname.lastname@example.org DocumentRoot /var/www/html/yourdomain.com ServerName yourdomain.com ErrorLog logs/yourdomain.com-error_log CustomLog logs/yourdomain.com-access_log common </VirtualHost>
And restart apache
systemctl restart httpd
That’s all. Now, head your favourite web browser to http://yourdomain.com/install.php to finish the installation. You will need to configure ocPortal settings, create an admin account, enter the information or the MariaDB we’ve created earlier in this tutorial, etc…
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 ocPortal 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.