You need nginx as the server to create a networked device. In this way, load balancing is nothing to worry about.
# User nobody; worker_processes 1; error_log/Users/lingyun/www/log/error. log; events {worker_connections 1024;} http {include mime. types; default_type application/octet-stream; # log_format main '$ remote_addr-$ remote_user [$ time_local] "$ request"' # '$ status $ response "$ http_referer"' # '"$ http_user_agent" "$ http_x_forwarded_for "'; # access_log logs/access. log main; sendfile on; # tcp_nopush On; # keepalive_timeout 0; keepalive_timeout 65; # upstream settings. Port 80 is listened to by default, and the address provided to the client is also the upstream myproject {server 127.0.0.1: 8000; server 127.0.0.1: 8001;} server {listen 80; server_name localhost; location/{proxy_pass http: // myproject ;}# Real web server configuration. For simplicity, the two web servers are configured in the same path, except the port. These addresses do not need to be opened to the client server {listen 8000; server_name localhost; location/{root/Users/lingyun/www/ko32example/site; index index.html index.htm;} location ~ \. Php $ {root/Users/lingyun/www/farm/public; fastcgi_pass 127.0.0.1: 9000; fastcgi_index index. php; fastcgi_param SCRIPT_FILENAME/Users/lingyun/www/farm/public $ fastcgi_script_name; include fastcgi_params ;}} server {listen 8001; server_name localhost; location/{root/Users/lingyun/www/ko32example/site; index index.html index.htm;} location ~ \. Php $ {root/Users/lingyun/www/farm/public; fastcgi_pass 127.0.0.1: 9000; fastcgi_index index. php; fastcgi_param SCRIPT_FILENAME/Users/lingyun/www/farm/public $ fastcgi_script_name; include fastcgi_params ;}}}
When multiple machines start the web server, modify the configuration (not tested yet ). Now you just need to run the streaming on a single machine.
Environment installation-related google Baidu :)
Browser Verification
Http: // localhost/test. php
Http: // localhost: 8000/test. php
Http: // localhost: 8001/test. php
Returns the content of phpinfo ().