Deploying a Ghost Blog on Alibaba Cloud

What Is Ghost?

Ghost vs. WordPress

1. Performance

2. Ease of Use

3. Security

4. Search Engine Friendliness

5. Extendability

Deployment Process

Step 1: Create a VPC

  • Log In to Alibaba Cloud Console
  • Click on Products
  • Click Virtual Compute Cloud under Networking section
  • Choose your Region from the upper left corner
  • Click on Create VPC
  • VPC Name: ghost -blog. The VPC name should be lower case
  • VSwitch Name: ghost-blog-vswitch
  • Zone: Choose anyone from the dropdown box
  • Destination CIDR Block: 192.168.0.0/29
  • Click OK

Step 2: Create an ECS Instance

  • Log In to Alibaba Cloud Console
  • Click on Products
  • Click Elastic Compute Cloud under Elastic Computing section
  • Click on Instances
  • Choose your Region from the upper left corner
  • Click Create Instance
  • Billing Method: Subscription
  • Region: Random
  • vCPU: 1 vCPU
  • Memory: 1 GiB
  • Instance Type: ecs.t5-lc1m1.small
  • Image Type: Public Image
  • Operating System: Ubuntu
  • Operating System Version: 18.04 64bit
  • Enable Security Enhancements. This will add additional security features like Backdoor detection to our ECS instance
  • Disk Type: Ultra Disk
  • Disk Capacity: 20 GiB
  • For VPC, select the VPC we created in Step 1 from the drop-down menu
  • Check Assign Public IP
  • BandwidthPricing: Pay By Traffic
  • Data Transfer Rate: 200 Mbps
  • Enable both port 80 and 443. Port 80 is used for HTTP and port 443 is used for HTTPS
  • Authentication Method: Password
  • Enter a STRONG PASSWORD in both Password and Confirm Password Fields.
  • Instance Name: ghost-blog
  • Host: Enter your domain name

Step 3: Register a Domain Name

  • Log In to Alibaba Cloud Console
  • Click on Domains
  • Click Purchase
  • Enter a Domain that you want to register in the Search bar & click Find Domain button.
  • Click Buy Now & then complete the purchase

Step 4: Setup Alibaba Cloud DNS

  • Log In to Alibaba Cloud Console
  • Click Products
  • Choose Alibaba Cloud DNS as shown in the following figure
  • Click on the domain we registered in Step 4.
  • Click Add Record
  • Record Type: A
  • Host: blog.example.com (Replace example.com with your domain name)
  • Value: ECS instance IP
  • Leave other options as default
  • Finally, Click OK to create the DNS record

Step 5: Create an ApsaraDB for RDS instance

  • Log In to Alibaba Cloud Console
  • Click on Products
  • Click ApsaraDB for RDS under ApsaraDB section.
  • Choose your Region from the upper left corner
  • Click Create Instance
  • Choose Subscription tab
  • Region: The same region we previously used for creating our VPC and ECS instance
  • DB Engine: MySQL
  • Version: 5.7
  • Edition: High Availability
  • Network Type: VPC
  • Then select the VPXC and VSwitch we created in Step 1
  • Instance Type: 1 Core, I GiB
  • Storage Capacity: 5 GiB
  • Purchase Duration: 1 Month (or higher)
  • Tick the Auto Renew box
  • Quantity: 1

Step 6: Configuring RDS

  • Log In to Alibaba Cloud Console
  • Click on Products
  • Click Apsara for RDS under ApsaraDB section.
  • Click on the RDS instance we created in Step 5
  • Click Security
  • Click Configure SSL
  • Click add Whitelist Group
  • Group Name: ghostblog
  • Click Update ECS Instance IP Address. The private IP addresses of our ECS instances will be displayed
  • Choose the Instance IP
  • Click OK
  • Click Accounts
  • Click on Create Master Account
  • Database Account name: root. This will be our MySQL username
  • Enter a STRONG PASSWORD for both Password and Confirm Password fields. This will be our MySQL password
  • Click Create

Step 7: Connecting to our Instance

F VNC vs SSH

Connecting to our instance via VNC

  • Log In to Alibaba Cloud Console
  • Click on Products
  • Click Elastic Compute Cloud under Elastic Computing section
  • Click Instances
  • Click Connect
  • Note down the VNC password.
  • Click Close

Connecting to our instance via SSH

  • Type cmd in the search bar & hit enter
  • Type ssh
ssh root@instace-ip

Step 8: Setting Up the hostname

echo "blog.sarathy.xyz" > /etc/hostname

Step 9: Setting Up an Unprivileged User

adduser sarathy
usermod -a -G sudo sarathy

Step 10: Upgrading the System to the Latest Version

sudo apt update
sudo apt dist-upgrade -y

Step 11: Setting the Default TimeZone

dpkg-reconfigure tzdata

Step 12: Install Nginx

sudo apt install nginx -y
nginx -v
sudo systemctl start nginx
sudo systemctl enable nginx

Step 13: Install Nodejs

sudo apt install nodejs -y
node -v

Step 14: Install NPM

sudo apt install npm -y
npm -v

Step 15: Install Ghost-CLI

sudo npm install ghost-cli@latest -g

Step 16: Deploying Our Blog

sudo mkdir -p /var/www/ghost
sudo chown -R sarathy:sarathy /var/www/ghost
sudo chmod 775 /var/www/ghost
cd /var/www/ghost
ghost install
  • Enter Your Blog URL: Your Blog URL
  • Enter Your MySQL Hostname: Enter your RDS hostname we copied in Step 6
  • Enter Your MySQL Username: root
  • Enter Your MySQL Password: Enter your MySQL password we copied in Step 6
  • Enter Your Database Name: blog. Ghost installer will create a database named blog in our RDS instance
  • Do you wish to set up “ghost” MySQL user?: Yes Ghost installer will create a new MySQL user called “ghost”
  • Do you wish to setup Nginx? : Yes. Ghost installer will automatically configure Nginx for us
  • Do you wish to set up SSL?: Yes
  • Do you wish to set up Systemd?: Yes
  • Do you want to start Ghost?: Yes

Conclusion

--

--

--

Follow me to keep abreast with the latest technology news, industry insights, and developer trends. Alibaba Cloud website:https://www.alibabacloud.com

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Tiny SCSI Emulator

Build a complete iOS messaging app using XMPPFramework

Our app also finds a new home: HOMESCREEN part I

Automating Cloud Infrastructure with Ansible: Part 2

Dynamically Update Routing Configurations through Alibaba Cloud K8S Ingress Controller

Windows 11 tested individuals improved on include for taskbar, and clients are upset.

Jenkins Master Slave Configuration

Arabic Case Insensitive In Database Systems: How To Solve Alef With and Without Hamza Problem

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Alibaba Cloud

Alibaba Cloud

Follow me to keep abreast with the latest technology news, industry insights, and developer trends. Alibaba Cloud website:https://www.alibabacloud.com

More from Medium

Transferring data from MySQL to MsSQL DataBase

Weighing the Pros and Cons of PostgreSQL

Hello World: Welcome to the Fidel API Technology Blog

API Rate Limiting