You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by David Grant <da...@busydata.com> on 2004/02/17 11:20:29 UTC

jsp files won't run outside of example directories.

Hi All, 

I am having trouble getting .jsp files working outside the default "webapps"
directory used by Tomcat to display examples. The examples work just fine,
and if I put any .jsp file under the jsp-examples directory, they work fine
too. 

The other directory I have setup (myapp) is within my website. The directory
structure goes like this: 


/var/www/www.mysite.com
				/jsp-bin
					/myapp
					     /WEB-INF
			                 index.html
                                   hello.jsp

I get an error "requested resource not available" from Tomcat when I try to
access the /myapp/ directory or anything in it: http://www.mysite.com/myapp/


I have edited server.xml and workers2.properties shown below. 

server.xml: 
-------------------
<!-- The defualt for examples - works when accessing examples directory --> 
<Host name="localhost" debug="0" appBase="webapps" unpackWARs="true"
autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false">
</Host>
 
<!-- My directory - does not work -->
<Host name="mysite.com" debug="1" appBase="/var/www/www.mysite.com/jsp-bin"
unpackWARs="true">
  <Alias>www.mysite.com</Alias> 
</Host>
--------------


workers2.properties
-----------------------
#Virtual Host from Apache
[uri:mysite.com:80/myapp/*]
worker=ajp13:localhost:8009

#Beta virtual Host from Apache. 
[uri:www.mysite.com:80/myapp/*]
worker=ajp13:localhost:8009

---------------- 

These are snippets from my configs, and the sections that I have been
focusing on, just let me know if you need any more details. I am running Red
Hat Linux, Apache 2 and Tomcat 5. 

Any help is appreciated, 

David	


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: jsp files won't run outside of example directories.

Posted by Jerry Ford <jf...@katzenjammer.us>.
David:

I just fought my way through this same problem.  Solved it this weekend, 
with help from this forum.  Search for messages posted here last week 
with "jsp deployment" in the subject for details. 

Short answer for me:  don't use Tomcat's invoker servlet.  Even though 
the invoker is supposedly for mapping servlets, its presence prevented 
my webapp from working when I added a JSP page.  Removing the invoker 
servlet-mapping element from my web.xml file and mapping each servlet 
individually solved the problem.

Jerry

David Grant wrote:

>Hi All, 
>
>I am having trouble getting .jsp files working outside the default "webapps"
>directory used by Tomcat to display examples. The examples work just fine,
>and if I put any .jsp file under the jsp-examples directory, they work fine
>too. 
>
>The other directory I have setup (myapp) is within my website. The directory
>structure goes like this: 
>
>
>/var/www/www.mysite.com
>				/jsp-bin
>					/myapp
>					     /WEB-INF
>			                 index.html
>                                   hello.jsp
>
>I get an error "requested resource not available" from Tomcat when I try to
>access the /myapp/ directory or anything in it: http://www.mysite.com/myapp/
>
>
>I have edited server.xml and workers2.properties shown below. 
>
>server.xml: 
>-------------------
><!-- The defualt for examples - works when accessing examples directory --> 
><Host name="localhost" debug="0" appBase="webapps" unpackWARs="true"
>autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false">
></Host>
> 
><!-- My directory - does not work -->
><Host name="mysite.com" debug="1" appBase="/var/www/www.mysite.com/jsp-bin"
>unpackWARs="true">
>  <Alias>www.mysite.com</Alias> 
></Host>
>--------------
>
>
>workers2.properties
>-----------------------
>#Virtual Host from Apache
>[uri:mysite.com:80/myapp/*]
>worker=ajp13:localhost:8009
>
>#Beta virtual Host from Apache. 
>[uri:www.mysite.com:80/myapp/*]
>worker=ajp13:localhost:8009
>
>---------------- 
>
>These are snippets from my configs, and the sections that I have been
>focusing on, just let me know if you need any more details. I am running Red
>Hat Linux, Apache 2 and Tomcat 5. 
>
>Any help is appreciated, 
>
>David	
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


RE: jsp files won't run outside of example directories.

Posted by Juan de Bravo <ju...@mad.tecsidel.es>.
I think you've configured wrongly your virtual host in server.xml

<Host name="mysite.com" debug="1" appBase="/var/www/www.mysite.com/jsp-bin"
unpackWARs="true">

Instead, the appBase attribute should be
/var/www/www.mysite.com/jsp-bin/myapp

Regards,

Juan.

-----Mensaje original-----
De: David Grant [mailto:davidgrant@busydata.com]
Enviado el: martes, 17 de febrero de 2004 11:20
Para: tomcat-user@jakarta.apache.org
Asunto: jsp files won't run outside of example directories.


Hi All,

I am having trouble getting .jsp files working outside the default "webapps"
directory used by Tomcat to display examples. The examples work just fine,
and if I put any .jsp file under the jsp-examples directory, they work fine
too.

The other directory I have setup (myapp) is within my website. The directory
structure goes like this:


/var/www/www.mysite.com
				/jsp-bin
					/myapp
					     /WEB-INF
			                 index.html
                                   hello.jsp

I get an error "requested resource not available" from Tomcat when I try to
access the /myapp/ directory or anything in it: http://www.mysite.com/myapp/


I have edited server.xml and workers2.properties shown below.

server.xml:
-------------------
<!-- The defualt for examples - works when accessing examples directory -->
<Host name="localhost" debug="0" appBase="webapps" unpackWARs="true"
autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false">
</Host>

<!-- My directory - does not work -->
<Host name="mysite.com" debug="1" appBase="/var/www/www.mysite.com/jsp-bin"
unpackWARs="true">
  <Alias>www.mysite.com</Alias>
</Host>
--------------


workers2.properties
-----------------------
#Virtual Host from Apache
[uri:mysite.com:80/myapp/*]
worker=ajp13:localhost:8009

#Beta virtual Host from Apache.
[uri:www.mysite.com:80/myapp/*]
worker=ajp13:localhost:8009

----------------

These are snippets from my configs, and the sections that I have been
focusing on, just let me know if you need any more details. I am running Red
Hat Linux, Apache 2 and Tomcat 5.

Any help is appreciated,

David


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org