Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java Open Source > Apache Tomcat
|
Apache Tomcat General discussion of the Apache Tomcat servlet container. For discussions specific to the Professional Apache Tomcat book, please see the book discussion forum for that book.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Apache Tomcat section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 27th, 2009, 01:11 AM
Registered User
 
Join Date: Mar 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default getting a jsp to run ...

Hi all i have apache2 (using virtual host) and tomcat installed here. I used this tutorial...http://www.mogilowski.net/?p=121

I can reach the tomcat welcomepage at http://servername:8180


And i have also integrated it to work behind apache as in the tutorial

my virtualhost has domain mydomain.lan

home folder of this virtual host is /home/mydomain/

webfiles go into /home/mydomain/public_html

and i want to run jsp files from within /home/mydomain/public_html/jsp

the virtual host section of apache2 looks like this...
Code:
[/<VirtualHost 192.168.1.56:80>
ServerName mydomain.lan
ServerAlias www.mydomain.lan
DocumentRoot /home/mydomain/public_html
ErrorLog /var/log/virtualmin/mydomain.lan_error_log
CustomLog /var/log/virtualmin/mydomain.lan_access_log combined
DirectoryIndex index.html index.htm index.php index.php4 index.php5
<Directory /home/mydomain/public_html>
Options -Indexes IncludesNOEXEC FollowSymLinks
allow from all
AllowOverride All
</Directory>
<Directory /home/mydomain/cgi-bin>
allow from all
</Directory>
JkMount /jsp/*.jsp ajp13_worker
</VirtualHost>
and in server.xml i have

Code:
<!-- mydomain.lan -->
<host name="mydomain.lan" appBase="/home/mydomain/public_html" unpackWARs="true" autoDeploy="true">
<context path="" docBase="jsp" debug="0" reloadable="true"/>
<valve className="org.apache.catalina.valves.AccessLogValve" directory="/var/log/virtualmin"  prefix="mydomain.lan.tomcat_access_" suffix=".log" pattern="common" resolveHosts="false"/>
</host>

i've put the test.jsp file into /home/mydomain/public_html/jsp

and tried to access it via http://mydomain.lan/jsp/test.jsp but all i get is this error

HTTP Status 404 -
type Status report
message
description The requested resource () is not available.


Any ideas what i am doing wrong?

Thanks.
 
Old April 1st, 2009, 12:50 AM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 373
Thanks: 0
Thanked 1 Time in 1 Post
Default

With your configuration you'll be able access the jsp using the url
http://mydomain.lan/test.jsp

As the docBase is given as "jsp" directory with path attribute values as "", and host name is given as "mydomain.lan", so when you give mydomain.lan/jsp/test.jsp, it'll try to look for the jsp file in directory "/home/mydomain/public_html/jsp/jsp".
__________________
- Rakesh
http://iam-rakesh.blogspot.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
I WANT TO RUN JSP ON TOMCAT! reddikishore BOOK: Beginning Java 2 0 July 1st, 2007 08:17 AM
Can JSP integrate with Servlet and run on MySQL wesleygch JSP Basics 0 April 10th, 2007 02:22 AM
Run unix command throu a jsp page kvingupta JSP Basics 2 July 20th, 2006 07:01 PM
how to set up Jrun to run jsp n cr ray5 Crystal Reports 0 September 6th, 2005 09:27 PM
run jsp on tomcat devyani JSP Basics 3 July 4th, 2005 05:26 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.