Virtual Server implementation method and instance

Source: Internet
Author: User

Virtual Server: it is a single external portal, and many computers serve it internally. For those who use it, it is a machine with a single entry point. There are two specific implementation technologies: the virtual server at the application layer and the virtual server at the network layer.
I. The virtual server at the application layer is implemented using the forwarding at the application layer.Is equivalent to a proxy server, which is often referred to as a virtual server.
Implementation Method: apache's ProxyPass can be used to configure virtual servers. (Httpd. conf)
If a company's WWW server is a http://www.abc.com/make the following settings in httpd. conf:
ProxyPass/sales http: // 192.168.0.1/
ProxyPass/rd http: // 192.168.0.2/
ProxyPass/head http: // 192.168.0.3/
After the above settings take effect, the website for http://www.abc.com/rdwill be forwarded to http://192.168.0.2.
The website for http://www.abc.com/headwill be forwarded to http://192.168.0.2,
The customer does not directly interact with 192.168.0.x. All requests are forwarded through www.abc.com.
The process is as follows: client (http://www.abc.com/sales) <--> www.abc.com <--> 192.168.0.1'

2. virtual servers at the ip layer. It is implemented by Reverse masq at the ip layer.
Implementation Method: rewrite the destination ip address of the ip address header. The ip port forward in linux kernel 2.2.x is implemented. You need a management tool to manage this method. This method is also called reverse NAT.
Setting method:
1. In kernel compilation, select ip_port_forward (??)
2. Use ipmasqadm to set ip_port_forward.
Ipmasqadm-A www.abc.com: 80-R 192.168.0.1: 80
For more information, see man.
Ipmasqadm-A www.abc.com: 80-R 192.168.0.2: 80
3. Set ipchains
Ipchains-A forward-j MASQ-s 192.168.0.0/24
Ipchains-A forward-j MASQ-d 192.168.0.0/24
4. OK ..
Iii. test:
1 now you access http://www.abc.com/
2. The IP package you access is sent to www.abc.com, and the target address is 192.168.0.x. If x is 1 or 2, it can be selected by the system's load balancing algorithm.
3. After processing, the request packet is sent back to www.abc.com and then sent back to the customer.
In this way, the machine can be expanded... Your www server load is too large, and the above two methods can be used. The load on your telnet server is too large. You can use method 2.

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.