日韩无码专区无码一级三级片|91人人爱网站中日韩无码电影|厨房大战丰满熟妇|AV高清无码在线免费观看|另类AV日韩少妇熟女|中文日本大黄一级黄色片|色情在线视频免费|亚洲成人特黄a片|黄片wwwav色图欧美|欧亚乱色一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時(shí)間:8:30-17:00
你可能遇到了下面的問題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
CentOS7.2搭建Ghost博客

因?yàn)槠綍r(shí)記錄一些文檔或想法基本使用 markdown 的語法,Mac 下推薦一款 markdown 的編輯器 Haroopad;上周無意發(fā)現(xiàn) Ghost 有支持 Mac 的桌面版本了,并且同樣開源 https://github.com/tryghost/ghost-desktop ,這樣后面記錄一些文檔也可以同步到網(wǎng)絡(luò)上就很方便了,于是重新搭建了一個(gè)。

Ghost 是基于 NodeJS 的開源博客平臺,由前 wordpress UI 部門主管 John O’Nolan 和 WordPress 高級工程師(女) Hannah Wolfe 創(chuàng)立,目的是為了給用戶提供一種更加純粹的內(nèi)容寫作與發(fā)布平臺。
#配置 NodeJS 環(huán)境
wget https://nodejs.org/dist/v6.9.1/node-v6.9.1-linux-x64.tar.xz
tar -xvf node-v6.9.1-linux-x64.tar.xz
#配置環(huán)境變量
vi /etc/profile
#輸入保存

#set for nodejs
export NODE_HOME=/opt/node-v6.9.1-linux-x64
export PATH=$NODE_HOME/bin:$PATH
export NODE_PATH=$NODE_HOME/lib/node_modules:$PATH

#保存退出
:wq
#生效
source /etc/profile
#檢查是否安裝成功
node -v
npm –v
#安裝Chost
wget https://ghost.org/zip/ghost-0.11.3.zip
unzip -uo ghost-0.11.3.zip -d ghost
#更換源
npm install -g cnpm --registry=https://registry.npm.taobao.org
#更換默認(rèn)db為 MySQL
cp config.example.js config.js
vi config.js

    // ### Production  修改為使用 MySQL 數(shù)據(jù)庫
    // When running Ghost in the wild, use the production environment
    // Configure your URL and mail settings here
    production: {
        url: 'http://my-ghost-blog.com',
        mail: {},
        database: {
            client: 'mysql',
            connection: {
                host    : '127.0.0.1',
                user    : 'username', //用戶名
                password : '', //密碼
                database : 'ghost', //數(shù)據(jù)庫名
                charset  : 'utf8'
            }
        },
        server: {
            // Host to be passed to node's `net.Server#listen()`
            host: '127.0.0.1',
            // Port to be passed to node's `net.Server#listen()`, for iisnode set this to `process.env.PORT`
            port: '2368'
        }
    },

#啟動(dòng)
yum install screen
screen -S ghost
cnpm install --production
cnpm start --production
#安裝Nginx
#http://nginx.org/en/download.html
#安裝編譯庫及依賴模塊
yum -y install gcc gcc-c++ autoconf automake make
yum -y install zlib zlib-devel openssl openssl--devel pcre pcre-devel
#安裝
cd /opt
wget http://nginx.org/download/nginx-1.10.2.tar.gz
tar zxvf nginx-1.10.2.tar.gz
cd nginx-1.10.2
./configure --prefix=/opt/nginx --with-http_stub_status_module --with-http_gzip_static_module
make && make install
#測試配置文件是否有錯(cuò)誤
/opt/nginx/sbin/nginx -t
#重新加載配置
/opt/nginx/sbin/nginx -s reload
#啟動(dòng)nginx
/opt/nginx/sbin/nginx
#停止nginx
/opt/nginx/sbin/nginx -s stop
#配置HTTPS 模塊
// --with-http_ssl_module
#配置

 

server {
    listen 80;
    server_name example.com;

    location / {
        proxy_set_header  X-Real-IP $remote_addr;
        proxy_set_header  Host      $http_host;
        proxy_pass        http://127.0.0.1:2368;
    }
}

 

#未解決問題
- forever 跟阿里 NodeJS 版本有點(diǎn)沖突
- CentOS 7.2 下配置 supervisor 有些問題 暫時(shí)使用 screen 代替
[program:ghost]
command = node /opt/ghost/index.js
directory = /opt/ghost
user = root
autostart = true
autorestart = true
stdout_logfile = /var/log/supervisor/ghost.log
stderr_logfile = /var/log/supervisor/ghost_err.log
environment = NODE_ENV="production"


網(wǎng)站標(biāo)題:CentOS7.2搭建Ghost博客
URL地址:http://www.5511xx.com/article/djjpphg.html