• nginx配置网站不用conf.d目录


    nginx配置网站不用conf.d目录

    yum install nginx php-fpm -y
    systemctl   start nginx
    systemctl   enable nginx
    systemctl   start php-fpm
    systemctl   enable nginx
    
    cd /etc/nginx
    mv nginx.conf   nginx.conf.bak
    grep -Ev  '^$|#'   /etc/nginx/nginx.conf.default   >/etc/nginx.conf
    
    -rw-r--r-- 1 root root 3610 Mar  6  2018 win-utf
    [root@oldboy /]# cat /etc/nginx/nginx.conf
    worker_processes  1;
    user www;
    events {
        worker_connections  1024;
    }
    http {
        include       mime.types;
        default_type  application/octet-stream;
        sendfile        on;
        keepalive_timeout  65;
        server {
            listen       80;
            server_name  localhost;
                root   /code/upload;
                index  index.html index.htm index.php;
    location ~ .php$ {
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        include        fastcgi_params;
    }
    
        }
    }
    
    location 哪里怎么看:
    cat  /etc/nginx/nginx.default   里面有
    
    useradd   www
    vim /etc/php-fpm.d/www.conf
    把里面的user与group改成www用户
    
    nginx  -t检测
    systemctl restart nginx
    systemctl restart php-fpm
    
    mkdir -p /code
    程序源码放进去
    chown  -R www.www   /code
    
    最后重启nginx与php-fpm
    
  • 相关阅读:
    Java集合类初始容量、加载因子、扩容增量
    并发之原子性、可见性、有序性
    多线程面试题
    MySQL引擎及选择
    SHA和MD5的Salt
    基于SSM的单点登陆05
    基于SSM的单点登陆04
    基于SSM的单点登陆03
    基于SSM的单点登陆02
    基于SSM的单点登陆01
  • 原文地址:https://www.cnblogs.com/zuoxiaodragon/p/12773429.html
Copyright © 2020-2023  润新知