Introduction
Fuel CMS (Content Management System) is an open-source platform for creating websites and cloud-based applications. Fuel CMS is built with the CodeIgniter framework and designed to work with an existing LAMP stack installation. You can switch between the WYSIWYG editor and HTML editor when authoring content, according to your needs. Fuel CMS supports multiple languages and has an active online community.
In this guide, you'll install and configure the Fuel CMS package with a LAMP stack on Ubuntu 20.04 server.
Prerequisites
To complete this tutorial, you need:
- An Ubuntu 20.04 server.
- A sudo user.
- A Lamp Stack.
1. Configure Apache and Install Dependencies
Connect to your server with SSH as your non-root sudo user for the following steps.
Enable the Apache mod_rewrite module, which allows Fuel CMS to create human-readable URLs.
$ sudo a2enmod rewriteInstall the libapache2-mod-php module.
$ sudo apt install -y libapache2-mod-phpRestart Apache to load the new configuration.
$ sudo systemctl restart apache2Install unzip, which you need to extract the installation archives.
$ sudo apt install unzip
2. Create a Database and User Account
Fuel CMS requires either MySQL or MariaDB for data storage.
Log in to your database server as root.
$ sudo mysql -u root -pEnter your root password and press Enter to log in.
Create a fuel_cms database and fuel_cms_user user account. Replace EXAMPLE_PASSWORD with a strong value.
Use the steps for your database engine.
If you use MySQL:
mysql> CREATE DATABASE fuel_cms; CREATE USER 'fuel_cms_user'@'localhost' IDENTIFIED WITH mysql_native_password BY 'EXAMPLE_PASSWORD'; GRANT ALL PRIVILEGES ON fuel_cms.* TO 'fuel_cms_user'@'localhost'; FLUSH PRIVILEGES;If you use MariaDB:
MariaDB> CREATE DATABASE fuel_cms; GRANT ALL PRIVILEGES on fuel_cms.* TO 'fuel_cms_user'@'localhost' identified by 'EXAMPLE_PASSWORD';Exit the database command-line interface.
mysql> EXIT;
3. Download Fuel CMS
Create a new fuel_cms directory under the root of your web server.
$ sudo mkdir -p /var/www/fuel_cmsTake ownership of the new directory.
$ sudo chown -R $USER:$USER /var/www/fuel_cmsChange to the new directory.
$ cd /var/www/fuel_cmsDownload the Fuel CMS installation files from GitHub.
$ wget https://github.com/daylightstudio/FUEL-CMS/archive/master.zipUnzip the installation archive.
$ unzip master.zipMove the extracted files to
/var/www/fuel_cms.$ mv /var/www/fuel_cms/FUEL-CMS-master/* /var/www/fuel_cms/Remove master.zip and the FUEL-CMS-master directory.
$ rm master.zip $ rm -rf FUEL-CMS-master
4. Configure Fuel CMS
Edit the database configuration.
$ sudo nano /var/www/fuel_cms/fuel/application/config/database.phpLocate the
$db['default']section. Edit the username, password, and database values as shown. ReplaceEXAMPLE_PASSWORDwith the password you created in section 2.$db['default'] = array( 'dsn' => '', 'hostname' => 'localhost', 'username' => 'fuel_cms_user', 'password' => 'EXAMPLE_PASSWORD', 'database' => 'fuel_cms', 'dbdriver' => 'mysqli', );Save and exit the file.
Initialize the fuel_cms database.
$ mysql -u fuel_cms_user -p fuel_cms < /var/www/fuel_cms/fuel/install/fuel_schema.sqlWhen prompted, enter the MySQL password for the
fuel_cms_useraccount and press Enter to run the SQL.Create a strong random encryption key for Fuel CMS.
$ openssl rand -base64 20The key looks similar to:
S8t207l6l3p1TGShxtKJX1Yn0k4=Copy the key to your clipboard.
Edit the Fuel CMS configuration file.
$ sudo nano /var/www/fuel_cms/fuel/application/config/config.phpLocate the
$config['encryption_key']section and enter your random encryption key as the value. When finished, it should look like this, except with your unique random key.$config['encryption_key'] = 'S8t207l6l3p1TGShxtKJX1Yn0k4=';Save and exit the file.
Edit
MY_fuel.php.$ sudo nano /var/www/fuel_cms/fuel/application/config/MY_fuel.phpFind the
$config['admin_enabled']section and change the value fromFALSEtoTRUEas shown.$config['admin_enabled'] = TRUE;Fuel CMS uses the Apache mod_rewrite module and .htaccess directives to create user-friendly URLs. Create a new .htaccess file in the
/var/www/fuel_cms/fuel/directory.$ sudo nano /var/www/fuel_cms/fuel/.htaccessEnter the settings below to make the URLs shorter and cleaner.
<IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule .* index.php/$0 [L] </IfModule>Save and close the file.
Give www-data ownership of the fuel_cms directory.
$ sudo chown -R www-data:www-data /var/www/fuel_cms
5. Create a Virtual Host for Fuel CMS
Disable the default Apache virtual host.
$ sudo a2dissite 000-default.confCreate a new
fuel_cms.confApache configuration file.$ sudo nano /etc/apache2/sites-available/fuel_cms.confPaste the following information. Replace example.com with the server's domain name or public IP address.
<VirtualHost *:80> ServerName example.com DocumentRoot "/var/www/fuel_cms" <Directory "/var/www/fuel_cms"> Require all granted Options Indexes FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory> ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost>Save and close the file.
Enable the new configuration file.
$ sudo a2ensite fuel_cms.confRestart Apache to load the new virtual host.
$ sudo systemctl restart apache2
6. Test the Installation
Visit your server's domain name or public IP address. For example, if your server's domain name is example.com, navigate to http://example.com.
You should see the welcome page. To access the administration page, append /fuel to the URL, like: http://example.com/fuel.