[Thread Prev][Thread Next][Index]

Re: multiple las servers and apache virtual hostsll



Hi all,

I have an installation which is close to what pbmoses@ucsd.edu is looking for.
It may also be useful to those running RedHat-9

OS : RedHat-9/linux  i686
apache 2.0.40
jakarta-tomcat-4.1.27

I use Apache as a frontend to Tomcat, and an apache-tomcat connector.
I found Apache more friendly than Tomcat to configure access lists. 
Also, apache web site claims that apache+tomcat is more efficient than 
tomcat alone. An I did not like the URLs in :8080 . 
But you may have your own taste ...

My apache runs several virtual servers.

I used a different tomcat instead of the one embedded in LAS, 
because under RedHat-9, the httpd server is apache-2 and not 
apache-1.3. The tomcat release for apache-1.3 was not 
recommended for apache-2.
I downloaded tomcat-4.1.27 from apache website
and installed it in /home/jakarta-tomcat-4.1.27
I also downloaded the connector mod-jk-1.2.5 and installed it in 
/usr/lib/httpd/modules/mod_jk.so

I experienced some problems with the Perl modules for RedHat-9, 
but this is out of topic.

The various LAS servers were located in
/home/las
/home/las-ammasat
/home/las-ipsl	# a private one

To use my jakarta-tomcat, I had to modify (see LAS FAQ) 
/home/las/configure.pl, /home/las-ammasat/configure.pl, /home/las-ipsl/configure.pl :

	#my $JAKARTA_HOME = "las_servlet/jakarta";
	my $JAKARTA_HOME = "../jakarta-tomcat-4.1.27"

To configure the connector, there are some lines to add to httpd.conf :
First, enable the module worker.c :
	<IfModule worker.c>
	StartServers         2
	MaxClients         150
	MinSpareThreads     25
	MaxSpareThreads     75
	ThreadsPerChild     25
	MaxRequestsPerChild  0
	</IfModule>
	<IfModule worker.c>
	LoadModule cgid_module modules/mod_cgid.so
	</IfModule>

Then, enable the jk connector :
	#<IfModule mod_jk.c>
	  LoadModule jk_module /usr/lib/httpd/modules/mod_jk.so
	#</IfModule>

In the Main server configuration :
	JkWorkersFile "/etc/httpd/conf/workers.properties"
	JkLogFile "/home/jakarta-tomcat-4.1.27/logs/mod_jk.log"
	JkLogLevel debug
	JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
	JkRequestLogFormat "%w %V %T"

In the virtual hosts configuration :
# 
## CLIMSERV
	ServerName climserv.lmd.polytechnique.fr:80
	JkMount /examples/* worker1
	JkMount /las/* worker1
	JkMount /las-ipsl/* worker1
## AMMASAT
	ServerName ammasat.lmd.polytechnique.fr:80
	JkMount /las-ammasat/* worker1

# las and las-ipsl are run by the same virtual server. 
las-ammasat by a second virtual server.

The worker configuration file /etc/httpd/conf/workers.properties contains :
	workers.java_home=/usr/java/j2sdk1.4.1_01/
	worker.list=worker1
	# Set properties for worker1 (ajp13)
	worker.worker1.type=ajp13
	worker.worker1.host=localhost
	worker.worker1.port=8009
	worker.worker1.lbfactor=50
	worker.worker1.cachesize=10
	worker.worker1.cache_timeout=600
	worker.worker1.socket_keepalive=1
	worker.worker1.socket_timeout=300

All this stuff sets up apache and the jk connector, to forward the http requests to tomcat.

Then, to configure Tomcat itself, you have to edit /home/jakarta-tomcat-4.1.27/conf/server.xml .
Here are the significant lines in my own server.xml :

<Server port="8005" shutdown="SHUTDOWN" debug="0">
 <Service name="Tomcat-Standalone">
    <!-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009 -->
      <Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
               port="8009" minProcessors="5" maxProcessors="75"
               enableLookups="true" redirectPort="8443"
               acceptCount="10" debug="0" connectionTimeout="0"
               useURIValidationHack="false"
               protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler"/>
      <Engine name="Standalone" defaultHost="localhost" debug="0">
       <Host name="localhost" debug="0" appBase="webapps"
            unpackWARs="true" autoDeploy="true">
       </Host>
    </Engine>
  </Service>
</Server>

# I should have renamed "Tomcat--Standalone" ...


To configure each las server, perform the following operations each time you modify the
/home/las/server/las.xml and xml include files :

$ cd /home/las???
$ ./configure
cd jakarta-tomcat-4.1.27
service httpd stop
./stopserver.sh
./startserver.sh
sleep 10
service httpd start

You must edit stopserver.sh and startserver.sh so as they address the right catalina script :
	exec ../jakarta-tomcat-4.1.27/bin/catalina.sh start
	exec ../jakarta-tomcat-4.1.27/bin/catalina.sh stop

Finally, in my rc.local file, I have added some lines to start properly apache and tomcat :
# pour las
export  JAVA_HOME=/usr/java/j2sdk1.4.1_01/
service httpd stop
[ -e /home/jakarta-tomcat-4.1.27/startserver.sh ] && \
	{ cd /home/jakarta-tomcat-4.1.27; ./startserver.sh; }
sleep 10
service httpd start

I hope I have not forgotten any stage. I did this work in november 2003, 
I promised to inform the LAS list, and I switched to something else. 
In the meantimle I forgot almost all that stuff.

JL Monge


On Friday 16 January 2004 07:12, pbmoses@ucsd.edu wrote:
> Hello,
> I am currently setting up multiple las servers on a single machine running
> apache which is also
> resolving virtual hosts. I have read the multiple las server on a single
> machine FAQ as well as the
> archives in the mailing lists, however, I still seem to be having trouble
> reading running the multiple
> las servers, although I am not sure if it is due to a virtual hosts problem
> or now.
>
> Summary:
> Two virtual hosts (apache) on a single machine, both running las servers.
> A single tomcat server running
> Both configurations have completely different directories and
> configurations. When querying the database by hand, I see the proper URI
> associations in the las-->maps tables,
> so I know all of the data is there.
> All data uploads and is populated when running genLas.
> The catch is I can either see all of the server A data, (from A or B), all
> of server B data (from A or B)
> , both the A and B data together but I can never seem to get data A with UI
> A while also being able
> to see data B from UI B.
>
> Confusing enough yet?
> I am still relatively new with the las server, however I have torn this
> down and rebuilt it at least 5
> times now so I am becoming very familiar with it, the last detail I have to
> fix is this problem with
> multiple las servers on a single machines and the data staying independent.
>
> If anyone can add suggestions or hints, please let me know. Log files are
> available but I think it is
> more something that I have not done properly at this point.
>
>
> Thanks,
> Phil

-- 
***********************
Jean-Louis Monge       tel. (33.1)69 33 45 35
CNRS/LMD               fax. (33.1)69 33 30 05
Ecole Polytechnique
91128 Palaiseau Cedex
FRANCE
 Jean-Louis.Monge@lmd.polytechnique.fr   



[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP
Contact Us | Privacy Policy | Disclaimer | Accessibility Statement