Apache + resin's virtual host and Server Load balancer-Linux Enterprise Application-Linux server application information. The following is a detailed description. Author: peng Source: chinaunix
1. Preface
You are familiar with apache + resin and general configurations. I have read some articles on the Forum, which is more convenient. Here, I only need to write apache + resin to implement independent virtual hosts and load balancing of resin.
Objective: To use apache and resin as domain name-based virtual hosts and enable the Server Load balancer engine of resin. The resin Server Load balancer engine can actually start multiple java response processes and conduct Load Balancing through internal mechanisms.
4.1 configure apache:
# Vi/usr/local/apache2/conf/httpd. conf
---------------------------------------
DirctoryIndex index.html index. jsp
Adddefacharcharset Off
User nobody
Group nobody
NamevirtualHost 211.11.11.11
;
ServerAdmin peng.zhang@bj.china.com
DocumentRoot/data/web/xcity
ServerName xcity.chinaunix.com
ErrorLog logs/xcity.chinaunix.com-error_log
CustomLog logs/xcity.chinaunix.com-access_log common
;
;
ServerAdmin peng.zhang@bj.china.com
DocumentRoot/data/web/sports
ServerName sports.chinaunix.com
ErrorLog logs/sports.chinaunix.com-error_log
CustomLog logs/sports.chinaunix.com-access_log common
(In this case, I used 127.0.0.1 of the system, and bound four ports to achieve the balance. You can also use different IP addresses and the same port. For example:
;
;
;
;
;
;
Some people prefer to set a virtual machine for every java Process service in apache. We do not recommend it here. Doing so will lose the meaning of the engine itself .)
--- Note: This is a domain name-based VM. If it is an ip-based Vm, in;, it should be the ip address of the VM. That is to say, apache and resin should be consistent about the VM. Also, in resin, the web-app directory used by each virtual host is actually relative to the/directory under her home directory.
In linux, it is OK to directly put it under the boot level directory of the response.
6. Summary
Apache + resin should be a good java application platform. In practice, there are still many skills. I read some materials from the resin official forum, saying that resin3.x and later versions support image and html, which is faster than apache. I have tested this and I still feel a little lacking. Therefore, it is better to combine apache and resin on a large-scale release platform.
For the number of processes started on resin server Load balancer, I think it is still necessary to consider it based on the actual situation of your machine. If it is less than the effect, the machine system is also a load. In my opinion, four can be considered as a default choice.
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.