How to build a Ghost blog platform on Ubuntu

Source: Internet
Author: User
Tags ghost themes
Ghost is an open-source blog platform based on Node. js. it was created by former WordPressUI supervisor JohnONolan and WordPress developer HannahWolfe. There are a large number of open-source blog programs on the internet. last year, the launch of Ghost is rapidly capturing users. Tag 0.4.1: GHOSTUbuntu

Ghost is an open-source blog platform based on Node. js. it was created by former WordPress UI supervisor John O 'Nolan and WordPress developer hanner Wolfe. There are a large number of open-source blog programs on the internet. last year, the launch of Ghost was quickly capturing users. in an earlier version of 0.4.1, Coding Horror embraced Ghost. There are more and more Ghost themes/templates, and some excellent WordPress theme vendors, such as WooThemes, have begun to provide Ghost themes.

It is very easy to install Ghost, or even easier than WordPress. The following installation steps are successfully tested on Ubuntu 12.04.4 LTS Server.

Switch to the root account to upgrade and update the entire system:

$ sudo -i# apt-get update# apt-get upgrade

Install the Node. js runtime environment:

# apt-get install g++ make python python-software-properties# add-apt-repository ppa:chris-lea/node.js# apt-get update# apt-get install nodejs

Download and unzip the Ghost and install it:

# cd# wget https://ghost.org/zip/ghost-0.4.1.zip# unzip ghost-0.4.1.zip -d ghost# cd ghost# npm install --production

Configure Ghost to listen to all IP addresses on the local machine, and change '127. 0.0.1 'to '0. 0.0.0 ′:

# vi config.js...       server: {            // Host to be passed to node's `net.Server#listen()`            host: '0.0.0.0',            // Port to be passed to node's `net.Server#listen()`, for iisnode set this to `process.env.PORT`            port: '2368'        }...

Use npm to start the Ghost program:

# npm start> ghost@0.4.1 start /root/ghost> node indexGhost is running in development...Listening on 0.0.0.0:2368Url configured as: http://my-ghost-blog.com

The default Ghost port is 2366. open the browser to access http: // 192.168.2.178: 2366 and you will see the interface:

 

Log on to the background and access http: // 192.168.2.178: 2366/admin:

 

Ghost is an independent program that can be run directly in the nodejs environment. modify the listening port 2366 of The Ghost in the js file to 80. However, in the production environment, we generally add Nginx at the front end.

Install and configure Nginx:

# apt-get install nginx# rm /etc/nginx/sites-enabled/default# vi /etc/nginx/sites-available/ghostserver {    listen 0.0.0.0:80;    server_name vpsee.com;    access_log /var/log/nginx/vpsee.com.log;    location / {        proxy_set_header X-Real-IP $remote_addr;        proxy_set_header HOST $http_host;        proxy_set_header X-NginX-Proxy true;        proxy_pass http://127.0.0.1:2368;        proxy_redirect off;    }}# ln -s /etc/nginx/sites-available/ghost /etc/nginx/sites-enabled/ghost# /etc/init.d/nginx restart

After receiving the request, Nginx will pass the (proxy_pass) Ghost service program. at this time, it is best to change the Ghost configuration used in the test to '2017. 0.0.1 '. after the modification, remember to restart the Ghost:

# vi config.js...            // Host to be passed to node's `net.Server#listen()`            host: '127.0.0.1',...

Every time npm start is too troublesome, to enable the Ghost program to run automatically after the system starts, you need to add the script to Upstart:

# vi /etc/init/ghost.confstart on startupscript    cd /root/ghost    npm startend script

You can use service Ghost start/restart/stop to start, restart, or stop ghost in the future:

# service ghost restartghost stop/waitingghost start/running, process 11619

It is much easier than WordPress's bloated Ghost. Through the Markdown format, Node. js real-time and beautiful interface, Ghost provides users with a simpler and more pure content writing and publishing method. Edit the article on the left and preview the article in real time on the right:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.