CentOS 7 安装ShowDoc

ShowDoc是一个在线API文档、技术文档工具,用ShowDoc可以非常方便快速地编写出美观的API文档。
详细介绍

基于 Nginx PHP 环境安装 ShowDoc

安装 Nginx + PHP

yum -y install nginx php php-gd php-fpm php-mcrypt php-mbstring php-mysql php-pdo

vim /etc/nginx/conf.d/showdoc.conf
server {
    listen       80;
    server_name  showdoc.edevops.top;       
    root         /var/www/html/showdoc;                                         
    index        index.php index.html;

    location ~ \.php$ {
        root           /var/www/html/showdoc;
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        include        fastcgi_params;
    }
    location ~ /\.ht {
        deny  all;
    }
}

vim /etc/nginx/nginx.conf
http {
    ......
    ......
    include /etc/nginx/conf.d/*.conf;
    ......
    ......
}

安装ShowDoc


cd /var/www/html
git clone https://github.com/star7th/showdoc.git

执行命令赋予 showdoc 部分目录的写权限
chmod -R a+w showdoc/install
chmod -R a+w showdoc/Sqlite

基于Docke或Composer方式安装的请自行查询相关文档。

开启 NGINX PHP-fpm 服务

systemctl start php-fpm.service
systemctl start nginx.service
systemctl stop firewalld.service
systemctl disable firewalld.service
setenforce 0
sed -i '/SELINUX/s/enforcing/disabled/' /etc/selinux/config

systemctl enable php-fpm.service
systemctl enable nginx.service

以上步骤执行完毕,可以通过浏览器访问 http://showdoc.edevops.top/install/ ,进行语言的选择以后即可通过 http://showdoc.edevops.top 查看站点效果。

迁移

cd /var/www/html
tar zcf showdoc.migration.gz  showdoc
scp showdoc.migration.gz User@NewServerIP:/var/www/html
登录新服务器到/var/www/html目录下解压showdoc.migration.gz 然后参考上边的安装步骤安装即可

原文链接

你可能感兴趣的:(CentOS 7 安装ShowDoc)