Use of named virtualhost
oortdg Mar 20, 2012 2:55 AMHi,
It took me some time to investigate how to use mod_cluster but the most of it works now. I started with the apache server from the mod_cluster download and a as7 instance on the same machine. Indeed this works. The next step was apache on one machine and as7 on another (virtual) machine. Here I had a big problem with multicast. I use Opensuse(12.1) but when you Google on Opensuse and multicast it seems not possible only on the enterprise release. Later on I find out that a simple change in the /etc/sysctl.conf file (change the line with net.ipv4.ip_forward =0 to net.ipv4.ip_forward = 1) on the server will do the trick.
The next step use named virtual host and here I encounter lots of problems. And of course it has also to do with my lack of experience. Change the downloaded apache server to use named virtual host was one problem. So my first step was use the apache httpd server of the Opensuse release (2.2.15), add the modules for modcluster named in the documentation.
First activate an ip-based application. This worked.
The second step is to add a virtual host a simple html file with "it works", add a name in the host file.
The next step: use that named virtual host to reach my as7 server. On that server I change the settings (form localhost to 0.0.0.0) to reach also the admin app of the as7 on xxx.xxx.xxx.xxx/ and my app on xxx.xxx.xxx.xxx/simple. And this works. So I could type the named virtual host say http://application and I get the page you normally get on localhost:8080 and http://application/simple Ii get my simple JSF app that also works as Ii expected.
But now the last step my simple app must on the root of the address http:/application must give my Welkom file of my JSF app so what apache must do is listen to http://application and redirect to htttp://xxx.xxx.xxx.xxx:8080/simple. I thought change the named virtual host settings little bit. So my line : ProxyPass / balancer://mycluster stickysession=JSESSIONID|jsessionid nofailover=On becomes than ProxyPass / balancer://mycluster/simple stickysession=JSESSIONID|jsessionid nofailover=On and the same for the line with ProxyPassReverse. But this don't works. http://application gives me the as7 page and http://application/simple gives me my working jsf app.
So is there somebody who can gives me some hints to solve this.
----------------------
The failing settings for apache are :
<VirtualHost 192.168.0.190:8888>
<Location />
Order deny,allow
Deny from all
Allow from 192.168.0
</Location>
KeepAliveTimeout 60
MaxKeepAliveRequests 0
ManagerBalancerName mycluster
ServerAdvertise On
EnableMCPMReceive
</VirtualHost>
named virtual host:
<VirtualHost *>
ServerName application
ErrorLog /var/log/apache2/jboss_a/error.log
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\" %I %O" extra
CustomLog /var/log/apache2/jboss_a/access.log extra
ProxyPass / balancer://mycluster/simple stickysession=JSESSIONID|jsessionid nofailover=On
ProxyPassReverse / balancer://mycluster/simple stickysession=JSESSIONID|jsessionid
<Location /mod_cluster_manager>
SetHandler mod_cluster-manager
Order deny,allow
Deny from all
Allow from 127.0.0
</Location>
</VirtualHost>