Required software name and version: pcre-8.02.tar.gz nginx-0.7.58.tar.gz Nginx_upstream_hash-0.3.1.tar.gz
1. Install pcre tar -zxvf pcre-8.02.tar.gz cd pcre-8.02/./configure make && make install
2, install url_hash patch for nginx tar -zxvf nginx-0.7.58.tar.gz tar -zxvf Nginx_upstream_hash-0.3.1.tar.gz cd nginx-0.7.58/patch -p0 < /var/tmp/loojoy/nginx_upstream_hash-0.3.1/nginx.patch
3. Install nginx groupadd Www useradd www -g www ./configure --prefix=/usr/local/webserver/nginx \\ --user=www \\ --group=www \\ --add-module=/var/tmp/loojoy/nginx_upstream_hash-0.3 .1 \\ --with-http_ssl_module \\ --with-http_stub_status_module
4, check if the configuration file generated by nginx is correct /usr/local/webserver/nginx/sbin/nginx -t
5, start nginx If nginx.conf check, then start nginx. /usr/local/webserver/nginx/sbin/nginx 6. View port 80 netstat -ant
7. Access through the browser: http://your_nginx_server_ip/If you can access it normally, nginx is successfully installed.
8, modify the nginx configuration file as follows:
------------------- url_hash forwarding mode nginx.conf---- ---------------- user www www worker_processes 10 error_log logs/error.log #error_log logs/error.log notice #error_log logs/error.log info #pid logs/nginx.pid Worker_rlimit_nofile 51200 events { use epoll worker_connections 51200 } http { include mime.types default_type application/octet-stream keepalive_timeout 120 tcp_nodelay on upstream your.website.name{ server your.tomcat.server.ip1:8080 server your.tomcat.server.ip1 :8080 hash $request_uri } server { listen 80 server_name your.website.name location /{ proxy_pass http://your.website.name proxy_set_header Host $host proxy_set_header X-Real-IP $remote_addr proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for } Log_format www_gjw_com '$remote_addr - $remote_user [$time_local] $request ' '"$status" $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"' # Access_log /data1/logs/www.log www_gjw_com location /nginx_status { stub_status on access_log off } } } -------------------[E]url_hash forwarding method nginx.conf[ ,null,null,3],E]--------------------
9, add nginx start, close, restart script ------------ -------[S]url_hash Forwarding mode nginx startup, shutdown script [S]-------------------- #!/bin/sh CWD=` Pwd` case $1 in start) /usr/local/webserver/nginx/sbin/nginx ; stop) kill -2 `ps -ef|
Grep "/usr/local/webserver/nginx/sbin/nginx"|
Grep -v "grep"|
Awk '{print $2}' ` ; restart) cd "$CMD" $0 stop $0 start ; *) echo $"Usage: $0 {start|
Stop|
Restart}" exit 1 esac exit 0 -------------------[E]url_hash forwarding mode nginx startup, shutdown script [E]-------- ------------ Change the file permissions chmod u+x nginx.sh Start nginx ./nginx.sh start Restart nginx ./nginx.sh restart Close nginx ./nginx.sh stop
Symptom: Tianyi F41 series will suddenly blue screen when the game of Warcraft is
This trial is the installation process of IIS6.0 version on Windows Service 2003.
I believe that you are familiar with the Remote Desktop feature in Wi
Error: The installer encountered an error while setting up reporting service and share point exclusi
Using DOS commands to remotely manage FTP servers
Windows 2000 server IIS open the parent path step
Three ways to resolve IIS 6 directory check security vulnerabilities
Maintaining server stability requires attention to seven major issues
Server large traffic troubleshooting method
Create "User Isolation" Mode FTP Site
Protect against four levels of attacks to ensure Linux server security
Tips: Considerations for Hyper-V Virtual Machine Deployment
How to ensure content update and synchronization after using CDN service?
The five questions that the rookie on the road server must understand
Ban web and other directories to execute exe, bat, com methods
Don't please! Many users make my Vista system self
Win10 system Edge browser is not smooth how to solve
Win7 can not open the application after upgrading to win10 system
Virtual machine installation and running Windows 8 system Raiders
Play Windows7 Parental Control
Windows Server 2003 DHCP server installation and simple configuration graphic tutorial
Win7 system play game prompts "graphics card driver stops responding" how to do
How to enable BitLocker on Windows 8 system?
How does the Win10 system add this computer to the home folder