Apache Virtual ip, apacheip
Reference http://blog.sina.com.cn/s/blog_5d8ca1e90100hnpv.html
<VirtualHost 127.0.0.1: 80>
DocumentRoot C:/xampp/htdocs/yiyunmap
ServerName 127.0.0.1: 80
</VirtualHost>
<VirtualHost 127.0.0.2: 80>
DocumentRoot C:/xampp/htdocs/user
ServerName 127.0.0.2: 80
</VirtualHost>
<Directory "C:/xampp/htdocs/yiyunmap">
Options Indexes FollowSymLinks Multiviews
AllowOverride All
Order Allow, Deny
Allow from all
</Directory>
<Directory "C:/xampp/htdocs/user">
Options Indexes FollowSymLinks Multiviews
AllowOverride All
Order Allow, Deny
Allow from all
</Directory>
Configure the Apache service for a Linux IP address-based Virtual Host
Step 1: set IP addresses for different NICs in the host
# Ifconfig eth0 192.168.149.1
# Ifconfig eth0: 1 192.168.149.2
Step 2: In the httpd. conf configuration file, set different
<VirtualHost> Configuration segment
<VirtualHost 192.168.149.1>
ServerAdmin root@abc.com
DocumentRoot/www/abc
ServerName www.abc.com
</VirtualHost>
<VirtualHost 192.168.149.2>
ServerAdmin root@good.com
DocumentRoot/www/good
ServerName www.good.com
</VirtualHost>
Step 3: create a home page file for different virtual sites
# Echo 'Welcome to abc'>/www/abc/index.html
# Echo 'Welcome to good'>/www/GOOD/index.html
Step 4: restart the Apache service
# Service httpd restart
The company built an apache + tomcat cluster. However, if apache is down, the cluster becomes invalid.
Apache is mainly used for Application Layer software, and LVS is mainly used for network layer and transmission layer software. Although forwarding can be performed, the positioning is different:
Apache is mainly used as a WEB service, which is relatively weak in terms of high availability and scalability. Its forwarding function is an additional feature for expansion;
LVS is a Linux kernel-Based Server Load balancer system that combines keepalived, heartbeat + Ldirectord, Red Hat piranha, and other highly available suites. It is specialized in load balancing, high availability, and scalability, it is often used for high-concurrency WEB Services.