Virtual Web Host:
Build LNMP Service
Installation
Nginx
MARIADB, Mariadb-server, Mariadb-devel
PHP, PHP-FPM, Php-mysql
Start Nginx, MariaDB, FPM service;
and test whether the LNMP is working properly.
Build two Web services with different domain names
Proxy Server:
Build Nginx Service
#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
On Client Access
#vim/etc/hosts
Scheduler IP Address www.a.com www.b.com
Accessing Tests with a browser
Use Nginx as the reverse proxy (scheduler) to access the virtual Web host