centos 6.9安装gitbook

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
结果:node-v5.12.0, npm-3.8.6 

2、安装gitbook gitbook-cli

git clone [email protected]:shuji.git
cd shuji
gitbook init
gitbook install
gitbook build

执行成功后,在当前目录下回生成一个_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;
  }
}

最后访问 http:// shuji.163.cc 就可以访问书籍了。

你可能感兴趣的:(centos 6.9安装gitbook)