A few days ago I published an entry about how to install Ghost easily with an installation script, today I write this to teach how to install it with Nginx and your domain name. Without further ado, let's get started with the tutorial!
Required packages
To install Ghost In VPS we have to connect to it and install the dependencies, for this we need to install the following:
# apt-get install build-essential automake make checkinstall dpatch patchutils autotools-dev debhelper quilt fakeroot xutils lintian cmake dh-make libtool autoconf git-core curl zip nginx
This will install the dependencies to compile NodeJS (required by ghost), will install Nginx and other tools.
Compiling NodeJS
To compile NodeJS we must download the sources:
wget http://nodejs.org/dist/node-latest.tar.gz
Once this is done, you have to unzip them:
tar -xzf node-latest.tar.gz
We move to the directory where the code is located:
nodeversion=`ls | grep node`
cd $nodeversion
We compile and install:
./configure
make -s
make install
And that's it!
Installation
Before configuring, you have to install it, right? Although of course, do not panic, you will no longer compile 🙂
Create the www directory and move to it:
mkdir -p /var/www
cd /var/www/
Download Ghost:
curl -L -O https://ghost.org/zip/ghost-latest.zip
Unzip:
unzip -d ghost ghost-latest.zip
rm ghost.zip
Enter the directory:
cd ghost/
Move everything to / var / www /:
mv /var/www/ghost/* /var/www/
Go back to / var / www /:
cd /var/www/
Install Ghost
/usr/local/bin/npm install --production
Good! Now to configure. 😀
Configuration
We edit the configuration file with the following command:
sed -e 's/127.0.0.1/0.0.0.0/' -e 's/my-ghost-blog.com/www.dominio.com/' -e 's/2368/8080/' config.js
Easy right? Just replace "domain.com" with your domain, for example:
sed -e 's/127.0.0.1/0.0.0.0/' -e 's/my-ghost-blog.com/www.theworldofthegeek.com/' -e 's/2368/8080/' config.js
We could do it with dwarf (the GNU editor, not to be confused with Nano's DesdeLinux : V), but it would be more complicated and we would have to replace a lot (yes, a lot, as you read it) code, but this way to explain is easier :).
But remember we need it to be in the background! For this we install forever:
/usr/local/bin/npm install -g forever
We introduce the following command (to start Ghost We must be in the installation directory (/ var / www /)):
NODE_ENV=production forever start index.js
Ta dah! In background!
To stop, restart or start Ghost:
forever stop index.js
forever restart index.js
NODE_ENV=production forever start index.js
Ready! 😀
Setting up Nginx
Time to configure Nginx!
We will edit the configuration file:
nano /etc/nginx/nginx.conf
We will delete everything and paste the following configuration: http://paste.desdelinux.net/5034
Once with the new settings, replace the word "domain" with your domain name on lines 36, 38, 39 and 43.
Now reboot Nginx
service nginx restart
Ready! 😀
Configure the domain
Enter your domain provider and edit the A (Host) record. Change the IP address it points to for your VPS, and voila!
End Notes
To access the administration, go to www.dominio.com/ghost/ remember to change domain for your domain. Ready! You can now access your domain, start publishing and install a theme :), but ...
The World Of The Geeks (I) give you this theme for you to install, modify and enjoy. 🙂
You just have to download it:
wget http://www.theworldofthegeek.com/files/TWOTGFlat.zip
Unzip it:
unzip TWOTGFlat.zip
And copy the theme to your Ghost
cp TWOTGFlat/ /var/www/content/themes
Now in the settings of your Ghost change the theme to the new one, and voila!
If you have a question or need help with Ghost, leave your questions in the comments or you can contact me on my website.
Cheers! nn /
Good tutorial, I'm going to test it on the "play" VPS, you won't have a preview of the theme to see how it is before downloading it 😛
Sure! http://www.theworldofthegeek.com/content/images/2014/Aug/Captura-de-pantalla-de-2014-08-09-17-04-57.png
You just have to modify the default.hbs (since it has a minor error in the navbar) and the sidebar.hbs and that's it!
Thank you!!
Interesting tutorial. Perhaps, I dedicate myself to migrating to Ghost, but I don't know how the management would be there (in fact, if it requires access to the VPS, it would be somewhat uncomfortable).
There are tools to migrate to Ghost from for example WordPress, it is very easy to control, from tusite.com/ghost you access the administration of Posts, user and blog, unfortunately it does not have multi-user support (But it will be added), but with some Hacks to code can be done, although personally I prefer to wait for updates to avoid making mistakes, if you have questions ask me 🙂
Well, in any case, I'd like to try Ghost's multi-user management.
And now you can do it!
Ghost already supports multi-user 😀
I would like to know what ghost offers as a platform or blogging that others do not. They have made it known here and also how to install and configure but, they have not mentioned why to use ghost. For example, currently I think WordPress takes the crown in this type of platform, the question would be why use ghost and not wordpress? Or is it simply being an alternative, just that?
+1. I would like more information about it, because little is known about Ghost.
I was looking at my hosting and I realized that Softaculous offers it to install it, but I do not see advantages over WordPress.
The only thing I have seen is that Ghost is more minimalist, perhaps that provides some advantage over the server load.
Actually the server load is much faster and uses less resources
I will explain that in the next article 😉
And one thing that I still haven't understood ... What is Ghost? For a blog? For a domain? ...
To create a blog
Great. Now there are only a few screenshots left to see what Ghost looks like on the outside and inside
That same. Just a few screenshots to illustrate the procedure and everyone is happy. #LOL.
Man, that's the next thing 😀