LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-26-2014, 03:22 PM   #1
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
multiple instances of tomcat6


So, I installed tomcat6 from yum repo on CentOS 6.5.
I used How to Run Multiple Instances of Tomcat on a Single Server which gets me most of the way there.

I created /srv/tomcat/tomcat[12] directories and ran a
Code:
for i in tomcat1 tomcat2 ; do mkdir -p /srv/tomcat/${i}/logs \
&& mkdir /srv/tomcat/${i}/webapps && mkdir /srv/tomcat/${i}/work \
&& mkdir /srv/tomcat/${i}/temp && cp -R /usr/share/tomcat6/conf/ \
/srv/tomcat/${i} ; done
I then did a
Code:
cp /etc/sysconfig/tomcat6 /etc/sysconfig/tomcat1
cp /etc/sysconfig/tomcat6 /etc/sysconfig/tomcat2
cp /etc/init.d/tomcat6 /etc/init.d/tomcat1
cp /etc/init.d/tomcat6 /etc/init.d/tomcat2
This was a little different that what How to Run Multiple Instances of Tomcat on a Single Server said to (it shows creating symlinks).

I then edited /etc/sysconfig/tomcat[12] accordingly (tomcat[12])
Code:
CATALINA_BASE="/srv/tomcat/tomcat1" 
CATALINA_PID="/var/run/tomcat1.pid" 
TOMCAT_LOG="/srv/tomcat/tomcat1/logs/catalina.out" 
CONNECTOR_PORT="8080"
service tomcat1 and tomcat2 both seem to be working and I have ports open says
Code:
netstat -plaunt | grep java
tcp        0      0 ::ffff:127.0.0.1:9005       :::*                        LISTEN      16820/java          
tcp        0      0 :::8080                     :::*                        LISTEN      17027/java          
tcp        0      0 :::9009                     :::*                        LISTEN      16820/java          
tcp        0      0 :::9090                     :::*                        LISTEN      16820/java          
tcp        0      0 ::ffff:127.0.0.1:8005       :::*                        LISTEN      17027/java          
tcp        0      0 :::8009                     :::*                        LISTEN      17027/java
It all looks right.

It is here that I think I have an issue:
I can't do a lynx http://localhost:8080 or http://127.0.0.1:8080
both give me a "Alert!: HTTP/1.1 400 Bad Request"
I believe I should be seeing a Tomcat 'homepage'?

Curious is they are both using the same tomcat6.conf in
Code:
/etc/init.d/tomcat1:TOMCAT_CFG="/etc/tomcat6/tomcat6.conf"
/etc/init.d/tomcat2:TOMCAT_CFG="/etc/tomcat6/tomcat6.conf"
So I copied /etc/tomcat6/tomcat6.conf to /etc/tomcat6/tomcat[12].conf
and edited
Code:
/etc/init.d/tomcat1:48:TOMCAT_CFG="/etc/tomcat6/tomcat1.conf"
/etc/init.d/tomcat2:48:TOMCAT_CFG="/etc/tomcat6/tomcat2.conf"
making the the same changes in each that I made in /etc/sysconfig/tomcat[12] specified at How to Run Multiple Instances of Tomcat on a Single Server

netstat shows the ports open but still lynx fails with the same message.

The goal here is to install 2 instances of apache's solr 4.8.1. One under each tomcat instance.

I'd appreciate some assistance.

Thanks for your valuable time.

Last edited by Habitual; 06-26-2014 at 03:25 PM.
 
Old 06-27-2014, 07:45 AM   #2
dijetlo
Senior Member
 
Registered: Jan 2009
Location: RHELtopia....
Distribution: Solaris 11.2/Slackware/RHEL/
Posts: 1,491
Blog Entries: 2

Rep: Reputation: Disabled
Hi Habitual,

Thanks for the link, btw. Good stuff.
Quote:
This was a little different that what How to Run Multiple Instances of Tomcat on a Single Server said to (it shows creating symlinks).
Is anything getting written to your respective log files? Particularly the second instances log? Have you tried a curl or wget to the :8005 and :9005 ? Perhaps the url response would give us a clue.
 
Old 06-27-2014, 08:06 AM   #3
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374

Original Poster
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by dijetlo View Post
Is anything getting written to your respective log files? Particularly the second instances log? Have you tried a curl or wget to the :8005 and :9005 ? Perhaps the url response would give us a clue.
Oh yes.

tomcat2's catalina.out
I fixed the first 3 lines with a
Code:
chown -R tomcat. /srv/tomcat/
I shutdown tomcat2 and did an
Code:
echo "" > /srv/tomcat/tomcat2/logs/catalina.out
and started it.

Code:
cat /srv/tomcat/tomcat2/logs/catalina.out

Jun 27, 2014 6:03:04 AM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
Jun 27, 2014 6:03:04 AM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-9090
Jun 27, 2014 6:03:04 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 351 ms
Jun 27, 2014 6:03:04 AM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Jun 27, 2014 6:03:04 AM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.24
Jun 27, 2014 6:03:04 AM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-9090
Jun 27, 2014 6:03:04 AM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:9009
Jun 27, 2014 6:03:04 AM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/18  config=null
Jun 27, 2014 6:03:04 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 90 ms
I don't know how to use curl except to grab stuff, but I tried these:
Code:
curl localhost:8005
curl: (56) Failure when receiving data from the peer
curl localhost:9005
curl: (56) Failure when receiving data from the peer
Hopefully, that will help you help me.

Thanks.
 
Old 06-27-2014, 08:38 AM   #4
dijetlo
Senior Member
 
Registered: Jan 2009
Location: RHELtopia....
Distribution: Solaris 11.2/Slackware/RHEL/
Posts: 1,491
Blog Entries: 2

Rep: Reputation: Disabled
Quote:
curl localhost:8005
That should work.
Quote:
INFO: JK: ajp13 listening on /0.0.0.0:9009
Jun 27, 2014 6:03:04 AM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/18 config=null
I'm thinking that the server is listening on 9009...
Do me a favor and check 9009 also are you running any kind of firewall locally?
 
Old 06-27-2014, 08:42 AM   #5
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374

Original Poster
Blog Entries: 37

Rep: Reputation: Disabled
Code:
curl localhost:8005
curl: (56) Failure when receiving data from the peer

curl localhost:9009
curl: (52) Empty reply from server
and
Code:
iptables -nL
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
Thanks.
 
Old 06-27-2014, 03:27 PM   #6
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374

Original Poster
Blog Entries: 37

Rep: Reputation: Disabled
dijetlo:

Thanks for the help.
This is resolved.
Code:
yum install tomcat6-webapps
cp -R /usr/share/tomcat6/webapps/ /srv/tomcat/tomcat1
cp -R /usr/share/tomcat6/webapps/ /srv/tomcat/tomcat2
chown -R tomcat. /srv/tomcat/
service tomcat1 restart
service tomcat2 restart
Reference: http://serverfault.com/questions/481...tatus-code-400
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
use /etc/init.d/squid to start both instances gr33d Linux - Software 3 02-24-2010 02:34 PM
Have multiple files open in different instances of a program vwtech Linux - Newbie 1 12-28-2007 01:19 AM
Open multiple files in different instances of a program vwtech Linux - Newbie 2 12-24-2007 11:29 AM
kickstart; how-to info needed for multiple instances of RH OS's and multiple unique v Joe_Wulf Linux - Server 4 06-21-2007 11:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration