BoltWire CMS is a lightweight content management system built on the popular PHP framework. It is perfect for small businesses that want to maintain their own websites without having to learn HTML or other programming languages. With advanced features such as robust wiki markups, e-commerce capabilities, photo gallery and album builders, audio galleries and players, and guestbooks, BoltWire CMS offers a comprehensive solution for managing website content.
In this article, we will guide you through the installation process of BoltWire CMS on Ubuntu 20.04 LTS with Nginx as the web server. Before we proceed, let’s ensure that we have all the prerequisites in place.
Prerequisites
Before we begin the installation, make sure you have the following:
- A fresh server running Ubuntu 20.04.
- Full SSH root access or a user with sudo privileges.
- A registered domain name pointing to your server.
Now that we have the prerequisites in place, let’s get started with the installation process.
Getting Started
First, log in to your Ubuntu server using SSH. Open your terminal and enter the following command:
ssh shapehost@your_server_ip_address
Replace your_server_ip_address
with the actual IP address of your server.
Next, update your system to ensure that you have the latest packages installed. Run the following command:
sudo apt update && sudo apt upgrade -y
This command will update all the packages on your server. The -y
flag is used to automatically answer “Yes” to all prompts during the update process. It may take some time depending on the number of packages that need to be downloaded and installed.
Once the update is complete, you will be prompted to reboot your server. Run the following command to reboot:
sudo reboot
After the server reboots, log in again using SSH.
Installing Required Packages
BoltWire CMS requires several packages to be installed on your system. We will install these packages in a specific order. Run the following command to install the required packages:
sudo apt install -y curl wget vim git unzip socat bash-completion apt-transport-https
Here is a brief explanation of each package:
curl
andwget
are used for downloading packages and files.vim
is a text editor that we will use to edit configuration files.git
is a version control system that will be used to clone the BoltWire CMS repository.unzip
is required to extract zip files.socat
is used for proxying, which allows BoltWire CMS to appear as if it is running on your web server.bash-completion
enables bash to autocomplete commands after typing the first few characters.apt-transport-https
allows command-line operations likesudo apt update
to work with https connections.
The installation process may take some time, depending on your network speed.
Installing Nginx
Nginx will be used as a reverse proxy for managing your BoltWire CMS websites. It is lightweight, easy to configure, and fast. Run the following command to install Nginx:
sudo apt-get install nginx
If prompted, type ‘y’ to confirm the installation. Once the installation is complete, start the Nginx service and enable it to run on system startup:
sudo systemctl start nginx sudo systemctl enable nginx
To verify whether Nginx is running, use the following command:
sudo systemctl status nginx
If Nginx is running properly, you will see a status message indicating that the service is active and running.
Configuring Nginx
Now that Nginx is installed, we need to configure it to work with BoltWire CMS. We will create a new configuration file and populate it with the necessary settings.
Run the following command to create a new configuration file called bolt.conf
:
sudo nano /etc/nginx/sites-available/bolt.conf
This command will open the Nano text editor with the new configuration file. Paste the following content into the file:
server { listen 80; listen [::]:80; root /var/www/bolt; index index.php index.html index.htm; server_name bolt.example.com; location / { try_files $uri $uri/ /index.php?$query_string; } location ~ [^/]\\.php(/|$) { try_files /index.php =404; fastcgi_split_path_info ^(.+\\.php)(/.+)$; fastcgi_index index.php; fastcgi_pass unix:/var/run/php/php7.2-fpm.sock; include fastcgi_params; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } location = /bolt { try_files $uri /index.php?$query_string; } location ^~ /bolt/ { try_files $uri /index.php?$query_string; } }
Make sure to replace bolt.example.com
with your actual server domain name or IP address. Save the file and exit the text editor.
Next, reload Nginx to apply the new configuration:
sudo systemctl reload nginx
Now, let’s check the Nginx configuration for any syntax errors:
sudo nginx -t
If there are no errors, you should see a message indicating that the configuration file is valid.
Installing MySQL
BoltWire CMS requires MySQL server version 4.2 or higher. Fortunately, Ubuntu already includes MySQL in its repository, so we can install it easily.
Run the following command to install MySQL:
sudo apt -y install mysql-server
During the installation process, you will be prompted to set a password for the MySQL root user. Enter a secure password and remember it, as you will need it later.
After the installation is complete, start the MySQL service and enable it to run on system startup:
sudo systemctl start mysql sudo systemctl enable mysql
Creating a Database
Now that MySQL is installed, we need to create a database for BoltWire CMS.
Connect to MySQL using the following command:
sudo mysql -u root -p
Replace root
with the appropriate username if you are using a different one.
Enter the MySQL root password that you set during the installation process. You should now be logged into the MySQL console.
Run the following commands to create a database and a database user:
CREATE DATABASE bolt; CREATE USER 'bolt'@'localhost' IDENTIFIED BY 'mypassword'; GRANT ALL ON bolt.* TO 'bolt'@'localhost'; FLUSH PRIVILEGES; exit
Replace 'mypassword'
with a secure password of your choice. The GRANT ALL
command gives the user full privileges on the bolt
database.
Installing PHP
BoltWire CMS requires PHP version 7 or higher, along with some additional PHP extensions. We will install PHP 7.2, but you can change the version if needed.
Run the following commands to add the required PHP repository and update the package list:
sudo apt -y install software-properties-common sudo add-apt-repository ppa:ondrej/php sudo apt-get update
Next, install PHP 7.2 and the necessary extensions:
sudo apt install -y php7.2 php7.2-cli php7.2-fpm php7.2-common php7.2-mbstring php7.2-zip php7.2-pgsql php7.2-sqlite3 php7.2-curl php7.2-gd php7.2-mysql php7.2-intl php7.2-json php7.2-opcache php7.2-xml
These commands will install PHP 7.2 and all the required extensions. Once the installation is complete, check the PHP version:
php -v
You should see a message displaying the PHP version.
Next, open the PHP default configuration file for Nginx using the nano text editor:
sudo nano /etc/php/7.2/fpm/php.ini
In this file, we need to make some changes. Locate the following lines and modify them as shown:
file_uploads = On allow_url_fopen = On memory_limit = 256M upload_max_filesize = 100M max_execution_time = 360 date.timezone = America/St. Louis
Here is an explanation of each line:
file_uploads = On
enables file uploads feature in BoltWire CMS.allow_url_fopen = On
allows direct URLs or HTTP redirects on requests with uploaded files from the remote web server.memory_limit = 256M
sets the PHP memory limit to 256 megabytes. You can adjust this value according to your needs.upload_max_filesize = 100M
sets the maximum size for a single uploaded file in BoltWire CMS. You can change this value to fit your requirements.max_execution_time = 360
sets the maximum execution time for PHP scripts to 360 seconds. If a script exceeds this limit, it will be terminated.date.timezone = America/St. Louis
sets the time zone to your location, ensuring that date and time values are displayed correctly in BoltWire CMS.
Save the changes and exit the text editor.
Restart the PHP-FPM service to apply the changes:
sudo service php7.2-fpm restart
Installing Composer
BoltWire CMS requires Composer, a package manager for PHP, to manage its dependencies. We need to install Composer before proceeding with the BoltWire installation.
Move to the home directory and download the Composer installer:
cd ~ sudo curl -sS https://getcomposer.org/installer -o composer-setup.php
Next, install Composer system-wide:
sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer
This command downloads and installs Composer in the /usr/local/bin
directory.
To test if the installation was successful, run the following command:
composer
You should see the Composer logo and version information.
Installing Bolt
Now that we have all the necessary packages installed, we can proceed with the BoltWire CMS installation.
Move into the /var/www
directory and clone the latest version of Bolt CMS from GitHub:
cd /var/www sudo git clone https://github.com/bolt/bolt.git
Once the download is complete, you will see a directory named bolt
containing the Bolt CMS files.
Move into the bolt
directory and install Bolt using Composer:
cd bolt sudo composer install
This command installs all the required Bolt source files and dependencies in the /var/www/bolt
directory using Composer.
Next, set the correct permissions for the Bolt files:
sudo chown -R www-data:www-data /var/www/bolt sudo chmod -R 755 /var/www/bolt
These commands change the ownership of the Bolt files to the Nginx user, www-data
, and set the appropriate permissions for reading and executing the files.
Now let’s configure the Bolt CMS:
sudo cp app/config/config.yml.dist app/config/config.yml
This command creates a configuration file based on the provided template.
Accessing BoltWire CMS
Congratulations! You have successfully installed BoltWire CMS on your Ubuntu 20.04 server with Nginx. Now, let’s access the BoltWire CMS dashboard.
Open your web browser and enter the following URL:
http://your_server_ip_address/bolt
Replace your_server_ip_address
with the actual IP address or domain name of your server.
You should see the BoltWire CMS login page. Fill in the required information to log in and access the BoltWire CMS dashboard.
If you encounter any issues accessing your newly installed BoltWire CMS, here are some common errors and possible solutions:
- “Access Denied – error”: This error indicates that BoltWire CMS is running, but you cannot access its pages from the browser. Check your Nginx configuration directory for any misconfigurations.
- “Cannot load dynamic library ‘/var/www/BoltWire/vendor/php72-zip/libphp7.2.so” or “Error Executing The Script”: These errors occur when BoltWire CMS does not have the necessary permissions to execute PHP files. Check the file permissions and ensure that they are set correctly.
- “Error initializing… No such file or directory”: This error suggests that BoltWire CMS is not installed properly. Double-check the installation steps to ensure that you followed the correct procedure.
- “Permission Denied”: If you receive this error, it means you don’t have proper access to the
/var/www/bolt
or/var/www
directory. Check the file permissions and adjust them accordingly. - “Fatal error: Class ‘PDO’ not found in…”: This error indicates that PHP is unable to connect to the database. Verify your PHP configuration and ensure that the necessary PHP extensions are installed.
- “Looking for…” or “Warning: Invalid argument supplied for foreach()…”: These errors occur when BoltWire CMS cannot find the specified files or directories. Double-check your BoltWire configuration and make sure you have specified the correct paths.
- “Unable to create directory… Undefined index: viewed data”: This error suggests that BoltWire CMS is unable to create its directory on your Nginx server. Check your PHP configuration and ensure that the necessary directories have proper write permissions.
- “Parse error: syntax error, unexpected ‘=’ in… at…”: This error indicates a syntax error in one of the BoltWire CMS files. Review your configuration files and make sure there are no syntax errors.
- “404 Not Found” or “The requested URL… was not found on this server”: These errors occur when BoltWire CMS cannot find its files. Check your BoltWire configuration and ensure that you have specified the correct paths.
In conclusion, BoltWire CMS is a powerful and user-friendly content management system that allows you to easily create and manage websites. By following the steps outlined in this article, you should be able to install BoltWire CMS on your Ubuntu 20.04 server with Nginx. If you encounter any issues during the installation process, refer to the troubleshooting section or consult the BoltWire CMS documentation for further assistance.
By using Shape.host’s Linux SSD VPS services, you can ensure a secure and reliable hosting environment for your BoltWire CMS website. Shape.host offers scalable and efficient cloud hosting solutions, empowering businesses with fast and secure hosting options. Visit Shape.host to learn more about their services and how they can help you optimize your online presence.