centos 7 lnmp环境

1.安装nginx

https://mp.csdn.net/postedit/80763623

2.安装Mysql 5.7*

https://mp.csdn.net/postedit/80776403

3.安装PHP7.1*

https://mp.csdn.net/postedit/80776957

4.配置nginx

在/usr/local/nginx/conf 中,编辑nginx.conf, 在http{....}中加入

include vhost/*.conf
新建vhost文件夹,添加 网站域名配置  xxx.conf,内容如下
server {
    listen       80;
    server_name  xxx;
    #access_log  /var/log/nginx/log/host.access.log  main;

    location / {
        root   /var/www/html/opsun;
        index index.php index.html index.htm;
    }

    #error_page  404              /404.html;

    # redirect server error pages to the static page /50x.html
    #
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /var/www/html/opsun;
    }

    # proxy the PHP scripts to Apache listening on 127.0.0.1:80
    #
    #location ~ \.php$ {
    #    proxy_pass   http://127.0.0.1;
   #}

    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    #
    location ~ \.php$ {
        root           /var/www/html/opsun;
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  /var/www/html/opsun/$fastcgi_script_name;
        include        fastcgi_params;
    }

    # deny access to .htaccess files, if Apache's document root
    # concurs with nginx's one
    #
    #location ~ /\.ht {
    #    deny  all;
    #}
}


猜你喜欢

转载自blog.csdn.net/qazx123q/article/details/80802800