脚本宝典收集整理的这篇文章主要介绍了nginx下部署showdoc,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
1. 安装nginx服务器sudo apt-get install nginx -y
2. 启动服务sudo service nginx start
3. 安装php环境
sudo apt-get install -y php7.1 php7.1-FPM php7.1-gd php7.1-mcrypt php7.1-mbstring php7.1-MySQL php7.1-pdo php7.1-SQLITe
4. 配置nginx
- 编辑php.conf文件
sudo vim /etc/nginx/conf.d/php.conf
新增下边内容
server {
listen 80;
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
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;
}
}
- 编辑default文件
vim /etc/nginx/sites-available/default
去掉下边这个配置的注解
location ~ .php$ {
include snipPEts/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php7.1-fpm.sock;
}
5. 刷新配置sudo service nginx reload
6. rz
命令上传代码到/var/www/html
7. 给showdoc赋权限chmod -R 777 showdoc
8. 访问xx.COM/showdoc/web/#/
以上是脚本宝典为你收集整理的nginx下部署showdoc全部内容,希望文章能够帮你解决nginx下部署showdoc所遇到的问题。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。