1、安裝node和npm
rpm -ivh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-remi
curl --silent --location https://rpm.nodesource.com/setup_5.x | bash -
yum -y install nodejs
node -v
npm -v
結(jié)果:node-v5.12.0, npm-3.8.6
2、安裝gitbook gitbook-cli
git clone git@192.168.1.75:shuji.git
cd shuji
gitbook init
gitbook install
gitbook build
執(zhí)行成功后浅侨,在當(dāng)前目錄下回生成一個(gè)_book的目錄
3、配置nginx
server {
listen 80;
server_name shuji.163.cc;
access_log /opt/nginx/logs/shuji.log proxy;
location / {
root /opt/nginx/html/shuji/_book;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
最后訪問(wèn) http:// shuji.163.cc 就可以訪問(wèn)書(shū)籍了证膨。