{"id":6914,"date":"2018-09-24T20:39:27","date_gmt":"2018-09-24T17:39:27","guid":{"rendered":"https:\/\/www.howtoforge.com\/tutorial\/install-bolt-cms-in-debian-9\/"},"modified":"2018-09-24T20:39:27","modified_gmt":"2018-09-24T17:39:27","slug":"how-to-install-bolt-cms-on-debian-9","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/how-to-install-bolt-cms-on-debian-9\/","title":{"rendered":"How to Install Bolt CMS on Debian 9"},"content":{"rendered":"<p>Bolt CMS is a simple and flexible open source Content Management System that is written in PHP programming language and can be successfully deployed in Linux under Apache\/Nginx web servers, PHP and MySQL\/MariaDB database management system, also known as LAMP or LEMP stack.<\/p>\n<p>In this tutorial, we\u2019ll learn how to install and configure the latest Bolt CMS\u00a0version in the Debian 9 release, on top of a LAMP stack, in order to create dynamic websites.<\/p>\n<p>With Bolt CMS, you can create and design beautiful and modern dynamic portals with the latest markup languages and source libraries.<\/p>\n<h2 id=\"requirements\">Requirements<\/h2>\n<p>In order to deploy a Bolt CMS website at your premises, you need to assure that some of the following requirements are met:<\/p>\n<ul>\n<li><span\/>You need a dedicated physical server or a virtual machine or a VPS from a cloud provider with the latest version of Debian 9 minimal installation.<\/li>\n<li><span\/>A static IP address configured for one of your system network interfaces cards<\/li>\n<li><span\/>Remote or direct access to root account or to a local or remote account with sudo root privileges<\/li>\n<li><span\/>A properly configured domain name, private or public, depending on your deployment, with the required DNS records, such as a A and CNAME records to point back to www. If you don\u2019t have a valid or a registered domain name you can perform the installation and access the website via your server IP address<\/li>\n<li><span\/>In order to use Bolt CMS email registration or other CMS features, you should configure a mail server at your premises (IMAP and SMTP services), although for that matter a public mail server, such as Gmail or Yahoo! can be used to achieve the same goal.<\/li>\n<\/ul>\n<h2 id=\"prerequirements\">Pre-Requirements<\/h2>\n<p>In the first step, log in to your Debian server with root account or with an account with root privileges gained via sudo utility and install utilities such as zip, unzip (to decompress zip archives), curl and wget (download online files) and bash-completion command line auto-completer. Issue the following commands in order to install all these utilities in one-shot.<\/p>\n<p class=\"command\">su &#8211;<\/p>\n<p class=\"command\">apt install bash-completion zip unzip curl wget<\/p>\n<p>In the next step, configure a descriptive name for your machine to reflect the destination of this server by executing the following command. Replace your hostname variable accordingly.<\/p>\n<p class=\"command\">hostnamectl set-hostname www.myblog.com<\/p>\n<p>You can check the machine hostname and the record in system hosts file by issuing the below commands.<\/p>\n<p class=\"command\">hostnamectl<\/p>\n<p class=\"command\">cat \/etc\/hostname<\/p>\n<p class=\"command\">hostname \u2013s<\/p>\n<p class=\"command\">hostname \u2013f<\/p>\n<p>Before rebooting the server, first assure the system is up-to-date with the latest security patches, kernel updates, repositories and software packages by issuing the following command.<\/p>\n<p class=\"command\">apt update<\/p>\n<p class=\"command\">apt upgrade<\/p>\n<p>After the update process completes, reboot your Debian machine in order to apply all kernel updates and the hostname changes properly.<\/p>\n<p class=\"command\">systemctl reboot<\/p>\n<h2 id=\"install-apache-and-php\">Install Apache and PHP<\/h2>\n<p>As said in the introduction, Bolt CMS is a web-based content management platform that is written in PHP server-side programming language and must be deployed on top of a LAMP stack. First, we\u2019ll start by installing Apache HTTP server and the PHP interpreter alongside some required PHP extensions that are required by Bolt CMS to properly run. To install the web server component and the PHP programming language with all required modules, issue the following command in your server console with root privileges.<\/p>\n<p class=\"command\">apt install apache2 libapache2-mod-php7.0 php7.0 php7.0-gd php7.0-opcache php7.0-json php7.0-mbstring php7.0-xml php7.0-cli php7.0-curl php7.0-zip php7.0-bcmath php-imagick php7.0-xmlrpc php7.0-intl<\/p>\n<p>Next, check if all installed PHP modules are enabled in your system by executing the following command.<\/p>\n<p class=\"command\">php7.0 \u2013m<\/p>\n<h2 id=\"install-mariadb\">Install MariaDB<\/h2>\n<p>The next component that is missing is the RDBMS database. In this tutorial, we\u2019ll install Bolt CMS with MariaDB database server as backend. Bolt CMS web application uses MariaDB database to store different website configurations, users, sessions and other various data. To install MariaDB database server and client and the PHP MySQL extension in Debian 9, issue the below command in your server console.<\/p>\n<p class=\"command\">apt install mariadb-server mariadb-client php7.0-mysql<\/p>\n<p>After MariaDB installation completes, check if the database daemon is up and running in your machine and listens for incoming connections on localhost, port 3306, by running <strong><b>netstat<\/b><\/strong> or <strong><b>ss<\/b><\/strong> command.<\/p>\n<p class=\"command\">netstat \u2013tlpn | grep mysql<\/p>\n<p>Or<\/p>\n<p class=\"command\">ss \u2013tlpn | grep mysql<\/p>\n<p>If <strong><b>netstat<\/b><\/strong> network utility is not install by default in your Debian system, execute the following command to install it.<\/p>\n<p class=\"command\">apt install net-tools<\/p>\n<p>By default, MySQL database server is not sufficiently secured in Debian 9. The database root account can be accessed by supplying a password. To secure the database server, first log in to MySQL console and execute the below commands to secure MariaDB root account.<\/p>\n<p class=\"command\">mysql -h localhost<\/p>\n<pre readability=\"14\">Welcome to the MariaDB monitor. Commands end with ; or \\g.<p>Your MariaDB connection id is 2<\/p><p>Server version: 10.1.26-MariaDB-0+deb9u1 Debian 9.1<\/p><p>Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.<\/p><p>Type 'help;' or '\\h' for help. Type '\\c' to clear the current input statement.<\/p><\/pre>\n<p class=\"command\"><em><i>MariaDB [(none)]&gt; <\/i><\/em>use mysql;<\/p>\n<pre readability=\"5\">Reading table information for completion of table and column names<p>You can turn off this feature to get a quicker startup with -A<\/p><p>Database change<\/p><\/pre>\n<p class=\"command\"><em><i>MariaDB [mysql]&gt; <\/i><\/em>update user set plugin=&#8221; where user=&#8217;root&#8217;;<\/p>\n<pre readability=\"5\">Query OK, 1 row affected (0.00 sec)<p>Rows matched: 1 Changed: 1 Warnings: 0<\/p><\/pre>\n<p class=\"command\">MariaDB [mysql]&gt; flush privileges;<\/p>\n<pre><em><i>Query OK, 0 rows affected (0.00 sec)<\/i><\/em><\/pre>\n<p class=\"command\">MariaDB [mysql]&gt; exit<\/p>\n<pre><em><i>Bye<\/i><\/em><\/pre>\n<p>After we\u2019ve enforced the database root account to use a password, further secure MariaDB server by executing the script <strong><b>mysql_secure_installation<\/b><\/strong> provided by the installation packages from Debian stretch repositories. While running the script will ask a series of questions designed to secure MariaDB database, such as: to change MySQL root password, to remove anonymous users, to disable remote root logins and delete the test database. Execute the script by issuing the below command and setup a strong password for database root account and assure you type <strong><em><b><i>yes<\/i><\/b><\/em><\/strong> to all questions asked, as shown in the below excerpt.<\/p>\n<p class=\"command\">mysql_secure_installation<\/p>\n<pre readability=\"83\">NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB<p>SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!<\/p><p>In order to log into MariaDB to secure it, we'll need the current<\/p><p>password for the root user. If you've just installed MariaDB, and<\/p><p>you haven't set the root password yet, the password will be blank,<\/p><p>so you should just press enter here.<\/p><p>Enter current password for root (enter for none):<\/p><p>OK, successfully used password, moving on...<\/p><p>Setting the root password ensures that nobody can log into the MariaDB<\/p><p>root user without the proper authorisation.<\/p><p>You already have a root password set, so you can safely answer 'n'.<\/p><p>Change the root password? [Y\/n] y<\/p><p>New password:<\/p><p>Re-enter new password:<\/p><p>Password updated successfully!<\/p><p>Reloading privilege tables..<\/p><p>... Success!<\/p><p>By default, a MariaDB installation has an anonymous user, allowing anyone<\/p><p>to log into MariaDB without having to have a user account created for<\/p><p>them. This is intended only for testing, and to make the installation<\/p><p>go a bit smoother. You should remove them before moving into a<\/p><p>production environment.<\/p><p>Remove anonymous users? [Y\/n] y<\/p><p>... Success!<\/p><p>Normally, root should only be allowed to connect from 'localhost'. This<\/p><p>ensures that someone cannot guess at the root password from the network.<\/p><p>Disallow root login remotely? [Y\/n] y<\/p><p>... Success!<\/p><p>By default, MariaDB comes with a database named 'test' that anyone can<\/p><p>access. This is also intended only for testing, and should be removed<\/p><p>before moving into a production environment.<\/p><p>Remove test database and access to it? [Y\/n] y<\/p><p>- Dropping test database...<\/p><p>... Success!<\/p><p>- Removing privileges on test database...<\/p><p>... Success!<\/p><p>Reloading the privilege tables will ensure that all changes made so far<\/p><p>will take effect immediately.<\/p><p>Reload privilege tables now? [Y\/n] y<\/p><p>... Success!<\/p><p>Cleaning up...<\/p><p>All done! If you've completed all of the above steps, your MariaDB<\/p><p>installation should now be secure.<\/p><p>Thanks for using MariaDB!<\/p><\/pre>\n<p>After the script completes, log in to the database from console with no root password. The access to the database should be denied if no password is provided for the root account, as illustrated in the below command excerpt:<\/p>\n<p class=\"command\">mysql -h localhost -u root<\/p>\n<pre><em><i>ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)<\/i><\/em><\/pre>\n<p>If the password is supplied, the login process should be granted to MySQL console, as shown in the command sample. Type exit to leave the database console.<\/p>\n<p class=\"command\">mysql -h localhost -u root -p<\/p>\n<pre readability=\"16\">Enter password:<p>Welcome to the MariaDB monitor. Commands end with ; or \\g.<\/p><p>Your MariaDB connection id is 15<\/p><p>Server version: 10.1.26-MariaDB-0+deb9u1 Debian 9.1<\/p><p>Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.<\/p><p>Type 'help;' or '\\h' for help. Type '\\c' to clear the current input statement.<\/p><\/pre>\n<p class=\"command\"><em><i>MariaDB [(none)]&gt; <\/i><\/em><em><i>exit<\/i><\/em><\/p>\n<pre><em><i>Bye<\/i><\/em><\/pre>\n<p>After all LAMP components have been installed, test if the web server is up and running and listening for network connections on port 80 by issuing the following command with root privileges.<\/p>\n<p class=\"command\">netstat \u2013tlpn<\/p>\n<p><strong><b> <\/b><\/strong>By inspecting the netstat command output you can see that the Apache web server is listening for incoming network connections on port 80. For the same task you can also use the <strong><b>ss<\/b><\/strong> command, which is automatically installed, by default, in Debian 9.<\/p>\n<p class=\"command\">ss- tulpn<\/p>\n<h2 id=\"configure-the-firewall\">Configure the Firewall<\/h2>\n<p>In case you have a firewall enabled in your system, such as UFW firewall application, you should add a new rule to allow HTTP traffic to pass through firewall by issuing the following command.<\/p>\n<p class=\"command\">ufw allow WWW<\/p>\n<p>or<\/p>\n<p class=\"command\">ufw allow 80\/tcp<\/p>\n<p><strong><b> <\/b><\/strong>You should also allow SSH traffic to pass through UFW firewall in case of remote connections to the server.<\/p>\n<p class=\"command\">ufw allow 22\/tcp<\/p>\n<p><strong><b> <\/b><\/strong><strong\/>Some system administrators prefer to use <strong><b>iptables<\/b><\/strong> raw rules to manage Firewall rules in your Debian server. If that\u2019s the case, you need to add the following rules to allow port 80 inbound traffic on the firewall so that other visitors can browse the your website.<\/p>\n<p class=\"command\">apt-get install -y iptables-persistent<\/p>\n<p class=\"command\">iptables -I INPUT -p tcp &#8211;destination-port 80 -j ACCEPT<\/p>\n<p class=\"command\">netfilter-persistent save<\/p>\n<p class=\"command\">systemctl restart netfilter-persistent<\/p>\n<p class=\"command\">systemctl status netfilter-persistent<\/p>\n<p class=\"command\">systemctl enable netfilter-persistent.service<\/p>\n<p><strong><b> <\/b><\/strong>In case you\u2019re connected to Debian server remotely via SSH, you should first add the following rule to allow SSH traffic to pass through iptables firewall. Otherwise you will be locked-up, because the firewall will start dropping all incoming traffic to port 22.<\/p>\n<p class=\"command\">iptables -I INPUT -p tcp &#8211;destination-port 22 -j ACCEPT<\/p>\n<p class=\"command\">netfilter-persistent save<\/p>\n<p class=\"command\">systemctl restart netfilter-persistent<\/p>\n<p>After you\u2019ve added the required firewall rules, you should test if Apache web server is reachable in your network, by opening a browser and visiting your Debian machine IP address or your domain name or server FQDN via HTTP protocol. If incoming connections are allowed to port 80 the default web page should be displayed in your clients browsers. If you don\u2019t know your machine IP address, execute <strong><b>ifconfig<\/b><\/strong> or <strong><b>ip a<\/b><\/strong> command\u00a0to reveal the IP address of your server.<\/p>\n<p><em><strong><span>http:\/\/your_domain.tld<\/span><\/strong><\/em><\/p>\n<h2 id=\"configure-apache-and-php\">Configure Apache and PHP<\/h2>\n<p><strong\/>On the next step, we need to make some further changes to PHP default configuration file and modify the following PHP variables as described below. Also, make sure that the PHP <strong><b>timezone<\/b><\/strong> setting is correctly configured and matches your system geographical location. Open <strong><b>\/etc\/php\/7.0\/apache2\/php.ini<\/b><\/strong> file for editing after you initially, make a backup of PHP configuration file.<\/p>\n<p class=\"command\">cp \/etc\/php\/7.0\/apache2\/php.ini{,.backup}<\/p>\n<p class=\"command\">nano \/etc\/php\/7.0\/apache2\/php.ini<\/p>\n<p><strong><b> <\/b><\/strong>Search, edit and change the following variables in <strong><b>php.ini<\/b><\/strong> configuration file:<\/p>\n<pre>file_uploads = On<br\/>memory_limit = 128M<br\/>post_max_size = 80M<br\/>upload_max_filesize = 80M<br\/>default_charset = UTF-8<br\/>short_open_tag = off<br\/>intl.error_level = 0<br\/>magic_quotes_gpc =off<br\/>register_globals = off<br\/>session.auto_start = off<br\/>date.timezone = Europe\/London<\/pre>\n<p>Increase the <strong><b>upload_max_file_size<\/b><\/strong> variable as suitable to support large file attachments if that\u2019s the case and replace the <strong><em><b><i>date.timezone<\/i><\/b><\/em><\/strong> variable accordingly to your geographical time by consulting the list of time zones provided by PHP docs at the following link <span><a href=\"http:\/\/php.net\/manual\/en\/timezones.php\" target=\"_blank\" rel=\"noopener\"><span><span>http:\/\/php.net\/manual\/en\/timezones.php<\/span><\/span><\/a><\/span><\/p>\n<p>In order to increase the load speed of your website pages via OPCache plugin available for PHP7, append the following OPCache settings at the bottom of the PHP interpreter configuration file, below the <strong><em><b><i>[opcache]<\/i><\/b><\/em><\/strong> statement, as detailed here:<\/p>\n<p class=\"command\">nano \/etc\/php\/7.0\/apache2\/php.ini<\/p>\n<pre>[opcache]<br\/>opcache.enable=1 <br\/>opcache.enable_cli=1 <br\/>opcache.interned_strings_buffer=8 <br\/>opcache.max_accelerated_files=10000 <br\/>opcache.memory_consumption=128 <br\/>opcache.save_comments=1<br\/>opcache.revalidate_freq=1<\/pre>\n<p>After you\u2019ve modified all the lines described below, close the <strong><em><b><i>php.ini<\/i><\/b><\/em><\/strong> configuration file and check if the OPCache variables have been correctly added by issuing the below command.<\/p>\n<p class=\"command\">grep opcache \/etc\/php\/7.0\/apache2\/php.ini<\/p>\n<p>Next, we need to enable Apache rewrite and TLS modules in order to force the visitors to securely browse the website via HTTPS protocol. The TSL module will secure the traffic between the server and your client browsers with a Self-Signed Certificate automatically issued by Apache. You should also activate Apache SSL configuration file for TLS module to work properly. Execute the following command to activate all required configurations.<\/p>\n<p class=\"command\">a2enmod ssl rewrite<\/p>\n<p class=\"command\">a2ensite default-ssl.conf<\/p>\n<p>After we\u2019ve enabled rewrite and TLS modules, open Apache default SSL site configuration file with a text editor and add the URL rewrite rules code lines after <strong><em><b><i>DocumentRoot<\/i><\/b><\/em><\/strong> directive, as shown in the below sample. Also, change <strong><em><b><i>DocumentRoot <\/i><\/b><\/em><\/strong>path to <strong><em><b><i>\/var\/ww\/html\/public<\/i><\/b><\/em><\/strong>.<\/p>\n<p class=\"command\">nano \/etc\/apache2\/sites-enabled\/default-ssl.conf<\/p>\n<p>SSL site configuration file excerpt:<\/p>\n<pre>DocumentRoot \/var\/www\/html\/public<br\/>&lt;Directory \/var\/www\/html\/public&gt;<br\/>Options +FollowSymlinks<br\/>AllowOverride All<br\/>Require all granted<br\/>&lt;\/Directory&gt;<\/pre>\n<p>Close the SSL Apache file and also open <strong><b>\/etc\/apache2\/sites-enabled\/000-default.conf<\/b><\/strong> file for editing and add the same URL rewrite rules as for SSL configuration file. Insert the lines of code after <strong><b>DocumentRoot<\/b><\/strong> statement as shown in the below example. Also, modify <strong><em><b><i>DocumentRoot <\/i><\/b><\/em><\/strong>path to point to <strong><em><b><i>\/var\/ww\/html\/public <\/i><\/b><\/em><\/strong>directory.<\/p>\n<pre>DocumentRoot \/var\/www\/html\/public<br\/>&lt;Directory \/var\/www\/html\/public&gt;<br\/>Options +FollowSymlinks<br\/>AllowOverride All<br\/>Require all granted<br\/>&lt;\/Directory&gt;<\/pre>\n<p>After you\u2019ve made all changes explained above you need to restart Apache daemon to apply all rules.<\/p>\n<p class=\"command\">systemctl restart apache2<\/p>\n<p>Finally, open a browser and visit your domain name or IP address of the server via HTTP protocol. Because you\u2019re using the automatically Self-Signed certificates pairs issued by Apache at installation, a certificate that is untrusted by the browser, an error warning should be displayed in the browser. Accept the warning in order to accept the untrusted certificate and continue to be redirected to Apache default web page.<\/p>\n<p><strong><em><span>https:\/\/yourdomain.tld<\/span><\/em><b> <\/b><\/strong><\/p>\n<p><a class=\"fancybox\" id=\"img-Picture1\" href=\"https:\/\/www.howtoforge.com\/images\/install_bolt_cms_in_debian_9\/big\/Picture1.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/09\/how-to-install-bolt-cms-on-debian-9.png\" alt=\"Apache cert error\" width=\"550\" height=\"283\" title=\"\"><\/a><\/p>\n<p>If the UFW firewall application blocks incoming network connections to HTTPS port, insert a new rule to allow HTTPS traffic to pass through the firewall by issuing the following command.<\/p>\n<p class=\"command\">ufw allow \u2018WWW Full\u2019<\/p>\n<p>or<\/p>\n<p class=\"command\">ufw allow 443\/tcp<\/p>\n<p>If <em><i>iptables<\/i><\/em> is the default firewall application installed to protect your Debian system at the network level, add the following rule to allow port 443 inbound traffic in the firewall so that visitors can browse your domain name.<\/p>\n<p class=\"command\">iptables -I INPUT -p tcp &#8211;destination-port 443 -j ACCEPT<\/p>\n<p class=\"command\">netfilter-persistent save<\/p>\n<p class=\"command\">systemctl restart netfilter-persistent<\/p>\n<p>Finally, create a PHP info file in web server webroot path by executing the following command.<\/p>\n<p class=\"command\">echo &#8216;&lt;?php phpinfo(); ?&gt;&#8217;| tee \/var\/www\/html\/public\/info.php<\/p>\n<p>Visit the PHP info script file from a browser at the following URL, as illustrated in the below image. Scroll down to <strong><b>date<\/b><\/strong> setting to check PHP time zone configuration. The timezone settings should reflect your PHP geographical location configured earlier.<\/p>\n<p><em><strong><span>https:\/\/domain.tld\/info.php<\/span><\/strong><\/em><\/p>\n<p><span><span><span><a class=\"fancybox\" id=\"img-Picture2\" href=\"https:\/\/www.howtoforge.com\/images\/install_bolt_cms_in_debian_9\/big\/Picture2.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/09\/how-to-install-bolt-cms-on-debian-9-1.png\" alt=\"Date setting in PHP\" width=\"550\" height=\"265\" title=\"\"><\/a><\/span><\/span><\/span><\/p>\n<p>Next, login into MariaDB database console and create the Bolt CMS database and a user with a password that will be used to manage the website database from localhost, by issuing the following commands. Replace the database name, user and password accordingly.<\/p>\n<p class=\"command\">mysql \u2013u root -p<\/p>\n<pre readability=\"14\">Welcome to the MariaDB monitor. Commands end with ; or \\g.<p>Your MariaDB connection id is 305<\/p><p>Server version: 10.1.26-MariaDB-0+deb9u1 Debian 9.1<\/p><p>Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.<\/p><p>Type 'help;' or '\\h' for help. Type '\\c' to clear the current input statement.<\/p><\/pre>\n<p class=\"command\">MariaDB [(none)]&gt; CREATE DATABASE bolt_db;<\/p>\n<pre><em><i>Query OK, 1 row affected (0.00 sec)<\/i><\/em><\/pre>\n<p class=\"command\">MariaDB [(none)]&gt; grant all privileges on bolt_db.* to &#8216;bolt_user&#8217;@&#8217;localhost&#8217; identified by &#8216;password1234&#8217;;<\/p>\n<pre><em><i>Query OK, 0 rows affected (0.00 sec)<\/i><\/em><\/pre>\n<p class=\"command\">MariaDB [(none)]&gt; flush privileges;<\/p>\n<pre><em><i>Query OK, 0 rows affected (0.00 sec)<\/i><\/em><\/pre>\n<p class=\"command\">MariaDB [(none)]&gt; exit<\/p>\n<pre><em><i>Bye<\/i><\/em><\/pre>\n<h2 id=\"install-bolt-cms\">Install Bolt CMS<\/h2>\n<p>After all system requirements are met to install the Bolt CMS application, visit Bolt official download page at <span><a href=\"https:\/\/bolt.cm\/pages\/download\" target=\"_blank\" rel=\"noopener\"><span><span>https:\/\/bolt.cm\/pages\/download<\/span><\/span><\/a><\/span> and grab the latest zip compressed archive in your system by issuing the below command.<\/p>\n<p class=\"command\"><em><i>wget <\/i><\/em><span>https:\/\/bolt.cm\/distribution\/bolt-latest.zip<\/span><em><i> <\/i><\/em><\/p>\n<p>After the zip archive download finishes, extract Bolt CMS zip archive file to your current working directory and list the extracted files by issuing the below commands. Also, remove the default index.html file installed by Apache web server to webroot path and also delete the info.php file created earlier.<\/p>\n<p class=\"command\">unzip bolt-latest.zip<\/p>\n<p class=\"command\">ls bolt-[TAB]<\/p>\n<p class=\"command\">rm \/var\/www\/html\/index.html<\/p>\n<p class=\"command\">rm \/var\/www\/html\/public\/info.php<\/p>\n<p><strong><b> <\/b><\/strong><strong\/>The installation files for Bolt CMS are located in your current working directory in <strong><b>bolt-v3.4.4\/<\/b><\/strong> directory. Issue <strong><b>ls<\/b><\/strong> command to list this directory files. Copy all the content of the extracted directory to your web server document root path by issuing the following command. Also, make sure you copy the hidden file <em><i>.htaccess<\/i><\/em> to webroot path.<\/p>\n<p class=\"command\">cp -rf bolt-v3.4.4\/* \/var\/www\/html\/<\/p>\n<p class=\"command\">cp -rf bolt-v3.4.4\/.bolt.yml.dist \/var\/www\/html\/bolt.yml<\/p>\n<p><strong><b> <\/b><\/strong>Next, execute the following commands in order to grant Apache runtime user with full write permissions to the web root path. Use <strong><b>ls<\/b><\/strong> command to list permissions for application\u2019s installed files, located in \/var\/www\/html\/ directory.<\/p>\n<p class=\"command\">chown -R www-data:www-data \/var\/www\/html\/<\/p>\n<p class=\"command\">ls -al \/var\/www\/html\/<\/p>\n<p>Next, open Bolt CMS configuration file and add MySQL database connection information, as shown in the following file excerpt:<\/p>\n<p class=\"command\">nano \/var\/www\/html\/app\/config\/config.yml<\/p>\n<p><strong><b> <\/b><\/strong><strong><b>config.yml <\/b><\/strong>file sample:<\/p>\n<pre>database:<br\/>driver: mysql<br\/>databasename: bolt_db<br\/>username: bolt_user<br\/>password: password1234<\/pre>\n<p><a class=\"fancybox\" id=\"img-Picture3\" href=\"https:\/\/www.howtoforge.com\/images\/install_bolt_cms_in_debian_9\/big\/Picture3.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/09\/how-to-install-bolt-cms-on-debian-9-2.png\" alt=\"config.yml\" width=\"550\" height=\"437\" title=\"\"><\/a><\/p>\n<p>Save and close the Bolt CMS configuration file, enter the <strong>\/var\/www\/html<\/strong> directory and install PHP Composer dependency manager software by issuing the below commands.<\/p>\n<p class=\"command\">cd \/var\/www\/html\/<\/p>\n<p class=\"command\">mv composer.json.dist composer.json<\/p>\n<p class=\"command\">curl -sS https:\/\/getcomposer.org\/installer | php<\/p>\n<pre><em><i>All settings correct for using Composer<br\/>Downloading...<br\/>Composer (version 1.5.5) successfully installed to: \/var\/www\/html\/composer.phar<br\/>Use it: php composer.phar<\/i><\/em><\/pre>\n<p class=\"command\">php7.0 composer.phar install<\/p>\n<pre><em><i>Do not run Composer as root\/super user! See https:\/\/getcomposer.org\/root for details<br\/>Loading composer repositories with package information<br\/>Updating dependencies (including require-dev)<br\/>Package operations: 0 installs, 5 updates, 0 removals<br\/>- Updating league\/flysystem-sftp (1.0.14 =&gt; 1.0.15): Downloading (100%)<br\/>- Updating doctrine\/inflector (v1.1.0 =&gt; v1.2.0): Downloading (100%)<br\/>- Updating doctrine\/collections (v1.3.0 =&gt; v1.4.0): Downloading (100%)<br\/>- Updating doctrine\/annotations (v1.2.7 =&gt; v1.4.0): Downloading (100%)<br\/>- Updating doctrine\/common (v2.6.2 =&gt; v2.7.3): Downloading (100%)<br\/>Writing lock file<br\/>Generating autoload files<br\/>&gt; Bolt\\Composer\\ScriptHandler::updateProject<br\/>&gt; Bolt\\Composer\\ScriptHandler::installAssets<br\/>Installing bolt_assets to \/var\/www\/html\/public\/bolt-public<\/i><\/em><\/pre>\n<p>After Composer has been installed, open a browser and navigate to your server IP address or domain name via HTTPS protocol. On the first installation screen, create the first Bolt CMS username, add a strong password for this user and provide the e-mail address and the display name for Bolt admin account. When you finish, hit on <em>Create the first user<\/em> button to save changes.<\/p>\n<p><a class=\"fancybox\" id=\"img-Picture4\" href=\"https:\/\/www.howtoforge.com\/images\/install_bolt_cms_in_debian_9\/big\/Picture4.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/09\/how-to-install-bolt-cms-on-debian-9-3.png\" alt=\"Bolt CMS installer\" width=\"550\" height=\"480\" title=\"\"><\/a><\/p>\n<p>After creating the Bolt admin username, you will be redirected to Bolt CMS admin dashboard, from where you can start further set-up of the application or add some website content.<\/p>\n<p><a class=\"fancybox\" id=\"img-Picture5\" href=\"https:\/\/www.howtoforge.com\/images\/install_bolt_cms_in_debian_9\/big\/Picture5.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/09\/how-to-install-bolt-cms-on-debian-9-4.png\" alt=\"Bolt CMS Dashboard\" width=\"550\" height=\"388\" title=\"\"><\/a><\/p>\n<p>In order to visit Bolt CMS frontend page, open a browser and navigate to your domain name or server IP address via HTTPS protocol.<\/p>\n<p><em><strong><span>https:\/\/www.yourdomain.tld<\/span><\/strong><\/em><\/p>\n<p><span><span><span><a class=\"fancybox\" id=\"img-Picture6\" href=\"https:\/\/www.howtoforge.com\/images\/install_bolt_cms_in_debian_9\/big\/Picture6.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/09\/how-to-install-bolt-cms-on-debian-9-5.png\" alt=\"Bolt CMS sample site\" width=\"550\" height=\"451\" title=\"\"><\/a><\/span><\/span><\/span><\/p>\n<p>The backend admin panel of Bolt CMS can be accessed at the following URL. To log in, supply the username and password configured for the initial account during the installation process.<\/p>\n<p><em><strong>https:\/\/www.yourdomain.tld\/bolt\/login<\/strong><\/em><\/p>\n<p><a class=\"fancybox\" id=\"img-Picture7\" href=\"https:\/\/www.howtoforge.com\/images\/install_bolt_cms_in_debian_9\/big\/Picture7.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/09\/how-to-install-bolt-cms-on-debian-9-6.png\" alt=\"Bolt CMS Login\" width=\"550\" height=\"430\" title=\"\"><\/a><\/p>\n<p>Finally, to force visitors to securely browse the Bolt CMS interface via HTTPS protocol, return to your server\u2019s console and edit the <em><i>.htaccess<\/i><\/em> file located in public directory document root path, by issuing the below command.<\/p>\n<p class=\"command\">nano \/var\/www\/html\/public\/.htaccess<\/p>\n<p>Here, search for the line that starts with <strong><em><b><i>&lt;\/IfModule mod_rewrite.c&gt;<\/i><\/b><\/em><\/strong> opening tag and add the below lines after <strong>RewriteEngine on<\/strong> directive.<\/p>\n<pre># Redirect to HTTPS<br\/>RewriteCond %{HTTPS} off<br\/>RewriteRule (.*) https:\/\/%{SERVER_NAME}\/$1 [R,L]<\/pre>\n<p>At the bottom of the file, you can tamper PHP server settings to match your own server resources and configurations, as shown in the example below.<\/p>\n<pre>php_value session.use_trans_sid 0<br\/>php_value register_globals 1<br\/>php_value upload_max_filesize 50M<br\/>php_value post_max_size 50M<\/pre>\n<p>Congratulations! You have successfully installed the modern Bolt CMS application in Debian 9 server. In order to further customize the application, visit Bolt CMS documentation page at the following address: <span><a href=\"https:\/\/docs.bolt.cm\/3.4\/getting-started\/introduction\" target=\"_blank\" rel=\"noopener\"><span><span>https:\/\/docs.bolt.cm\/3.4\/getting-started\/introduction<\/span><\/span><\/a><\/span><\/p>\n<div>\n<p><b>Share this page:<\/b><\/p>\n<p>\n<a href=\"https:\/\/www.facebook.com\/sharer.php?u=https%3A%2F%2Fwww.howtoforge.com%2Ftutorial%2Finstall-bolt-cms-in-debian-9%2F\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><img decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/09\/how-to-install-bolt-cms-on-debian-9-7.png\" height=\"20\" alt=\"\" title=\"\"><\/a><br \/>\n<a href=\"https:\/\/twitter.com\/intent\/tweet?url=https%3A%2F%2Fwww.howtoforge.com%2Ftutorial%2Finstall-bolt-cms-in-debian-9%2F&amp;text=How+to+Install+Bolt+CMS+on+Debian+9&amp;via=howtoforgecom&amp;related=howtoforgecom\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><img decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/09\/how-to-install-bolt-cms-on-debian-9-8.png\" height=\"20\" alt=\"\" title=\"\"><\/a><br \/>\n<a href=\"https:\/\/twitter.com\/howtoforgecom\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><img decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/09\/how-to-install-bolt-cms-on-debian-9-9.png\" height=\"20\" alt=\"\" title=\"\"><\/a><br \/>\n<a href=\"https:\/\/plus.google.com\/share?url=https%3A%2F%2Fwww.howtoforge.com%2Ftutorial%2Finstall-bolt-cms-in-debian-9%2F\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><img decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/09\/how-to-install-bolt-cms-on-debian-9-10.png\" height=\"20\" alt=\"\" title=\"\"><\/a>\n<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Bolt CMS is a simple and flexible open source Content Management System that is written in PHP programming language and can be successfully deployed in Linux under Apache\/Nginx web servers, PHP and MySQL\/MariaDB database management system, also known as LAMP or LEMP stack. In this tutorial, we\u2019ll learn how to install and configure the latest &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[36],"tags":[],"class_list":["post-6914","post","type-post","status-publish","format-standard","hentry","category-36"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/6914","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/comments?post=6914"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/6914\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=6914"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=6914"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=6914"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}