Apache Virtual ip, apacheip

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.