How to Install PyroCMS on Ubuntu 18.04

r00t May 11, 2018

Install PyroCMS on Ubuntu 18.04

In this tutorial we’ll learn how to install PyroCMS on Ubuntu 18.04. We will also install and configure its prerequisites. PyroCMS is a lightweight CMS built with the very popular PHP framework CodeIgniter, simple enough for any developer to create custom modules and for any end user to understand how PyroCMS works. PyroCMS comes with a responsive control panel that makes it easy to manage your content from a central location.

I recommend to use a minimal Ubuntu server setup as a basis for the tutorial, that can be a virtual or a root server image with an Ubuntu 18.04 LTS minimal install from a web hosting company or you use our minimal server tutorial to install a server from scratch.

Install PyroCMS on Ubuntu 18.04

Step 1. First, ensure your system and apt package lists are fully up-to-date by running the following:

apt-get update -y
apt-get upgrade -y

Step 2. Installing LAMP on Ubuntu 18.04 LTS.

You should check out this LAMP stack install tutorial for Ubuntu 18.04, if you haven’t installed LAMP yet. Once it’s installed, come back here and read on. We also will install the required packages for LAMP stack and the important PHP extension that TextPattern CMS relies on:

apt-get install php7.2 libapache2-mod-php7.2 php7.2-common php7.2-mbstring php7.2-xmlrpc php7.2-soap php7.2-mysql php7.2-gd php7.2-xml php7.2-cli php7.2-zip

Step 3. Installing PyroCMS on Ubuntu 18.04.

Run the commands below to install Composer and use it to download PyroCMS content:

sudo curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/bin --filename=composer
cd /var/www/html/
sudo composer create-project pyrocms/pyrocms

Next, run the commands below to change folder permissions:

sudo chown -R www-data:www-data /var/www/html/pyrocms/
sudo chmod -R 755 /var/www/html/pyrocms/

Step 4. Create a database for PyroCMS.

Next, we need to create a database for the PyroCMS installation:

mysql -uroot -p

Run the following command to create a database for PyroCMS:

MariaDB> CREATE DATABASE pyrodb;
MariaDB> GRANT ALL PRIVILEGES ON pyrodb.* TO 'pyrouser'@'localhost' IDENTIFIED BY 'your-password' WITH GRANT OPTION;
MariaDB> FLUSH PRIVILEGES;
MariaDB> quit

Step 5. Configure Apache web server for PyroCMS.

For this you can take the default config as a template:

cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/pyrocms.conf

Now edit the currently created Config as follows:

nano /etc/apache2/sites-available/pyrocms.conf

Modify the virtual host file for your PyroCMS site to resemble the example below:

<VirtualHost *:80>
 ServerAdmin admin@example.com
 DocumentRoot /var/www/html/pyrocms/public
 ServerName example.com
 ServerAlias www.example.com

<Directory /var/www/html/pyrocms/public/>
 Options FollowSymlinks
 AllowOverride All
 Require all granted
 </Directory>

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

Finally, reload the web server as suggested, for the changes to take effect:

a2ensite pyrocms.conf
a2enmod rewrite
systemctl restart apache2.service

Step 6. Accessing PyroCMS.

Now you can access the PyroCMS web install wizard in your browser by entering the domain name or http://yourdomain/textpattern to continue your PyroCMS installation.

Congratulation’s! You have successfully install and configured PyroCMS on your Ubuntu 18.04 Bionic Beaver server. Thanks for using this tutorial installing PyroCMS on Ubuntu 18.04 LTS (Bionic Beaver) system.

The Tags:

Leave a Comment

Comments are closed.