安装pcre
1.下载pcer-8.36.tar.gz
2.解压
3.apt-get update
4.apt-get install gcc
5.apt-get install build-essential
6./configure
7.make
8.make install
9.下载nginx
10.apt-get install zlib1g.dev
11../configure
12.make
13.make install
web配置(多台web服务器)
1.apt-get update
2.apt-get install apache2
3.apt-getinstall php5 libapache2-mod-php5
4.cd /etc/apache2
5.vi apache2.conf ,末尾添加 ServerName localhost:80
6.service apache restart
7./var/www/html中添加php文件
配置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.文件http标签中末尾加上 include extra/upstream01.conf;
8.默认的server删掉,server标签开始往下删
9.vi umstream01.conf,添加如下内容
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.启动nginx
    
        
版权声明:本文为博主原创文章,未经博主允许不得转载。
以上就介绍了ubuntu server简单配置nginx负载均衡,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。
                        
                        每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
                Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号