A preliminary understanding of nginx

nginx

High-performance HTTP reverse proxy server

Service-oriented: 1, the connection is successful: 2,3 seconds (user experience)

Directory tree structure "Taobao years"

nginx can support 50,000 concurrent links

apache is a simultaneous multi-process model, a process corresponding to a connection; Nginx is asynchronous, a plurality of connections (million level), equal to the number of physical processes and CPU cores.

 

tar zxvf tengine-2.1.0.tar.gz

yum insrall gcc pcre-devel openssl-devel -y

./configure --prefix=/usr/nginx

The system can open the maximum number of files and memory proportional to the size. 1G ---- 10 the number of files Wan

uliimit -a system limits

set the system constraints ulimit -SHn 65535

nginx.conf profile

worker_processes 1 Number of processes

log_format set the log format

gzip compression computer performance speed broadband transducer

Supports virtual server nginx server

nginx can be distributed to more than one port using links

server {

listen 80;

server_name www.360.com

location / {

root /mnt;

autoindex on

}

}

cd nginx/logs/

tail -f access.log

Only the regular and ordinary match match

Defines ordinary ^ - match no longer matches the regular, exact match will no longer regular

Uri ------- behind the port sector

url ----- including port link

 

scp -r java/[email protected]: / usr / copy network

vi ./bash_profile set environment variables

location / {

proxy_pass http://laoxiao;

index index.jsp;

}

upstream laoxiao {

service http://192.168.146.111:8080

}

<%

String username=(String)session.getAttrobute("user");

if(username==null){

username="zs";

session.setAttribute("user",user);

}else{

username=username+"+";

session.setAttribute("user",user);

}

%>

yum -y mencached

scp ./*.jar ~/tomcat/lib/

route add default gw 192.168.9.2 Gateway settings

-100 Tomcat tail / logs / catalina.out Tomcat log file

memcached sharing session

–memcached -d -m 128m -p 11211 -l 192.168.9.11 -u root -P /tmp/

Guess you like

Origin www.cnblogs.com/huzicourenao/p/11002095.html