Ubuntu server simply configures nginx load balancing

WBOY
Release: 2016-08-08 09:20:44
Original
1088 people have browsed it

Install pcre
1. Download pcer-8.36.tar.gz
2. Unzip
3.apt-get update
4.apt-get install gcc
5.apt-get install build-essential
6./configure
7. make
8.make install
9.Download nginx
10.apt-get install zlib1g.dev
11../configure
12.make
13.make install
web configuration (multiple web servers)
1.apt- get update
2.apt-get install apache2
3.apt-getinstall php5 libapache2-mod-php5
4.cd /etc/apache2
5.vi apache2.conf , add ServerName at the end localhost:80
6.service apache restart
7. Add php file to/var/www/html
Configure nginx
1.echo "/usr/local/lib" >> /etc/ld.so.conf
2.tail -l /etc/ld .so.conf
3.ldconfig
4.cd /usr/local/nginx/conf/
5.mkdir extra
6.vi nginx.conf
7. Add include extra/upstream01.conf at the end of the file http tag;
8. Delete the default server and start deleting the server label downwards
9.vi umstream01.conf, add the following content

upstream proxy {
server 10.0.0.17:80 weight=5;
server 10.0.0.18:80 weight=5;
server 10.0.0.19:82 weight=15;
}

server {
listen 80;
server_name blog.etiantian. org;
location / {
proxy_pass http://proxy;
}
}
10. Start nginx

Copyright Statement: This article is an original article by the blogger and may not be reproduced without the blogger's permission.

The above introduces the simple configuration of nginx load balancing on ubuntu server, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!