第一步 :
在/home/www/下新建文件夹 上传项目
第二步:
解压项目
Linux常用格式:zip,tar.gz
命令 :unzip 项目名称
第三步 :
找到 nginx 的conf配置
一般 nginx的路径为/usr/local/nginx/conf/vhost
查找命令:
命令 : where is nginx
添加 域名.cnf文件 例如 pingan.weizhan360.cn.cnf
文档内容如下:
server {
listen 80;
server_name pingan.weizhan360.cn;#这里是站点url
root /home/www/pingan;#这里是站点根目录
location / {
index index.php index.html index.htm;#这里设置站点默认文档
if (!-e $request_filename){
rewrite ^/appdown/download /index.php?r=appdown/download last;
}
}
location @rewrite {
rewrite (/[a-z0-9]+/)(.+) $1index.php/$2;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ .php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /home/www/pingan/$fastcgi_script_name;
include fastcgi_params;
}
location ~ /.ht {
deny all;
}
}
第四步 :设置项目文件的权限 chomd 777 文件名
第五步:重新启动nginx
重启命令 #/usr/local/nginx/sbin/nginx -s reload