Install Nginx server in CentOS compilation mode
1. Install nginx related dependencies yum -y install gcc openssl-devel pcre-devel zlib-devel pcre-devel libtool gcc-c++ 2. Download and install nginx wget http://nginx.org/download/nginx-1.2.4.tar.gz tar zxvf nginx-1.2.4.tar.gz cd nginx-1.2.4 ./configure –help |more #View compiled parameter options user add www ./configure –user=www –group=www –prefix=/usr/local/nginx –with-http_stub_status_module –with-http_ssl_module make && make install 3. Set nginx configuration file vi /usr/local/nginx/conf/nginx.conf user www www; worker_processes 8; worker_cpu_affinity 00000001 00000010 00000100 00001000 00010000 00100000 01000000 10000000; pid /var/run/nginx.pid; error_log /usr/local/nginx/logs/error.log crit; worker_rlimit_nofile 65535; events { use epoll; worker_connections 65535; } http { include mime.types; default_type application/octet-stream; server_names_hash_bucket_size 128; keepalive_timeout 0; client_header_buffer_size 16k; client_max_body_size 32m; large_client_header_buffers 8 1024k; client_header_timeout 3m; client_body_timeout 3m; send_timeout 3m; connection_pool_size 256; request_pool_size 4k; output_buffers 16 128k; postpone_output 1460; fastcgi_connect_timeout 300; fastcgi_send_timeout 300; fastcgi_read_timeout 300; fastcgi_buffer_size 128k; fastcgi_buffers 16 256k; fastcgi_busy_buffers_size 512k; fastcgi_temp_file_write_size 512k; fastcgi_temp_path /dev/shm; open_file_cache max=65536 inactive=20s; open_file_cache_min_uses 1; open_file_cache_valid 30s; tcp_nodelay on; gzip on; gzip_min_length 1k; gzip_buffers 16 1024k; gzip_http_version 1.1; gzip_types text/plain application/x-Javascript text/css application/xml; log_format access ‘$remote_addr – $remote_user [$time_local] “GET http://$host$request_uri $server_protocol”‘ ‘$status $body_bytes_sent “$http_referer”‘ ‘”$http_user_agent” $http_x_forwarded_for’; server { listen 80; server_name_; location ~ / { …