Notes
1.0.0
1.0.0
  • Introduction
  • Commands
    • cd
    • df
    • du
    • fc-cahe
    • ifconfig
    • ip
    • ls
    • lsb_release
    • mkdir
    • mksquashfs
    • mount
    • ping
    • pwd
    • rm
    • sar
    • sudo
  • Linux C
    • Preprocessor
    • Keywords
    • Kernel
      • Ftrace
      • Watchdog
  • Python
    • general
      • Decorator
      • Generator
      • Iterator
      • Lambda
    • Download
    • NIC
  • Network
    • Protocol
      • Link layer
      • IP
      • ARP
      • ICMP
    • Proxy
      • Cntlm
      • Proxychains4
      • ShadowSocks
    • Tools
      • iperf
      • tc
      • Wireshark
    • Apps
      • samba
      • tftp
  • Software
    • Atom
    • Chrome
    • Docker
    • Git
    • Gitbook
    • Hexo
    • Nodejs
    • Teraterm
    • Tex
    • Tmux
    • VIM
    • VSCode
  • Database
    • MongoDB
  • Web
    • CSS
    • LNMP
  • Tools
    • common
    • programming
  • Ubuntu
    • Add user
    • AWS EC2
    • FAQ
    • Installer
    • Shell
    • Shell scripts
    • Themes
    • VPS
  • Windows
    • PowerShell
    • CMD
    • FAQ
  • Aphorisms
  • Book List
  • Favorites
  • Appendix
    • ASCII
    • GSM
Powered by GitBook
On this page

Was this helpful?

  1. Web

LNMP

change root dir of nginx on centos-6.9

# expect dir : /home/litreily/web/www/html

# update nginx config
$ sudo cat /etc/nginx/conf.d/default.conf
#
# The default server
#

server {
    listen       80 default_server;
    listen       [::]:80 default_server;
    server_name  127.0.0.1;

    root        /home/litreily/web/www/html;
    # Load configuration files for the default server block.
    include /etc/nginx/default.d/*.conf;

    location / {
        index index.php index.html index.htm;
    }

    error_page 404 /404.html;
        location = /40x.html {
    }

    error_page 500 502 503 504 /50x.html;
        location = /50x.html {
    }

    location ~ \.php$ {
        try_files       $uri =404;
        fastcgi_pass    127.0.0.1:9000;
        fastcgi_index   index.php;
        fastcgi_param   SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include         fastcgi_params;
        include         fastcgi.conf;
    }

}

# update php config, it's very important
$ sudo vi /etc/php-fpm.d/www/conf
user = litreily
group = litreily


# restart php server and nginx
$ sudo service php-fpm restart
$ sudo service nginx restart
PreviousCSSNextTools

Last updated 5 years ago

Was this helpful?

ref:

https://serverfault.com/questions/517190/nginx-1-fastcgi-sent-in-stderr-primary-script-unknown?newreg=be2687ea0ed343f6a32439c7b749a0f4