Install Ghost Blog Platform under Inux
Ghost currently requires Node.js 0.10.X version and NPM 0.25 support, because these two software package version requirements are more stringent, do not blindly novelty, or installation will be problematic
I. Installation and configuration of Ghost
1. Install Nodejs:
Curl--silent--location https://deb.nodesource.com/setup_0.10 | Bash-
Apt-get Install--yes Nodejs
2. Upgrade NPM to 2.5.0
NPM Install Npm@2.5.0-g
3. Create folder Directory
Mkdir-p/home/www/
4. Download Ghost installation package and unzip
Cd/home
Curl-l Https://ghost.org/zip/ghost-latest.zip-o Ghost.zip
Unzip-uo ghost.zip-d www
CD www
5. Install Ghost
NPM Install--production
Copy a default profile config.js (this file can be further optimized if necessary, this article does not change here)
CP Config.example.js Config.js
The installed ghost port is 2368 and is already available for local browsing and editing, but in order to gain a better network access experience, you will need to use Nginx for proxy.
6. Install Nginx
Apt-get Install Nginx
cd/etc/nginx/
RM Sites-enabled/default
Vi/etc/nginx/sites-available/ghost
7. Configure the Nginx rule, only need to modify "Your_domain.tld" for its own domain name
server {
Listen [::]:80;
server_name your_domain.tld;
Location/{
Proxy_set_header X-real-ip $remote _addr;
Proxy_set_header Host $http _host;
Proxy_pass http://127.0.0.1:2368;
}
}
8. Bringing the Nginx rule into force
Ln-s/etc/nginx/sites-available/ghost/etc/nginx/sites-enabled/ghost
9. Restart Nginx
Service Nginx Restart
10. In order to facilitate our day-to-day management, you can register ghost as a Linux service (add Ghost as INIT.D), which can also allow Ghost to run quietly in the background.
sudo curl https://raw.githubusercontent.com/TryGhost/Ghost-Config/master/init.d/ghost \
-o/etc/init.d/ghost
Vi/etc/init.d/ghost
Change the directory behind the Ghost_root to your own ghost directory, this is/home/www
11. Because the above script defaults to the system's ghost user, we also need to create the user and give him the appropriate permissions.
Useradd-r Ghost-u
Chown-r ghost:ghost/home/www
chmod 755/etc/init.d/ghost
Through the above settings, you can manage the ghost operation through the General Service command.
Service Ghost Start
Service Ghost Stop
Service Ghost Restart
Service Ghost Status
12. Set Boot up
sudo update-rc.d ghost defaults
$ sudo update-rc.d ghost Enable
13. Access to http://domain name/ghost/setup/one/, after a few steps to set up and create an account, the installation is completed.
Second, send mail settings:
Here the use of Mailgun provided by the SMTP service, you can save a lot of unnecessary trouble, in addition, Mailgun provides a monthly 10,000 of the amount of mail to fully meet the needs of the general personal blog
1. Visit the following Web site, registered account, click on the account inside the sandboxXXXX.mailgun.org domain name, point to see the API key string, copied down, in the following URL input
https://ghost.mailgun.com/
2. Enter the blog domain name
3. The right will generate a complete ghost configuration file, copy the Mail field
4. Paste into the Ghost configuration file/home/www/config.js the appropriate location.
5. Restart Ghost Effective
Service Ghost Restart