快速部署showDoc文档工具

安装Nginx + PHP

yum install nginx

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

安装完后,在/etc/nginx/conf.d新建文件127.0.0.1.conf

cd /etc/nginx/conf.d
vim 127.0.0.1.conf

 粘贴内容

server {
        listen       80;
        server_name  127.0.0.1;
        root         /var/www/html;
        index index.php index.html
        error_page  404              /404.html;
        location = /40x.html {
        }
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
        }
        location ~ \.php$ {
            root           /var/www/html;
            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;
        }
    }

保存。然后执行命令:

service nginx start

service php-fpm start

chkconfig php-fpm on

chkconfig nginx on

进入目录/var/www/html(不存在则新建),

将ShowDoc上传

给服务器开启ftp服务,用xftp进行上传代码,代码连接在这里:

https://github.com/star7th/showdoc

如何给你的服务器开启ftp服务,具体步骤可以参考这里

https://blog.csdn.net/zhangzeshan/article/details/89574131

上传完毕之后,查看/var/www/html下的文件 可以出现这些内容

修改/etc/nginx/nginx.conf 的内容:

vim /etc/nginx/nginx.conf

粘贴内容

user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;

include /usr/share/nginx/modules/*.conf;

events {
    worker_connections 1024;
}

http {
    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    sendfile            on;
    tcp_nopush          on;
    tcp_nodelay         on;
    keepalive_timeout   65;
    types_hash_max_size 2048;

    include             /etc/nginx/mime.types;
    default_type        application/octet-stream;
    include /etc/nginx/conf.d/*.conf;

    server {
        listen       80;
        server_name  127.0.0.1;
        root         /var/www/html;
        index index.php index.html
        error_page  404              /404.html;
        location = /40x.html {
        }
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
        }
        location ~ .php$ {
            root           /var/www/html;
            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;
        }
    }
}

 

配置好了之后,访问你的公网ip/install,出现

快速部署showDoc文档工具_第1张图片

那么就需要给上述的这些目录进行权限的改写

chmod a+w showdoc/install

chmod a+w showdoc/Sqlite

chmod a+w showdoc/Sqlite/showdoc.db.php

chmod a+w showdoc/Public/Uploads/

chmod a+w showdoc/Application/Runtime

chmod a+w showdoc/server/Application/Runtime

chmod a+w showdoc/Application/Common/Conf/config.php

chmod a+w showdoc/Application/Home/Conf/config.php

 

然后访问:http://ip/web/#/  就可以了


欢迎指出错误  觉得有用的 加个关注 或者 点个赞哦!

你可能感兴趣的:(事件)