Debian install nginx and related packages

Source: Internet
Author: User

Debian installation of nginx and Its Related package Source: there is a problem with the load balancing algorithm of apache + tomcat cluster, the phenomenon is that apache allocates excessive pressure to local tomcat, another server's tomcat is very idle (the number of connections is an order of magnitude), so use nginx for front-end load balancing download nginx, I am under the nginx-1.4.1 into the decompressed directory compilation. /configure: report the lack of pcre Library back to install pcre, I under the pcre-8.33, or linux source code installation trilogy and then into nginx compilation, this return lack of zlib library knowledge apt-get installation failure, check the next said that the name is changed: zlib1g-dev, try again, and then failed, in short the lack of other associated packages, angry, with the source code installation method, the source code installation trilogy is still finally nginx compiled through, go to the objs directory, and the startup command is nginx (note that the default port is port 80, do not be snatched by other servers). Enter localhost in the browser and the welcome page appears, installation successful ======== The following is the cluster configuration Set to ======== modify nginx. conf, add multiple backend tomcat01 ...... 02 03 http {04 include mime. types; 05 default_type application/octet-stream; 06 07 # log_format main '$ remote_addr-$ remote_user [$ time_local] "$ request" '08 #' $ status $ body_bytes_sent "$ http_referer" '09 # '"$ http_user_agent "" $ http_x_forwarded_for "'; 10 11 # access_log logs/access. log main; 12 13 sendfile on; 14 # tcp_nopush on; 15 16 # keepalive_timeout 0; 17 ke Epalive_timeout 65; 18 19 # gzip on; 20 21 # ccq 6/5 add: tomcat_proxy22 upstream localhost {23 server localhost: 8081; 24 server localhost: 8080; 25} 26 # ccq 6/5 add: tomcat_proxy end27 28 server {29 listen 80; 30 server_name localhost; 31 ...... tomcat modifies the server. xml to prevent port conflict. Here is the second tomcat configuration. The First tomcat uses the default configuration. Add jvmRoute 01 ...... 02 <Server port = "9005" shutdown = "SHUTDOWN"> 03 ...... 04 <Connector port = "9080" protocol = "HTTP/1.1" 05 connectionTimeout = "20000" 06 redirectPort = "8443"/> 07 ...... 08 <Connector port = "9009" protocol = "AJP/1.3" redirectPort = "9443" jvmRoute = "tomcat1"/> 09 ...... 10 <Engine name = "Catalina" defaultHost = "localhost" jvmRoute = "tomcat2"> 11 ......

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.