You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by John Hinton <we...@ew3d.com> on 2006/08/18 20:23:31 UTC
Creating /WEB-INF folders for virtualhosts
Seems I have everything running up to the point of a test.jsp file being
excuted within a virtualhost's user directory.
If I understand correctly, there should be a WEB-INF directory in the
virtualhost root directory, with a web.xml document there.
My snag.. is there a built in way to create this directory and the info
it should contain?
If I am to create this directory, what permissions should it have? And
what about additional classes and librarys, such are are in the default
server directory?
A good example of the web.xml file would be helpful as well.
Sorry to be posting what is obviously such a simple question.. I have
google until my fingers are blue and am finding very little information
on this particular aspect.. and want to have what is needed for the
vhost client, but not open it up too much.
Thanks,
John Hinton
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Creating /WEB-INF folders for virtualhosts
Posted by Mark Thomas <ma...@apache.org>.
Edoardo Causarano wrote:
> I understand your frustration, I haven't gone without my own. You must
> realize though that jsp under tomcat is not like php under ~/public_html
> user dirs.
Are you aware of the User Web Applications feature, as per
http://tomcat.apache.org/tomcat-5.5-doc/config/host.html#Automatic%20Application%20Deployment
Mark
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Creating /WEB-INF folders for virtualhosts
Posted by Edoardo Causarano <ed...@gmail.com>.
I understand your frustration, I haven't gone without my own. You
must realize though that jsp under tomcat is not like php under ~/
public_html user dirs. Perhaps it's a limit of tomcat but you can't
(as far as I know) do useraccount mass vhosting. Every explicitly
declared host declaration in server.xml has a dir (the famous
webapps) to which the appropriate / resolves. Within that, single war
archives plug in, as if they were custom business extensions to the
server; except for the ROOT.war that resolves to unprefixed resources
not belonging to any context (as in http://example.com/<context>/
resource.jsp). You can't do what you expect out of the box, unless
you build a framework, contained within a web application, whose
entry point examines the requested URL and redirects it to some jsp
repository for processing (sounds trivial with some regexp within a *
responder servlet).
Regarding the issue about multiple filesystem paths resolving and
feeding resources... have you configured mod_jk? Direct-to-tomcat
interaction feeds straight to the <Host appbase="this-is-it!"...>
path (which unprefixed is relative to $CATALINA_BASE) while with jk
pass-through you may feed resources not intercepted by JkMount from
the directory configured under htttpd.
Ciao,
e
On 21/ago/06, at 08:47GMT+02:00, John Hinton wrote:
> Edoardo Causarano wrote:
>> The host appbase attribute specifies the directory where the wars
>> (exploded or left intact) are stored and is not a documentroot in
>> the apache httpd sense. The latter would be the ROOT.war webapp to
>> which root relative paths unmatched by any other war prefix resolve.
>>
>> Distribution of object instances across multiple contexts belongs
>> to the J2EE container problem space (JBoss, WebSphere, Geronimo,
>> JonAS, etc...) while Tomcat is a web container (a component of
>> J2EE). You could dump some singletons in the shared classloader
>> (classes loaded from the "shared" library path) but then you must
>> be careful about reference counting in these classes or you'll
>> have leaks (in the sense that references aren't really released
>> and the gc won't reclaim the objects) and eventually eat all the
>> jvm memory; suggestion: use lifecycle listeners in the webapp.
>>
>> You could set the crossContext attribute to "true" and do as in
>> http://forum.java.sun.com/thread.jspa?
>> threadID=580846&messageID=2956369 but not unless you have total
>> control on the server and you can still do forwards in struts
>> without relaxing webapp isolation.
>>
>> Ciao,
>> e
> I finally got my test.jsp file to run. I'm simply struggling with
> path problems.. what it does vs. what I want it to do.
>
> I have total control of the server. This is a shared hosting
> server. For that reason I would like to give users the ability to
> upload/delete any of their files.
>
> This is what works:
>
> If I create a directory, lets call it jspusername in /usr/local/
> tomcat/webapps and then create the WEB-INF directory with classes
> and lib in that. If I place the test.jsp file in the jspusername
> directory, as I have things configured now, it will execute via
>
> http://domainname.com/jspusername/test.jsp
>
> and test.jsp will even pull images from the domains /var/www/
> username/public_html/images directory by using ../images in the
> html link to get down to that directory. A bit of a surprise.....
>
> What I would like, is to be able to put test.jsp in /var/www/
> username/public_html or any user created directory in that
> directory. I just can't seem to find the key to this. In fact, I
> can't even find where tomcat is setting the default directory to /
> usr/local/tomcat/webapps.
>
> If someone has a good idea about how to do this it would be greatly
> appreciated. I'm totally new to jakarta/tomcat and have been
> pounding on this thing for about 4 days. I've done only tiny
> amounts of programming a long time ago in java, so please
> understand I'm not up to speed with the Sun lingo.
>
> End of Question ---- A side note:
>
> The installation actually wasn't so bad, but this pathing for a
> shared hosting environment has been extremely confusing. Googling
> for hours and hours yielded some results, but basically I never
> found any one page with enough info.. and then in combination with
> different installation pathing mixed with older versions... I'd
> rather have made a trip to a torture dungeon. I can't help but
> wonder how many people are not using the programming language due
> to a lack of webservers with the ability to run them... due to this
> painful process. Almost every bit of information I could find
> stopped short of talking about virtualhost and those that didn't
> were installs of older versions which I feared would not work for a
> reason I wouldn't figure out for yet more days. Really, even within
> the tomcat documentation, I can't remember ever seeing that a
> webapps directory must contain a WEB-INF directory. It did clearly
> say that a web.xml file for your application should be put in that
> directory.. but for a simple test.jsp file, It turned out I didn't
> need a web.xml file there. Sorry for the rant here, but I've been
> chasing my tail for a long long time.. and it seems many others are
> getting stuck at this same place. I'm can't help but wonder if a
> wiki all the way through to this vhost level would be good for the
> community and the language... provide the service to the masses via
> standard webhosting/FTP.
>
> Thanks,
> John Hinton
>>
>> On 19/ago/06, at 05:55GMT+02:00, John Hinton wrote:
>>
>>> John Hinton wrote:
>>>> Seems I have everything running up to the point of a test.jsp
>>>> file being excuted within a virtualhost's user directory.
>>>>
>>>> If I understand correctly, there should be a WEB-INF directory
>>>> in the virtualhost root directory, with a web.xml document there.
>>>>
>>>> My snag.. is there a built in way to create this directory and
>>>> the info it should contain?
>>>>
>>>> If I am to create this directory, what permissions should it
>>>> have? And what about additional classes and librarys, such are
>>>> are in the default server directory?
>>>>
>>>> A good example of the web.xml file would be helpful as well.
>>> OK, perhaps I should start over..
>>>
>>> I am a server admin and have no experience with jsp. I need to
>>> run this system especially for a virtual host client.
>>>
>>> I seem to have the basics of installation working as I can get to
>>> the manager pages. However when I try to open a test.jsp file in
>>> that client's virtualhost public_html directory, I get the
>>> following error.
>>>
>>>
>>> HTTP Status 404 - /test.jsp
>>>
>>> --------------------------------------------------------------------
>>> ----
>>>
>>> *type* Status report
>>>
>>> *message* _/test.jsp_
>>>
>>> *description* _The requested resource (/test.jsp) is not available._
>>>
>>> --------------------------------------------------------------------
>>> ----
>>>
>>>
>>> Apache Tomcat/5.5.9
>>>
>>>
>>> My OS is CentOS 3.6 in this case. Could someone please try to
>>> help me through this? Actually, I'm not really even sure what
>>>
>>> The requested resource (/test.jsp) is not available means? Is
>>> this a path to test.jsp problem or a notice that for some reason
>>> it can't be run?
>>>
>>> Thanks,
>>> John Hinton
>>>
>>> --------------------------------------------------------------------
>>> -
>>> To start a new topic, e-mail: users@tomcat.apache.org
>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To start a new topic, e-mail: users@tomcat.apache.org
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>> !DSPAM:44e6fe6a23909427810705!
>>
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Creating /WEB-INF folders for virtualhosts
Posted by Hassan Schroeder <ha...@gmail.com>.
> What I would like, is to be able to put test.jsp in
> /var/www/username/public_html or any user created directory in that
> directory. I just can't seem to find the key to this. In fact, I can't
> even find where tomcat is setting the default directory to
> /usr/local/tomcat/webapps.
Your server.xml file contains at least one <Host> element; the
default location for it to find its webapps (<Context>s) is
$CATALINA_HOME/webapps. You can change that by specifying
the appBase, e.g.
<Host name="example" appBase="/var/www/example"/>
> If someone has a good idea about how to do this it would be greatly
> appreciated.
It's in the Tomcat docs. Really. Start here:
<http://tomcat.apache.org/tomcat-5.5-doc/config/index.html>
> End of Question ---- A side note:
And if some of the "lingo" is confusing, you may just want to take the
time to read (or at least skim) the Servlet Spec.
The best directions on changing your car's timing belt do assume a
certainly familiarity with hand tools and internal combustion engines...
FWIW!
--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Creating /WEB-INF folders for virtualhosts
Posted by John Hinton <we...@ew3d.com>.
Edoardo Causarano wrote:
> The host appbase attribute specifies the directory where the wars
> (exploded or left intact) are stored and is not a documentroot in the
> apache httpd sense. The latter would be the ROOT.war webapp to which
> root relative paths unmatched by any other war prefix resolve.
>
> Distribution of object instances across multiple contexts belongs to
> the J2EE container problem space (JBoss, WebSphere, Geronimo, JonAS,
> etc...) while Tomcat is a web container (a component of J2EE). You
> could dump some singletons in the shared classloader (classes loaded
> from the "shared" library path) but then you must be careful about
> reference counting in these classes or you'll have leaks (in the sense
> that references aren't really released and the gc won't reclaim the
> objects) and eventually eat all the jvm memory; suggestion: use
> lifecycle listeners in the webapp.
>
> You could set the crossContext attribute to "true" and do as in
> http://forum.java.sun.com/thread.jspa?threadID=580846&messageID=2956369
> but not unless you have total control on the server and you can still
> do forwards in struts without relaxing webapp isolation.
>
> Ciao,
> e
I finally got my test.jsp file to run. I'm simply struggling with path
problems.. what it does vs. what I want it to do.
I have total control of the server. This is a shared hosting server. For
that reason I would like to give users the ability to upload/delete any
of their files.
This is what works:
If I create a directory, lets call it jspusername in
/usr/local/tomcat/webapps and then create the WEB-INF directory with
classes and lib in that. If I place the test.jsp file in the jspusername
directory, as I have things configured now, it will execute via
http://domainname.com/jspusername/test.jsp
and test.jsp will even pull images from the domains
/var/www/username/public_html/images directory by using ../images in the
html link to get down to that directory. A bit of a surprise.....
What I would like, is to be able to put test.jsp in
/var/www/username/public_html or any user created directory in that
directory. I just can't seem to find the key to this. In fact, I can't
even find where tomcat is setting the default directory to
/usr/local/tomcat/webapps.
If someone has a good idea about how to do this it would be greatly
appreciated. I'm totally new to jakarta/tomcat and have been pounding on
this thing for about 4 days. I've done only tiny amounts of programming
a long time ago in java, so please understand I'm not up to speed with
the Sun lingo.
End of Question ---- A side note:
The installation actually wasn't so bad, but this pathing for a shared
hosting environment has been extremely confusing. Googling for hours and
hours yielded some results, but basically I never found any one page
with enough info.. and then in combination with different installation
pathing mixed with older versions... I'd rather have made a trip to a
torture dungeon. I can't help but wonder how many people are not using
the programming language due to a lack of webservers with the ability to
run them... due to this painful process. Almost every bit of information
I could find stopped short of talking about virtualhost and those that
didn't were installs of older versions which I feared would not work for
a reason I wouldn't figure out for yet more days. Really, even within
the tomcat documentation, I can't remember ever seeing that a webapps
directory must contain a WEB-INF directory. It did clearly say that a
web.xml file for your application should be put in that directory.. but
for a simple test.jsp file, It turned out I didn't need a web.xml file
there. Sorry for the rant here, but I've been chasing my tail for a long
long time.. and it seems many others are getting stuck at this same
place. I'm can't help but wonder if a wiki all the way through to this
vhost level would be good for the community and the language... provide
the service to the masses via standard webhosting/FTP.
Thanks,
John Hinton
>
> On 19/ago/06, at 05:55GMT+02:00, John Hinton wrote:
>
>> John Hinton wrote:
>>> Seems I have everything running up to the point of a test.jsp file
>>> being excuted within a virtualhost's user directory.
>>>
>>> If I understand correctly, there should be a WEB-INF directory in
>>> the virtualhost root directory, with a web.xml document there.
>>>
>>> My snag.. is there a built in way to create this directory and the
>>> info it should contain?
>>>
>>> If I am to create this directory, what permissions should it have?
>>> And what about additional classes and librarys, such are are in the
>>> default server directory?
>>>
>>> A good example of the web.xml file would be helpful as well.
>> OK, perhaps I should start over..
>>
>> I am a server admin and have no experience with jsp. I need to run
>> this system especially for a virtual host client.
>>
>> I seem to have the basics of installation working as I can get to the
>> manager pages. However when I try to open a test.jsp file in that
>> client's virtualhost public_html directory, I get the following error.
>>
>>
>> HTTP Status 404 - /test.jsp
>>
>> ------------------------------------------------------------------------
>>
>> *type* Status report
>>
>> *message* _/test.jsp_
>>
>> *description* _The requested resource (/test.jsp) is not available._
>>
>> ------------------------------------------------------------------------
>>
>>
>> Apache Tomcat/5.5.9
>>
>>
>> My OS is CentOS 3.6 in this case. Could someone please try to help me
>> through this? Actually, I'm not really even sure what
>>
>> The requested resource (/test.jsp) is not available means? Is this a
>> path to test.jsp problem or a notice that for some reason it can't be
>> run?
>>
>> Thanks,
>> John Hinton
>>
>> ---------------------------------------------------------------------
>> To start a new topic, e-mail: users@tomcat.apache.org
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
> !DSPAM:44e6fe6a23909427810705!
>
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Creating /WEB-INF folders for virtualhosts
Posted by Edoardo Causarano <ed...@gmail.com>.
The host appbase attribute specifies the directory where the wars
(exploded or left intact) are stored and is not a documentroot in the
apache httpd sense. The latter would be the ROOT.war webapp to which
root relative paths unmatched by any other war prefix resolve.
Distribution of object instances across multiple contexts belongs to
the J2EE container problem space (JBoss, WebSphere, Geronimo, JonAS,
etc...) while Tomcat is a web container (a component of J2EE). You
could dump some singletons in the shared classloader (classes loaded
from the "shared" library path) but then you must be careful about
reference counting in these classes or you'll have leaks (in the
sense that references aren't really released and the gc won't reclaim
the objects) and eventually eat all the jvm memory; suggestion: use
lifecycle listeners in the webapp.
You could set the crossContext attribute to "true" and do as in
http://forum.java.sun.com/thread.jspa?
threadID=580846&messageID=2956369 but not unless you have total
control on the server and you can still do forwards in struts without
relaxing webapp isolation.
Ciao,
e
On 19/ago/06, at 05:55GMT+02:00, John Hinton wrote:
> John Hinton wrote:
>> Seems I have everything running up to the point of a test.jsp file
>> being excuted within a virtualhost's user directory.
>>
>> If I understand correctly, there should be a WEB-INF directory in
>> the virtualhost root directory, with a web.xml document there.
>>
>> My snag.. is there a built in way to create this directory and the
>> info it should contain?
>>
>> If I am to create this directory, what permissions should it have?
>> And what about additional classes and librarys, such are are in
>> the default server directory?
>>
>> A good example of the web.xml file would be helpful as well.
> OK, perhaps I should start over..
>
> I am a server admin and have no experience with jsp. I need to run
> this system especially for a virtual host client.
>
> I seem to have the basics of installation working as I can get to
> the manager pages. However when I try to open a test.jsp file in
> that client's virtualhost public_html directory, I get the
> following error.
>
>
> HTTP Status 404 - /test.jsp
>
> ----------------------------------------------------------------------
> --
>
> *type* Status report
>
> *message* _/test.jsp_
>
> *description* _The requested resource (/test.jsp) is not available._
>
> ----------------------------------------------------------------------
> --
>
>
> Apache Tomcat/5.5.9
>
>
> My OS is CentOS 3.6 in this case. Could someone please try to help
> me through this? Actually, I'm not really even sure what
>
> The requested resource (/test.jsp) is not available means? Is this
> a path to test.jsp problem or a notice that for some reason it
> can't be run?
>
> Thanks,
> John Hinton
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Creating /WEB-INF folders for virtualhosts
Posted by John Hinton <we...@ew3d.com>.
John Hinton wrote:
> Seems I have everything running up to the point of a test.jsp file
> being excuted within a virtualhost's user directory.
>
> If I understand correctly, there should be a WEB-INF directory in the
> virtualhost root directory, with a web.xml document there.
>
> My snag.. is there a built in way to create this directory and the
> info it should contain?
>
> If I am to create this directory, what permissions should it have? And
> what about additional classes and librarys, such are are in the
> default server directory?
>
> A good example of the web.xml file would be helpful as well.
OK, perhaps I should start over..
I am a server admin and have no experience with jsp. I need to run this
system especially for a virtual host client.
I seem to have the basics of installation working as I can get to the
manager pages. However when I try to open a test.jsp file in that
client's virtualhost public_html directory, I get the following error.
HTTP Status 404 - /test.jsp
------------------------------------------------------------------------
*type* Status report
*message* _/test.jsp_
*description* _The requested resource (/test.jsp) is not available._
------------------------------------------------------------------------
Apache Tomcat/5.5.9
My OS is CentOS 3.6 in this case. Could someone please try to help me
through this? Actually, I'm not really even sure what
The requested resource (/test.jsp) is not available means? Is this a
path to test.jsp problem or a notice that for some reason it can't be run?
Thanks,
John Hinton
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org