Configuring Bolt with MySQL database
There is an option to configure your Bolt installation with a MySQL database. This is an optional step, but if your project is going to be vast in size, we strongly recommend that you set up your website with a MySQL database. It is much more reliable and you can easily perform changes to the database directly from the phpMyAdmin service in cPanel.
In this tutorial, we will follow the process of reconfiguring your Bolt installation with a MySQL database. Log into your website with the user that you have created in the previous step. You will be presented with the default dashboard of your Bolt website.
Go to the side menu on the left, and hover over the Configuration tab. Select Main Configuration from the available options.
This will send you to a page that allows you to directly edit the config.yml file. This is the file that is responsible for the configurations of the application. Now you should directly see that the database named Bolt is configured with the SQLite driver. In order to change Bolt to use the MySQL database driver you would first have to create a mysql database and database user.
You can create a new database and a user assigned to it via cPanel. Simply follow our MySQL Wizard tutorial for information on that.
The fields that you need to edit in order to configure Bolt with a MySQL database are:
- Driver - Enter "mysql" without the quotes.
- Databasename - Enter the name of the MySQL database you have created.
- Username - Enter the username that you have assigned to your database with all privileges.
- Password- Enter the password for the user.
In order to reflect the correct setup of Bolt with MySQL database, we will show you an example of how this should look like:
When you are ready, simply click on the Save button to keep the changes.
When you complete the change, you can click anywhere on your admin dashboard. The system will take you back to the user creation page, as you have changed the Bolt configuration settings. You now need to create a new user, which will be stored in the MySQL database. Fill in the details, click on the "Create the first user" button and you will be able to access your website again.
To access the administrative dashboard of your website, you need to specify the /bolt/login/ directory after you enter your domain name. E.g. http://yourdomain.com/bolt/login/
How to enable Maintenance Mode in Bolt
In this tutorial, we will review how to use the pre-made maintenance template of Bolt. This is a good option when you are performing major modifications to our Bolt CMS website. Your users will not be able to see those changes until you allow them to.
The process is quite simple. Since Bolt has a maintenance_default.twig pre-defined template, all that we will need to do is to make some modifications to the general configurations file. The Bolt application will display the template to our website's visitors, while the administrative users will still have access to the website itself.
In order to set Bolt in to maintenance mode you have to add a couple lines of code in the beginning of the config.yml file. First, log into your website as administrator. Move your mouse pointed over the Configurations tab on the left-side menu and the click on Main Configuration.
This will open the config.yml file for editing. As we said Bolt has an existing predefined maintenance mode template. What we have to do is tell the controller to preview the maintenance template to the website's visitors. Scroll down to the maintenance_mode section, which is around row 52. Change the following values
After performing the alterations to the config.yml file, simply click on the Save button to keep the changes.
In order for us to see if the changes that we've just made have taken effect, we'll simply have to access our website.
Make sure that you either logout from Bolt, or open the front page with another browser, otherwise you will still be able to access the mainpage, because you are logged in with a user, for which the maintenance rules don't apply.
Then you will see the following maintenance confirmation.
To disable the maintenance mode, simply change the maintenace_mode value back to false.
How to change basic information in Bolt
Initially when you install Bolt the title of your website is set to A sample site and the subtitle is "The amazing payoff goes here". In this tutorial we'll review how to set the website's name and subtitle to that we need.
The changes that we want to make have to be performed in the config.yml file. Fortunately for us, this can be done directly through the dashboard of your Bolt website. You need to log in as administrator and then move your mouse pointer over the Configuration tab on the left-side menu. Click on the Main Configuration option from the available ones.
Once you open the main config.yml file for editing, you need to locate the sitename and payoff values and edit them. They should be around lines 15 and 16. Change the required values to what you would like to display as a title and subtitle. The lines are:
sitename: My Bolt Website
payoff: Read my new blog and get ready to be amazed!
Make sure to preserve the formatting (i.e. spacing and indentations) of the config.yml file. It is vital for the proper functionality of your website.
Click on the Save button below to complete the changes. Once you are ready, you can access the front page of your website and see the new changes.
If you wish to omit the subtitle, you need to comment it out. Place a hashtag along wiht a single spacing ("#") before the payoff tag.
About Bolt CMS
Bolt is a relatively young open source CMS software with a rapidly growing user base. Entering the CMS stage in 2012, it is utilizing modern open source libraries and has proved so far that it is an excellent tool for creating elegant HTML5 websites.
It is lightweight and highly customable although lacking some of the functionalities that the larger CMS platforms provide. But for that Bolt compensates with an incredibly easy to use interface. Even editors who don't have much previous experience with it can easily create new content. And content management is made even easier, with the latest release of Bolt you can easily edit content from the front end so that you can directly see how it will appear for the visitors.
One of the main advantages of Bolt over other similar CMS scripts is that it's highly flexible. Whether you are creating a small website, or you are laying the foundation for something big, Bolt has it all. And along with that the documentation provided by the development team is really well made.
Bolt does not have any heavy requirements and our hosting plans are suitable for best performance of your website. The minimum requirements of Bolt are:
PHP 5.3.3 or higher
Access to SQLite (which comes bundled with PHP 5.3), or MySQL or PostgreSQL
Apache with mod_rewrite enabled (.htaccess files) or Nginx (virtual host configuration covered below)
A minimum of 32MB of memory allocated to PHP
PDO extension, to connect to a database
Our Bolt Hosting is fully compatible with the system requirements of Bolt, and we provide all the additional recommendations as well. Furthermore, our shared servers are running entirely on SSD for outstanding Bolt experience.