provides services. After a while, the old process service is automatically shut down after it ends, and the new process continues to serve. However, this method also has some disadvantages. If the configuration file is incorrect or the resource conflict occurs, the restart fails, but nginx does not have any prompts! This will often find that the modified configuration file does not take effect, and it is difficult to find the problem.
So, I finally f
/sbin/php-fpm-tchmod 755/etc/init.d/php-fpm/ETC/INIT.D/PHP-FPM start NETSTAT-LNPT See if there is a listening 192.168.239.140:9000Mkdir-p/tmp/tmpvim/tmp/tmp/index.php Create the dynamic test file, write the followingDongtaiqingqiu 12. The second installation of PHP (the installation and compilation are unchanged, the configuration file IP changed to 192.168.239.144:9000 last index.php Dongtaiqingqiu 1 to DO
nginx-1.4.7
./configure--prefix=/usr/local/nginx--without-http_memcached_module--user=www--group=www--with-http_stub_ Status_module--with-openssl=/usr/--with-pcre=/usr/local/src/pcre-8.34--add-module=. /ngx_cache_purge-2.1 #配置
Note:--with-pcre=/usr/local/src/pcre-8.34 points to the source package decompression path, not the installation path, otherwise it will be an error
Make #编
. $ Binary_remote_addr uses binary to store the client address. 1 m can store 32000 concurrent sessions. Limit_conn_zone $ binary_remote_addr zone = addr: 5 m; # set the maximum number of connections for the given key. Here the key is addr, and the value we set is 100, that is, we allow each IP address to open up to 100 connections at the same time. Limit_conn addr 100; # limit the speed of each connection to 100 kb. If an IP allows two concurrent connections, this IP address is limited to 200 k
normal webserver.Take the default configuration file (conf/nginx. conf. default) after nginx source code compilation and installation as an example to describe important configuration items.
#user nobody;worker_processes 1;#error_log logs/error.log;#error_log logs/error.log notice;#error_log logs/error.log inf
/Etc/php-fpm.d/www. conf configuration notes, php-fpm.dwww.conf
1. The rlimit_files value in the php-fpm configuration file must be consistent with the number of open connections of the system.
1) view the number of opened system files
[Root @ iZ94eveq0q4Z ~] # Ulimit-n65535
2) Check the rlimit_files value in the php-fpm configuration file.
; Set open file descriptor rlimit # rlimit sets the open file descr
Add code in the middle of the http{} of the nginx.conf file under the Conf directory, using the same principle as the Nginx reverse proxy
add_header Access-Control-Allow-Origin*; add_header Access-Control-Allow-Headers X-Requested-With; add_header Access-Control-Allow-Methods GET,POST,OPTIONS;
'). addclass (' pre-numbering '). Hide (); $ (this). addclass (' has-numbering '). Parent (). append (
/var/tmp/nginx/{client, proxy, fastcgi}Mkdir: created directory '/var/tmp/nginx'Mkdir: created directory '/var/tmp/nginx/client'Mkdir: created directory '/var/tmp/nginx/proxy'Mkdir: created directory '/var/tmp/nginx/fastcgi'[Root @ www ~] #
Run the following command to view the Help file:
[Root @ www
correct:
# / usr / local / nginx / sbin / nginx -t
If the following two lines of information appear on the screen, the configuration file is correct:
the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
the configuration file /usr/local/nginx/
/openssl/openssl-1.1.0e
//execute make command
make
Execute the Make install command
make install
Nginx common commands
//Test profile
install path/nginx/sbin/nginx-t
//start command
/nginx/sbin/
In Nginx, Proxy is used to implement the reverse proxy, upstream is used to achieve load balancing.For example, there are two servers, the Nginx server as a proxy server, execute. php files on the Apache server, the client sends the request to the Nginx server first, if the request is a. php file, the request is forwarded through the proxy pass to Apache server,
tar包并解压 in order to support Nginx's rewrite function
[Root@typecodes nginx-1.9.0]# wget-c http://git.typecodes.com/libs/php/pcre-8.36.tar.gz tar-zxf Pcre-8.36.tar.gz
###### #下载zlib的tar包并解压 in order to support Nginx's gzip compression function
[Root@typecodes nginx-1.9.0]# wget-c http://git.typecodes.com/libs/nginx/zlib-1.2.8.tar.gz
[Root@typecodes
-http_ssl_module make install Problem: is already installed Nginx, how to reconfigure the third-party module, find a write a very comprehensive blog!http://blog.csdn.net/ystyaoshengting/article/details/48436409 How to install nginx Third party module--add-module(./configure --prefix=/Your installation directory --add-module=/third-party module directory)Installation may cause error without installi
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.