Cloudbooklet
  • News
  • Artificial Intelligence
  • Applications
  • Linux
No Result
View All Result
Cloudbooklet
  • News
  • Artificial Intelligence
  • Applications
  • Linux
No Result
View All Result
Cloudbooklet
No Result
View All Result
Home Google Cloud

Install Bolt CMS on Ubuntu 18.04 with Nginx – Google Cloud

by Cloudbooklet
5 years ago
in Google Cloud, Compute Engine
Install Bolt Cms On Ubuntu 18.04 With Nginx - Google Cloud
ShareTweetSendShare
Readers like you help support Cloudbooklet. When you make a purchase using links on our site, we may earn an affiliate commission.

Install Bolt CMS on Ubuntu 18.04 with Nginx on Google Cloud Platform. This guide helps to install and run Bolt CMS on Google Compute Engine and connect with Cloud SQL. This setup is tested on Google Cloud Platform, it will also work fine on other cloud serveices and on any VPS or Dedicated servers running […]

ADVERTISEMENT

Install Bolt CMS on Ubuntu 18.04 with Nginx on Google Cloud Platform. This guide helps to install and run Bolt CMS on Google Compute Engine and connect with Cloud SQL.

This setup is tested on Google Cloud Platform, it will also work fine on other cloud serveices and on any VPS or Dedicated servers running Ubuntu.

Prerequisites

  • A running Compute Engine, see the Setting up Compute Engine Instance with Ubuntu 18.04
  • Initial Ubuntu Server Set up.
  • Install LEMP stack on Ubuntu in Google Cloud.
  • A running Cloud SQL instance, see How to set up Cloud SQL in Google Cloud

With the above-completed prerequisites, I assume you have your Nginx, PHP installed and Cloud SQL is configured.

ADVERTISEMENT

Install Required PHP Extensions

sudo apt install php7.3-intl

Set up your Website Directory

Your website will be located in the home directory and have the following structure

You might also like

How To Setup Ssh Keys On Ubuntu

How to Setup SSH Keys on Ubuntu 20.04

4 months ago
Draggan Ai Editing Tool Install And Use Draggan Photo Editor

DragGAN AI Editing Tool Install and Use DragGAN Photo Editor

4 months ago

Replace yourdomainname.com with your original domain name.

home
-- yourdomainname.com
---- logs
---- public

The public directory is your website’s root directory and logs directory for your error logs

ADVERTISEMENT

Now we create these directories and set correct permissions

You need to SSH into your VM Instance and run these commands

ADVERTISEMENT
mkdir -p yourdomainname.com/logs yourdomainname.com/public
sudo chmod -R 755 yourdomainname.com

Configure Nginx

Create a new Nginx configuration for your website in the sites-available directory.

 sudo nano /etc/nginx/sites-available/yourdomainname.com

Copy and paste the following configuration, ensure that you change the server_name, error_log and root directives to match your domain name. Hit CTRL+X followed by Y to save the changes.

ADVERTISEMENT
 server {
listen 80;
listen [::]:80;
server_name yourdomainname.com www.yourdomainname.com;

error_log /home/username/yourdomainname.com/logs/error.log;

root /home/username/yourdomainname.com/public/;
index index.html index.php;

location / {
try_files $uri $uri/ /index.php?$query_string;
}

location = /bolt {
try_files $uri /index.php?$query_string;
}

location ^~ /bolt/ {
try_files $uri /index.php?$query_string;
}

location ^~ /thumbs {
try_files $uri /index.php; #?$query_string;
access_log off;
log_not_found off;
expires max;
add_header Pragma public;
add_header Cache-Control "public, mustrevalidate, proxy-revalidate";
add_header X-Koala-Status sleeping;
}

location ~* ^.+.(?:atom|bmp|bz2|css|doc|eot|exe|gif|gz|ico|jpe?g|jpeg|jpg|js|map|mid|midi|mp4|ogg|ogv|otf|png|ppt|rar|rtf|svg|svgz|tar|tgz|ttf|wav|woff|xls|zip)$ {
access_log off;
log_not_found off;
expires max;
add_header Pragma public;
add_header Cache-Control "public, mustrevalidate, proxy-revalidate";
add_header X-Koala-Status eating;
}

location = /(?:favicon.ico|robots.txt) {
log_not_found off;
access_log off;
}

location ~ /index.php/(.*) {
rewrite ^/index.php/(.*) /$1 permanent;
}

location ~ /. {
deny all;
}

location ~ /.(htaccess|htpasswd)$ {
deny all;
}

location ~ /.(?:db)$ {
deny all;
}

location ~* /(.*).(?:markdown|md|twig|yaml|yml)$ {
deny all;
}

location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/run/php/php7.3-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}

Hit Ctrl+X followed by Y and Enter to save the file and exit.

To enable this newly created website configuration, symlink the file that you just created into the sites-enabled directory.

ADVERTISEMENT
sudo ln -s /etc/nginx/sites-available/yourdomainname.com /etc/nginx/sites-enabled/yourdomainname.com

Check your configuration and restart Nginx for the changes to take effect.

sudo nginx -t
sudo service nginx restart

Download Bolt CMS

Navigate into your root directory.

cd ~/home/username/yourdomainame.com/public

Download the latest version of Bolt CMS.

curl -O https://bolt.cm/distribution/bolt-latest.tar.gz
tar -xzf bolt-latest.tar.gz --strip-components=1

Once Bolt is downloaded you need to set up correct permissions.

Set Up Permissions

To give Bolt write access to these files you have to use the chmod command.

chmod -R 777 app/cache/ app/config/ app/database/ extensions/
chmod -R 777 public/thumbs/ public/extensions/ public/files/ public/theme/

Set Up Database Configurations

By default Bolt is configured to use SQLite, so we can change it to use MySQL database in the app/config/config.yml file and connect it to Cloud SQL.

sudo nano ~/yourdomainname.com/public/app/config/config.yml

Edit the database section and replace the following with your Cloud SQL details

  • driver with mysql
  • host with your Cloud SQL IP Address
  • databasename with Cloud SQL database name
  • username with Cloud SQL user name
  • password with your password
  • prefix with your database prefix

Your details will look something similar to the one below.

database:
driver: mysql
username: USERNAME
password: PASSWORD
databasename: DATABASE_NAME
host: CLOUD_SQL_IP_ADDRESS
prefix: prefix_

Verify Set Up and Install

Once everything is in place visit your domain name in your browser.

Now you need to create the default user.

Bolt Cms Installation

Follow the on screen instructions and enjoy using Bolt CMS on Google Cloud.

Bolt Cms Dashboard

Conclusion

Now you have learned how to install Bolt CMS on your Ubuntu server with Nginx in Google Cloud.

Thanks for your time. If you face any problem or any feedback, please leave a comment below.

Tags: Compute EngineGoogle Cloud PlatformUbuntu 18.04
ShareTweetSendShare
Cloudbooklet

Cloudbooklet

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Related Posts

Set Up Deep Learning With Nvidia, Cuda, Cudnn On Ubuntu

How to Set Up Deep Learning with Nvidia, CUDA, cuDNN on Ubuntu 22.04

7 months ago
How To Install Or Upgrade Php 8.2 On Ubuntu 22.04

How to Install or Upgrade PHP 8.2 on Ubuntu 22.04

9 months ago
How To Change Timezone On Ubuntu 22.04

How to Change Timezone on Ubuntu 22.04

1 year ago
How To Install Ansible On Ubuntu 22.04

How to Install Ansible on Ubuntu 22.04

1 year ago

Follow Us

Trending Articles

Birthday Posts On Facebook

How to See all my Birthday Posts on Facebook

September 22, 2023

Interactive AI – Next Phase of Artificial Intelligence

5 Best Fantasy Minecraft Servers in 2023

10 Best AI Song Generator in 2023 (Free and Paid)

HeyGen AI: Free AI Video Generator to Create Amazing Videos

How to Block YouTube Ads on Android TV in 2023 (6 Easy Methods)

Popular Articles

Instagram Video Downloader

Best 10 Instagram Video Downloader Apps and Websites for 2023

August 28, 2023

How to Use the Donne App: A Step-by-Step Guide for Fashion Lovers

Create High Quality AI Cover Song with Covers AI

Winston AI: How to Check AI Plagiarism for Better SEO

10 Best AI Mockup Generators to Create Stunning Mockups

Google and Bing in Action to Prevent Spread of AI Child Porn

Subscribe Now

loader

Subscribe to our mailing list to receives daily updates!

Email Address*

Name

Cloudbooklet Logo

Welcome to our technology blog, where we explore the latest advancements in the field of artificial intelligence (AI) and how they are revolutionizing cloud computing. In this blog, we dive into the powerful capabilities of cloud platforms like Google Cloud Platform (GCP), Amazon Web Services (AWS), and Microsoft Azure, and how they are accelerating the adoption and deployment of AI solutions across various industries. Join us on this exciting journey as we explore the endless possibilities of AI and cloud computing.

  • About
  • Contact
  • Disclaimer
  • Privacy Policy

Cloudbooklet © 2023 All rights reserved.

No Result
View All Result
  • News
  • Artificial Intelligence
  • Applications
  • Linux

Cloudbooklet © 2023 All rights reserved.