portman

Well-Known Member
May 23, 2002
70
0
306
We just installed a few weeks ago...

I think you will get what you want if to SSH into the server (as root) and type this:

echo $CLASSPATH

Case IS important.
 

jsteel

Well-Known Member
Jul 4, 2002
646
0
166
Atlanta, GA
Create this directory structure in his /public_html directory:

/WEB-INF/classes

Then restart Tomcat. The customer can then put his servlets in the /classes subdirectory and call them like so (assuming you added servlet support to his domain in WHM):

http://www.hisdomain.com/servlet/NameOfServlet


Jaz
 

Vital

Active Member
Nov 17, 2001
37
0
306
Here's another very important thing:

if you have installed Tomcat 4.x Plugin from CPanel, you will need to edit /scripts/gentomcatlist

find this line in it:

&Host name=&$nhost&&
&Context path=&& reloadable=&true& docBase=&$nhosts{$nhost}& debug=&1&/&
&/Host&

and change to this:

&Host name=&$nhost& appBase=&$nhosts{$nhost}&&
&Context path=&& reloadable=&true& docBase=&$nhosts{$nhost}& debug=&1&/&
&/Host&

then execute this file, and restart tomcat.

Otherwise his JSP pages will work,but he won't be able to run servlets at all.

Note to CPanel DEV. Team - would you be so kind to include this little mod by default? ;)
 

jsteel

Well-Known Member
Jul 4, 2002
646
0
166
Atlanta, GA
Afraid you are wrong there Vital. We don't have the appBase parameter on any of our accounts and everyone's servlets work just fine.

Jaz
 

Vital

Active Member
Nov 17, 2001
37
0
306
Mmm... And war files too? Have you changed anything else after default installation? 'Cause it didn't worked, till i figured out this appBase parameter in server.xml...
 

jsteel

Well-Known Member
Jul 4, 2002
646
0
166
Atlanta, GA
Haven't tried WAR files yet. Do you have them working? If so, how are you calling them from a URL? I'd like to do a test on my machine without the appBase.

Jaz
 

Vital

Active Member
Nov 17, 2001
37
0
306
[quote:c9e135e671][i:c9e135e671]Originally posted by jsteel[/i:c9e135e671]
Haven't tried WAR files yet. Do you have them working? If so, how are you calling them from a URL? I'd like to do a test on my machine without the appBase.
[/quote:c9e135e671]

Yeah i do. ;) Here's the deal:

you put the file into public_html, restart tomcat, and file gets unpacked into directory of it's name.

then you'll need to add mapping, like:

JkMount /warname/* ajp13

into virtualhost...

And it works just fine. ;))


A question to everyone: any idea, why i can't use JkMount through .htaccess? ;) It would be extremely useful thing to have for customers.
 

moronhead

Well-Known Member
Aug 12, 2001
706
0
316
[quote:838b6e0e21][i:838b6e0e21]Originally posted by Vital[/i:838b6e0e21]

you put the file into public_html, restart tomcat, and file gets unpacked into directory of it's name.

......
[/quote:838b6e0e21]
Does that mean every time the client puts a new WAR file in his web root you have to restart tomcat?
 

jsteel

Well-Known Member
Jul 4, 2002
646
0
166
Atlanta, GA
[/quote]
Does that mean every time the client puts a new WAR file in his web root you have to restart tomcat?[/quote]

Yes. Not very effective obviously. I'm also wondering what kind of effect unPack=false would have on Vital's setup. Vital, have you tried this yet? Would this allow new version to be uploaded and read without a restart?

Jaz
 

dgbaker

Well-Known Member
PartnerNOC
Sep 20, 2002
2,576
9
343
Toronto, Ontario Canada
cPanel Access Level
DataCenter Provider
When we tried to implement that little mod to the gentomcatlist script we get the following error and Tomcat dies. Our users cannot get jsp/servlets to execute properly on a sub-domain.

Scanning httpd.conf...X..X..X.X..X..X..X..X..X...X..X..X.X...X..X.X...X.X...X.X...X
Using CATALINA_BASE: /usr/local/jakarta/jakarta-tomcat-4.0.3-src/build
Using CATALINA_HOME: /usr/local/jakarta/jakarta-tomcat-4.0.3-src/build
Using CATALINA_TMPDIR: /usr/local/jakarta/jakarta-tomcat-4.0.3-src/build/temp
Using JAVA_HOME: /usr/local/jdk
&b&ERROR reading /usr/local/jakarta/jakarta-tomcat-4.0.3-src/build/conf/server.xml
At Element type &Host& must be followed by either attribute specifications, &&& or &/&&.
&/b&
Catalina.stop: org.xml.sax.SAXException: Element type &Host& must be followed by either attribute specifications, &&& or &/&&.
org.xml.sax.SAXException: Element type &Host& must be followed by either attribute specifications, &&& or &/&&.
at org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:979)
at org.xml.sax.helpers.XMLReaderAdapter.parse(Unknown Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at org.apache.catalina.util.xml.XmlMapper.readXml(XmlMapper.java:228)
at org.apache.catalina.startup.Catalina.stop(Catalina.java:822)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:683)
at org.apache.catalina.startup.Catalina.process(Catalina.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:243)
httpd: no process killed
Using CATALINA_BASE: /usr/local/jakarta/jakarta-tomcat-4.0.3-src/build
Using CATALINA_HOME: /usr/local/jakarta/jakarta-tomcat-4.0.3-src/build
Using CATALINA_TMPDIR: /usr/local/jakarta/jakarta-tomcat-4.0.3-src/build/temp
Using JAVA_HOME: /usr/local/jdk