一、簡介
 跟靜態(tài)博客不同的是,Ghost 這種輕量級的動態(tài)博客,有一個管理后臺,可以直接寫作和管理博客。本質上,跟 WordPress 是相通的,只是 Ghost 搭建在 Node.js 環(huán)境上,輕量,快速,簡潔。
二、更新操作系統(tǒng)
* 首先更新系統(tǒng)版本 

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo yum makecache yum update
三、安裝nginx
* 配置安裝源
vi /etc/yum.repo.d/nginx.repo
[nginx] name=nginx repo baseurl=http://nginx.org/packages/centos/$releasever/$basearch/ gpgcheck=0 enabled=1
* 安裝并啟動nginx
yum install nginx systemctl enable nginx systemctl start nginx ps -ef |grep nginx
* 配置nginx
vim /etc/nginx/conf.d/blog.conf
server {  
    listen 80;
    server_name blog.waringid.me // 這里修改為你的域名;如果沒有域名,則輸入服務器公網 IP 地址;
    location / {
        proxy_set_header   X-Real-IP $remote_addr;
        proxy_set_header   Host      $http_host;
        proxy_pass         http://127.0.0.1:2368;
    }
}四、安裝Node.js
* 安裝nvm
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.32.1/install.sh | bash source .bashrc nvm ls nvm install 4.2

* 安裝Ghost
curl -L https://ghost.org/zip/ghost-latest.zip -o ghost.zip unzip -uo ghost.zip -d /var/www/html/ghost chown -R nginx:nginx /var/www/html/ghost/ cd /var/www/html/ghost/ npm install --production cp config.example.js config.js vim config.js
    production: {
        url: 'http://blog.waringid.me',
        mail: {},
        database: {
            client: 'sqlite3',
            connection: {
                filename: path.join(__dirname, '/content/data/ghost.db')
            },
            debug: false
        },
        server: {
            host: '127.0.0.1',
            port: '2368'
        }
    },* 安裝PM2
npm install -g pm2 NODE_ENV=production pm2 start index.js --name "ghost" pm2 startup centos pm2 save systemctl reload nginx

五、測試
網站效果:http://blog.waringid.me。
另外有需要云服務器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內外云服務器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務器、裸金屬服務器、高防服務器、香港服務器、美國服務器、虛擬主機、免備案服務器”等云主機租用服務以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務可用性高、性價比高”等特點與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應用場景需求。
                當前名稱:在CentOS7上部署Ghost博客-創(chuàng)新互聯(lián)
                
                分享URL:http://chinadenli.net/article14/gehge.html
            
成都網站建設公司_創(chuàng)新互聯(lián),為您提供面包屑導航、定制網站、微信小程序、網站內鏈、關鍵詞優(yōu)化、品牌網站設計
聲明:本網站發(fā)布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經允許不得轉載,或轉載時需注明來源: 創(chuàng)新互聯(lián)