PHP project to deploy Linux servers

One. Operating Environment

  • Centos7 x64
  • lnmp (Linux , Nginx , Mysql , PHP/Python)

two. Modify the configuration and installation dependent

Installation Lnmp environment integrated package: https://lnmp.org/install.html

wget -c http://soft.vpser.net/lnmp/lnmp1.4.tar.gz && tar zxf lnmp1.4.tar.gz && cd lnmp1.4 && ./install.sh lnmp


Add, delete virtual hosts and pseudo-static management: https://lnmp.org/faq/lnmp-vhost-add-howto.html

lnmp vhost add 、 lnmp vhost list 、 lnmp vhost del


LNMP default Web site configuration file: /usr/local/nginx/conf/nginx.conf

LNMPA default Web site configuration file: /usr/local/nginx/conf/nginx.conf and /usr/local/apache/conf/extra/httpd-vhosts.conf

LAMP default Web site configuration file: /usr/local/apache/conf/extra/httpd-vhosts.conf


Related:

TP5 need to set up anti-cross directory settings: https://lnmp.org/faq/lnmp-vhost-add-howto.html


On LNMP 1.4 if you do not use anti-cross directory or modify the anti-cross directory directory .user.ini also need to /usr/local/nginx/conf/fastcgi.conf inside fastcgi_param PHP_ADMIN_VALUE "open_basedir = $ document_root /: / tmp / : / proc / "; # added or deleted before the trekking diverted need to restart nginx.


1
/usr/local/php/etc/php.ini

Disable_functions found the back of the scandir delete function.

lnmp restart


2
/ usr / local / nginx / conf / vhost / domain .conf /


3
include enable-php.conf;

change into

include enable-php-pathinfo.conf;


4 nginx configuration


server
    {
        listen 80 default_server;
        #listen [::]:80 default_server ipv6only=on;
        #server_name _;
        #server_name 127.0.0.1;
        server_name 服务器ip;
        index index.html index.htm index.php;
        root /data/wwwroot/项目名/;

        include enable-php.conf;

    location / {
          #autoindex  on;
          if (!-e $request_filename){
            rewrite  ^(.*)$  /index.php?s=/$1  last;
          }
        }

    }


5 website directory access points to public


6 Set the relevant directory permissions

chmod -R 777 directory


7 If you need to use Redis PHP environment you need to install the extension support Redis

https://lnmp.org/faq/addons.html

installation

Directory after entering lnmp unpack, do: ./ addons.sh install redis

Guess you like

Origin www.cnblogs.com/chaoqi/p/11103350.html