Build your own blog within seconds using Ghost and Digital Ocean
Ghost is a blogging engine where you can build your own blog within seconds if you know the steps. That said the setup to do so was not simple or intuitive, and someone can ended up spending a lot of time and effort getting the blog up and running.
This article seek to fix that particular problem. In it, I will list everything you need to host your own Ghost blog on your own server space. To be frank, it’s a lot of steps, but ultimately you will control your own site and learn a bit about how the Internet works and how server management is done.
Table of Contents:
The number one priority is to buy your own domain. You cannot start a website if you don’t have a domain name.
It’s basically a string of recognizable words that, when typed in the browser, redirects the user to your server IP. A server IP looks like 139.59.141.110 which is hard to rememebr by hard.
Here’s a list of where you can buy/research domains:
I use digital ocean so I had to insert the following details in my namecheap account:
You can do this in one of two ways. If by some miracle you already have your own web server in a location you control, you can just use that. The vast majority of people, though, don’t have web servers just lying around, and so they have to rent server space and time from a provider for a monthly fee.
There are a TON of hosting providers out there, including:
The one I use and recommend is DigitalOcean; they have a fantastic interface which help you set up your “droplet” (AKA your server) The cheapest plan they have is $5/month, which is reasonable good for web hosting and most importantly it offers one-click “application” installation.
Login to your Digital Ocean account, then click New Project button and then Create a Droplet, choose Marketplace and select Ghost, select standard as plan 5£/mo, enable backups, select a region close to your audience to reduce the latency and select a hostname. As in the picture below:
Then click Create and waiting for less than 1 minute, your droplet information (username and password) will be send to your email.
After the droplet has been created right click and press add a domain as in the picture below:
After creating an A record which will redirect the www.ppo.com to the server IP it should look like this. (assuming ppo as your domain name).`
Login to your host, if you used unix you can run on Terminal otherwise right-click on the droplet and click access console.Assuming 123.456.7.8 is your droplet ip run the follow command:
You’ll see welcome message and will aks you for password use the one that was emailed to you by Digital Ocean.
After logged in, System will force you to changing a password.$ Changing password for root.
$ (current) UNIX password:
$ Enter new UNIX password:
$ Retype new UNIX password:
Follow the steps and some point will ask you the domain name:
After a while will ask about your email address used for the SSL certification. Once it is finished enter your domain name on a browser with /ghost to register as admin in your ghost blog.
Back to my droplet, every time when I access to droplet with ssh default port is 22 and user is root, I should change default port and user root for protected
Create a new user named alex (you can change a name whatever you like)
and then there is a prompt to fill additional information and strong password.
Add permission to allow chai user run super user command
Then, disable remote SSH access to the root account.
Next, I need to find the line that looks like this:
change to
Then, change default port 22 to 1234 (up to you)
Finally, restart ssh service with
Now, try to open another terminal and access to Digital Ocean with:
You can access like a root user. Well done!
You may wish to have multiple domains that redirect to your blog, e.g. to have an extra TLD or to support www. domains. Ghost itself can only ever have one domain pointed at it. This is intentional for SEO purposes, however you can always redirect extra domains to your Ghost install using nginx.
If you want to redirect an HTTPS domain, you must have a certificate for it. This is where letsencrypt comes in particularly handy, because who wants to pay for SSL for a redirect?!
If you want to use Ghost-CLI to generate an extra SSL setup, you can do this using a little trick, first run ghost config to change the domain. This will not restart Ghost, so the change won’t be reflected.
Next, get Ghost-CLI to generate an SSL setup for your domain with www.:
You’ve now got two domains setup with SSL. Next, change your Ghost config back before you forget.
/var/www/ghost/system/files/www.example.com.conf
Finally, you’ll need to edit the nginx config files for your second domain to redirect to your canonical domain. Edit both files:
/var/www/ghost/system/files/www.example.com-ssl.conf
making the below changes:
Has to look like this:
Similarly has to look as below.
Once you have made those changes run
to get nginx to verify your config, and
to reload nginx and pick up your new configuration.
The Subscribers feature in Ghost allows you to capture email addresses of people who would like to subscribe to your publication’s content. Email addresses can be viewed and edited from Ghost admin, but no emails will be sent without further integrationswith an email tool.This feature can be enabled in the “Labs” settings menu in Ghost admin. When it is enabled, a subscribe button will appear on your site, if your theme supports it.
When the Subscribers feature is enabled, a “Subscribers” menu item will appear within Ghost Admin:
This menu allows you to manage your subscriber list with the following actions:
The Subscribers feature in Ghost allows you to capture email addresses of people who would like to subscribe to your publication’s content. Email addresses can be viewed and edited from Ghost admin, but no emails will be sent without further integrations with an email tool.This feature can be enabled in the “Labs” settings menu in Ghost admin. When it is enabled, a subscribe button will appear on your site, if your theme supports it.
When the Subscribers feature is enabled, a “Subscribers” menu item will appear within Ghost Admin:
This menu allows you to manage your subscriber list with the following actions:
2. Google Analytics
Follow this link: https://docs.ghost.org/integrations/google/
That’s it! This should help you set up and running your own blog, so you can actually focus your time on writing something. I tend to like this hands-on approach especially when I want to learn some new tricks. If this scares you, you can always use the managed version Ghost(Pro) which will abstract away pretty much all the above tasks.
At this point I would like to give special thanks to my friend PicoCoder for all of his help and guidance. Please do check his blog.
Originally published at https://gdcoder.com on April 16, 2019.
Build your own blog within seconds using Ghost and Digital Ocean
Research & References of Build your own blog within seconds using Ghost and Digital Ocean|A&C Accounting And Tax Services
Source
0 Comments