How to install Fork CMS on Ubuntu 18.04 LTS
This tutorial exists for these OS versions
- Ubuntu 22.04 (Jammy Jellyfish)
- Ubuntu 20.04 (Focal Fossa)
- Ubuntu 18.04 (Bionic Beaver)
On this page
Fork CMS is a free and open source content management CMS that comes with an intuitive and user-friendly web interface. It comes with powerful tools that make your website more beautiful. Fork is a simple, lightweight and an easy to use CMS built on Symfony.
In this tutorial, we will explain how to install and configure Fork CMS on Ubuntu 18.04 LTS (Bionic Beaver) server.
Requirements
- A server running Ubuntu 18.04.
- A non-root user with sudo privileges.
Install Apache, PHP and MariaDB
Before starting, you will need to install Apache, MariaDB and PHP to your server. First, install Apache and MariaDB server using the following command:
sudo apt-get install apache2 mariadb-server -y
Next, you will need to add the ondrej repository in order to install the latest version of PHP. You can add it with the following command:
sudo apt-get install software-properties-common -y
sudo add-apt-repository ppa:ondrej/php
Once the repository is installed, update the repository and install PHP along with all the libraries using the following command:
sudo apt-get update -y
sudo apt-get install php7.2 libapache2-mod-php7.2 php7.2-xml php7.2-cli php7.2-zip php7.2-common php7.2-sqlite php7.2-curl php7.2-intl php7.2-mbstring php7.2-xmlrpc php7.2-mysql php7.2-gd wget unzip -y
Once all the packages are installed, open php.ini file and make some changes:
sudo nano /etc/php/7.2/apache2/php.ini
Make the following changes:
memory_limit = 256M upload_max_filesize = 100M max_execution_time = 360 file_uploads = On date.timezone = Asia/Kolkata
Save and close the file, when you are finished.
Next, start Apache and MariaDB server and enable them to start on boot with the following command:
sudo systemctl start apache2
sudo systemctl enable apache2
sudo systemctl start mariadb
sudo systemctl enable mariadb
Configure Database
Before configuring MariaDB, secure MariaDB installation using the following command:
sudo mysql_secure_installation
This script will set root password, remove anonymous users, disallow root login remotely and remove test database as shown below:
Set root password? [Y/n] n 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 MariaDB is secured, log in to MariaDB shell:
mysql -u root -p
Enter your root password then create a database and user for Fork CMS:
MariaDB [(none)]> CREATE DATABASE forkcmsdb;
MariaDB [(none)]> CREATE USER 'forkcms'@'localhost' IDENTIFIED BY 'password';
Next, grant privileges to the Fork CMS database with the following command:
MariaDB [(none)]> GRANT ALL PRIVILEGES ON forkcmsdb.* TO 'forkcms'@'localhost';
Next, run the FLUSH PRIVILEGES command so that the privileges table will be reloaded by MariaDB:
MariaDB [(none)]> FLUSH PRIVILEGES;
Finally, exit from the MariaDB shell:
MariaDB [(none)]> EXIT
Install Fork CMS
First, download the latest version of the Fork CMS from their official website using the following command:
cd /var/www/html/
wget https://www.fork-cms.com/frontend/files/releases/forkcms-5.2.3.tar.gz
Next, extract the downloaded file with the following command:
tar -xvzf forkcms-5.2.3.tar.gz
Next, change the ownership of forkcms directory:
sudo chown -R www-data:www-data /var/www/html/forkcms/
sudo chmod -R 755 /var/www/html/forkcms/
Next, create an apache virtual host file for Fork CMS:
sudo nano /etc/apache2/sites-available/forkcms.conf
Add the following lines:
<VirtualHost *:80> ServerAdmin [email protected] DocumentRoot /var/www/html/forkcms ServerName example.com ServerAlias www.example.com <Directory /var/www/html/forkcms/> Options FollowSymlinks AllowOverride All Require all granted </Directory> ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost>
Save and close the file, when you are finished.
Next, enable apache virtual host file and rewrite module with the following command:
sudo a2ensite forkcms.conf
sudo a2enmod rewrite
Finally, restart Apache service to apply all the changes:
sudo systemctl restart apache2
Access ForkCMS
Now, open your web browser and type the URL http://example.com. You will be redirected to the following page:
Here, select the language as you wish, then click on the Next button. You should see the following page:
Here, select the module you want install, then click on the Next button. You should see the following page:
Here, provide your database details, then click on the Next button. You should see the following page:
Here, provide your admin email address, username and password, then click on the Finish Installation button. You should see the following page:
Now, click on the Log In To Fork CMS button. You should see the Fork CMS log in screen in the following page:
Now, provide your admin username and password, then click on the Log In button. You will be redirected to the Fork CMS dashboard as shown in the following image: