搭建LNMP服务
安装
nginx
mariadb、mariadb-server、mariadb-devel
php、php-fpm、php-mysql
启动Nginx、MariaDB、FPM服务;
并测试LNMP是否工作正常。
搭建两个不同域名的web服务
代理服务器:
搭建nginx服务
#vim ?/usr/local/nginx/conf/nginx.conf
......
http {
server_tokens off;
client_header_buffer_size ?1k;
large_client_header_buffers 4 4k;
include ??????mime.types;
default_type ?application/octet-stream;
upstream web {
server 201.1.2.100 ?weight=2 max_fails=1 fail_timeout=30;
}
server {
listen ??????80;
server_name ?localhost;
???????????charset utf-8; ??????????#access_log ?logs/host.access.log ?main; ???location / { ??????????proxy_pass http://web; ?????????proxy_set_header Host $host; ??主要配置,不写就会访问不到第二个虚拟主机 ???????index ?index.html index.htm; ???}
........
#nginx -s relod
在客户端访问
#vim /etc/hosts
调度器ip地址 ???????www.a.com ??????????www.b.com
用浏览器访问测试
用nginx来作反向代理(调度器)来访问虚拟web主机
原文地址:http://blog.51cto.com/13594742/2068221