nginx下部署showdoc
2024-10-21 17:46:08
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/#/
原文地址:https://segmentfault.com/a/1190000016196743
最新文章
- HTML基本元素(一)
- iOS富文本
- 基于UDP协议的程序设计
- Cucumber
- Windows CMD命令大全
- HDU 3065 病毒侵袭持续中
- 集合ArrayList双色球练一练(自己的方法,太麻烦)
- tabbar动画切换
- IDE eclipse PyDev插件安装
- 第一章 JQuery概述
- 自学Linux Shell2.1-进入shell命令行
- Machine Learning 学习笔记2 - linear regression with one variable(单变量线性回归)
- StringBuffer 详解 (String系列之3)
- spring boot 配置全局日期类型转换器
- Web前端开发最佳实践系列文章汇总
- centos firewall-cmd常用命令
- flashback query闪回数据
- AIX中查找端口号和进程
- iOS开发之--打印一堆奇怪东西的解决方案
- 在exsi6.0中安装debian8.1 64位 无界面服务器版.