admin Site Admin
Joined: 23 Jan 2003 Posts: 256 Location: India
|
Posted: Wed Apr 30, 2003 5:04 pm Post subject: HOWTO: installing tomcat on cpanel servers |
|
|
The first major hurdle in installing tomcat is not to use the tomcat 4.1.2 (jsp-install-4.x.tar.gz) package that is up at http://layer1.cpanel.net I haven't known of anyone actually getting this package to work properly on their systems. If anyone has, they haven't shared the information as to how.
Instead try and find the older tomcat 4.0.3 package (also titled jsp-install-4.x.tar.gz) If someone wants to setup a mirror for this let me know and I will upload it.
once you have the file login as root and run the following commands:
gunzip jsp-install-4.x.tar.gz
tar-xvf jsp-install-4.x.tar
cd jsp-install-4.x/
./install.sh
At this point j2sdk and tomcat should install without any problems. Once they have finished make sure to add the following lines to your /usr/local/apache/conf/httpd.conf file under the AddModule section:
Include "/usr/local/jakarta/jakarta-tomcat-4.0.3-src/build/conf/auto/mod_jk.conf"
AddModule mod_jk.c
Verify that index.jsp has been added DirectoryIndex
and add AddType text/html .jsp in the AddType section (all of this is within your httpd.conf)
You may also find it useful to add the following to your web.xml in order for both servlet and servlets to be valid paths. (thanks to dgbaker)
after the current invoker add the following lines
<servlet>
<servlet-name>invoker2</servlet-name>
<servlet-class>org.apache.catalina.servlets.InvokerServlet</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>0</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>
Add this right after the current invoker mapping
<servlet-mapping>
<servlet-name>invoker</servlet-name>
<url-pattern>/servlets/*</url-pattern>
</servlet-mapping>
Once this is done anything in /home/user/public_html/WEB-INF/classes will work when called in the following manor:
http://www.mydomain.com/servlet/servletname or http://www.mydomain.com/servlets/servletname
How to install servlet access to accounts:
Within WHM you will have an extra section entitled 'Plugins' with one option 'Install Servlets'. Only install servlets on accounts which actually require the use of java as servlets take a lot of system resources and you will want to limit the number of accounts having access to java while still maintaining a stable server.
This should be all... let me know if I missed anything. I'm still trying to work on war deployment and some individual web.xml issues on my server. _________________ HostOnNet.com - Reseller Hosting
Free Ads Forum, Promote your site
NetFreeHost.com - Free Web Hosting, phpBB Hosting |
|