Install GrandCMS on Ubuntu 20.04
Introduction
GrandCMS is a free and open-source Content Management System (CMS) that provides a solution to create your website at no cost. It's based on OpenCart core with a responsive, fast, and easy-to-use administrator interface to manage your sites. It's recommended for OpenCart users as most of the features align with OpenCart's features. Some of these features are:
- Support Search Engine Optimization.
- Error Logging and reporting.
- Backup & Restore Tools.
- Support multiple languages.
- Automatic Image Resizing.
This article explains how to install GrandCMS on Ubuntu 20.04.
Prerequisites
- Deploy a fully updated Vultr Ubuntu 20.04 Server.
- Create a non-root user with sudo access.
1. Install Required Packages
Update system package list.
$ sudo apt update
Add ppa:ondrej/php PPA repository.
$ sudo apt -y install software-properties-common $ sudo add-apt-repository ppa:ondrej/php
Update system package manager.
$ sudo apt update
Install PHP 7.1, Apache, MySQL, and more modules.
$ sudo apt install apache2 mysql-server php7.1 libapache2-mod-php7.1 php7.1-json php7.1-common php7.1-gmp php7.1-curl php7.1-mysql php7.1-mysqli php7.1-mcrypt php7.1-opcache php7.1-intl php7.1-fpm php7.1-xmlrpc php7.1-bcmath php7.1-zip php7.1-imagick php7.1-mbstring php7.1-gd php7.1-cli php7.1-xml php7.1-zip wget unzip curl -y
Enable the web server to start automatically on a reboot.
$ sudo systemctl enable apache2
Enable the database server to start automatically on a reboot.
$ sudo systemctl enable mysql
2. Create GrandCMS Database
Run
mysql_secure installation
script to secure MySQL database server from security breaches.$ sudo mysql_secure_installation
When prompted, answer the questions as shown below:
- Setup VALIDATE PASSWORD plugin? Press N, then Enter.
- Remove anonymous users? Press Y, then Enter.
- Disallow root login remotely? Press Y, then Enter.
- Remove test database and access to it? Press Y, then Enter.
- Reload privilege tables now? Press Y, then Enter.
Log in to MySQL shell. At the password prompt, enter your password to continue.
$ sudo mysql -u root -p
Create a database called
grandcms
.CREATE DATABASE grandcms;
Create a
grandcmsuser
database user with a strong password.CREATE USER 'grandcmsuser'@'localhost' IDENTIFIED WITH mysql_native_password BY 'ReplaceThisWithAStrongPassword';
Grant the user full access to the database.
GRANT ALL ON grandcms.* TO 'grandcmsuser'@'localhost' WITH GRANT OPTION;
Save the changes made to the database.
FLUSH PRIVILEGES;
Exit MySQL shell.
exit;
3. Install GrandCMS.
Download the latest stable version of GrandCMS. Please visit the download page to find the versions available.
$ wget http://downloads.sourceforge.net/project/grandcms/grandcms_v0.2.0.1.1.zip
Create the installation directory
/var/www/html/grandcms
.$ sudo mkdir /var/www/html/grandcms
Extract the downloaded archive.
$ sudo unzip grandcms_v0.2.0.1.1.zip
Move the project files to the installation directory.
$ sudo mv upload/* /var/www/html/grandcms
Rename the configuration files.
$ sudo mv /var/www/html/grandcms/config-dist.php /var/www/html/grandcms/config.php $ sudo mv /var/www/html/grandcms/admin/config-dist.php /var/www/html/grandcms/admin/config.php
Change ownership of the installation directory.
$ sudo chown -R www-data:www-data /var/www/html/grandcms
Change access permissions for the directory.
$ sudo chmod -R 755 /var/www/html/grandcms
4. Configure Apache2
Create a new Apache configuration file named
grandcms.conf
.$ sudo nano /etc/apache2/sites-available/grandcms.conf
Add the following lines of code to the file.
<VirtualHost *:80> ServerAdmin admin@example.com DocumentRoot /var/www/html/grandcms/ ServerName example.com ServerAlias www.example.com <Directory /var/www/html/grandcms/> Options FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory> ErrorLog /var/log/apache2/example.com-error_log CustomLog /var/log/apache2/example.com-access_log common </VirtualHost>
Save and close the file.
Enable the new Apache configuration file.
$ sudo a2ensite grandcms.conf
Disable Apache default configuration file.
$ sudo a2dissite 000-default.conf
Enable Apache rewrite mode.
$ sudo a2enmod rewrite
Restart Apache service.
$ sudo systemctl restart apache2
5. Access GrandCMS
To access the GrandCMS Web Interface, go to your browser and visit
http://Server_IP/
. For example:http://192.0.2.10/
Delete the installation folder.
$ sudo rm -r /var/www/html/grandcms/install
Conclusion
You have installed GrandCMS on your Ubuntu 20.04 server. Access the Installation Wizard screen to complete installation by connecting to your database and creating an administrator account. Log in with the username and password you created during the installation process. You can now access the Dashboard and begin to manage your online websites. Make sure you delete the installation folder after completing the installation process.
More Information
To learn more about using GrandCMS, go to the official documentation page.