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/#/
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。