You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Marco Rocco <mr...@gmail.com> on 2009/10/17 17:05:40 UTC
Adding a new webapps directory
It's possible to add a new webapps directroy more then the default
tomcat webapps (/opt/tomcat/webapps) ?
For now i have to put my servlets in /opt/tomcat/webapps i would add a
new webapps directory where i can put my servlets for example in
/home/myuser/myapplets
It's possible? If yes, how ?
Thanks You
Marco Rocco
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Adding a new webapps directory
Posted by Marco Rocco <mr...@gmail.com>.
Caldarale, Charles R ha scritto:
>> From: Marco Rocco [mailto:mr85mr@gmail.com]
>> Subject: Adding a new webapps directory
>>
>> It's possible to add a new webapps directroy more then the default
>> tomcat webapps (/opt/tomcat/webapps) ?
>>
>
> There is no means of specifying more than one appBase directory per <Host>. However, each <Host> element can specify a separate appBase directory, so you can segregate your webapps that way. You can also create <Context> elements in conf/Catalina/[host]/[appName].xml that have docBase attributes pointing to a specific deployment location for the webapp outside of the <Host> appBase.
>
> - Chuck
>
>
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
>
But it's possible to Add a new appBase directory per <Host> ? How ?
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RE: Adding a new webapps directory
Posted by Jeffrey Janner <Je...@PolyDyne.com>.
Thanks,
I'll just leave things as is: empty directory with unpackWars set to
false.
Jeff
-----Original Message-----
From: Caldarale, Charles R [mailto:Chuck.Caldarale@unisys.com]
Sent: Monday, October 19, 2009 10:55 AM
To: Tomcat Users List
Subject: RE: Adding a new webapps directory
> From: Jeffrey Janner [mailto:Jeffrey.Janner@PolyDyne.com]
> Subject: RE: Adding a new webapps directory
>
> On a related note, is the appBase required?
> I think I tried it at 4.x and Tomcat wouldn't come up without it. I'm
> at 5.5.x now, going to 6.x in the near future. Is it still required?
In 6.0.20, it looks like you have to specify the appBase attribute, but
the directory doesn't need to exist as long as unpackWars is false.
Strikes me as a bit risky, though.
- Chuck
THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
******************************* NOTICE *********************************
This message is intended for the use of the individual or entity to which
it is addressed and may contain information that is privileged,
confidential, and exempt from disclosure under applicable law. If the
reader of this message is not the intended recipient or the employee or
agent responsible for delivering this message to the intended recipient,
you are hereby notified that any dissemination, distribution, or copying
of this communication is strictly prohibited. If you have received this
communication in error, please notify us immediately by reply or by
telephone (call us collect at 512-343-9100) and immediately delete this
message and all its attachments.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RE: Adding a new webapps directory
Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Jeffrey Janner [mailto:Jeffrey.Janner@PolyDyne.com]
> Subject: RE: Adding a new webapps directory
>
> On a related note, is the appBase required?
> I think I tried it at 4.x and Tomcat wouldn't come up without it. I'm
> at 5.5.x now, going to 6.x in the near future. Is it still required?
In 6.0.20, it looks like you have to specify the appBase attribute, but the directory doesn't need to exist as long as unpackWars is false. Strikes me as a bit risky, though.
- Chuck
THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RE: Adding a new webapps directory
Posted by Jeffrey Janner <Je...@PolyDyne.com>.
Charles -
On a related note, is the appBase required?
I deploy strictly using the conf/[Engine]/[Host]/[appName].xml method
and have no actual use for the appBase directory. However, all my hosts
end up pointing to an empty directory. I'd prefer not to have it just
sitting around since it's not needed.
I think I tried it at 4.x and Tomcat wouldn't come up without it. I'm
at 5.5.x now, going to 6.x in the near future. Is it still required?
Jeff
-----Original Message-----
From: Caldarale, Charles R [mailto:Chuck.Caldarale@unisys.com]
Sent: Saturday, October 17, 2009 10:11 AM
To: Tomcat Users List
Subject: RE: Adding a new webapps directory
> From: Marco Rocco [mailto:mr85mr@gmail.com]
> Subject: Adding a new webapps directory
>
> It's possible to add a new webapps directroy more then the default
> tomcat webapps (/opt/tomcat/webapps) ?
There is no means of specifying more than one appBase directory per
<Host>. However, each <Host> element can specify a separate appBase
directory, so you can segregate your webapps that way. You can also
create <Context> elements in conf/Catalina/[host]/[appName].xml that
have docBase attributes pointing to a specific deployment location for
the webapp outside of the <Host> appBase.
- Chuck
THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
******************************* NOTICE *********************************
This message is intended for the use of the individual or entity to which
it is addressed and may contain information that is privileged,
confidential, and exempt from disclosure under applicable law. If the
reader of this message is not the intended recipient or the employee or
agent responsible for delivering this message to the intended recipient,
you are hereby notified that any dissemination, distribution, or copying
of this communication is strictly prohibited. If you have received this
communication in error, please notify us immediately by reply or by
telephone (call us collect at 512-343-9100) and immediately delete this
message and all its attachments.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RE: Adding a new webapps directory
Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Ziggy [mailto:ziggy25@gmail.com]
> Subject: Re: Adding a new webapps directory
>
> Can't this not be achieved by using a different CATALINA_BASE?
Only if you want two instances of Tomcat running, not one. Read the RUNNING.txt file in the Tomcat download.
- Chuck
THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Adding a new webapps directory
Posted by Ziggy <zi...@gmail.com>.
Can't this not be achieved by using a different CATALINA_BASE?
On 10/17/09, Caldarale, Charles R <Ch...@unisys.com> wrote:
>> From: Marco Rocco [mailto:mr85mr@gmail.com]
>> Subject: Re: Adding a new webapps directory
>>
>> at http://127.0.0.1:8080/ServletExample i get blank page. Any way this
>> is server.xml if this can help you: http://pastebin.com/f5fecfa93
>
> That looks ok. Is there anything in the logs?
>
> Try configuring an AccessLogValve for this <Host> to see what's coming in
> and going out:
>
> <Host name="myservlets" appBase="/home/marco/myservlets">
> <Valve className="org.apache.catalina.valves.AccessLogValve"
> directory="logs" prefix="myservlets_access_log."
> suffix=".txt"
> pattern="common" resolveHosts="false"/>
> </Host>
>
> - Chuck
>
>
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
> MATERIAL and is thus for use only by the intended recipient. If you received
> this in error, please contact the sender and delete the e-mail and its
> attachments from all computers.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
--
Sent from my mobile device
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RE: Adding a new webapps directory
Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Marco Rocco [mailto:mr85mr@gmail.com]
> Subject: Re: Adding a new webapps directory
>
> at http://127.0.0.1:8080/ServletExample i get blank page. Any way this
> is server.xml if this can help you: http://pastebin.com/f5fecfa93
That looks ok. Is there anything in the logs?
Try configuring an AccessLogValve for this <Host> to see what's coming in and going out:
<Host name="myservlets" appBase="/home/marco/myservlets">
<Valve className="org.apache.catalina.valves.AccessLogValve"
directory="logs" prefix="myservlets_access_log." suffix=".txt"
pattern="common" resolveHosts="false"/>
</Host>
- Chuck
THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Adding a new webapps directory
Posted by Marco Rocco <mr...@gmail.com>.
Caldarale, Charles R ha scritto:
>> From: Marco Rocco [mailto:mr85mr@gmail.com]
>> Subject: Re: Adding a new webapps directory
>>
>> in /opt/tomcat/conf/server.xml i have added:
>> <Host name="Myservlets" appBase="/home/marco/Myservlets"/>
>>
>> But if i try to access it at http://localhost:8080/ServletExample
>> i get: _The requested resource (/ServletExample) is not available.
>>
>
> As you should. Your <Host> name is Myservlets, so that will need to be used on the URL:
>
> http://Myservlets:8080/ServletExample
>
> You will need to insure that the name "Myservlets" resolves to the IP address of your server.
>
> Alternatively, change the defaultHost attribute of your <Engine> to point to "Myservlets"; this will allow you to access your ServletExample via any URL *other* than "localhost", such as the IP address:
>
> http://127.0.0.1:8080/ServletExample
>
> - Chuck
>
>
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
>
at http://127.0.0.1:8080/ServletExample i get blank page. Any way this
is server.xml if this can help you: http://pastebin.com/f5fecfa93
Note: I have changed all "Myservlets" to "myservlets".
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RE: Adding a new webapps directory
Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Marco Rocco [mailto:mr85mr@gmail.com]
> Subject: Re: Adding a new webapps directory
>
> in /opt/tomcat/conf/server.xml i have added:
> <Host name="Myservlets" appBase="/home/marco/Myservlets"/>
>
> But if i try to access it at http://localhost:8080/ServletExample
> i get: _The requested resource (/ServletExample) is not available.
As you should. Your <Host> name is Myservlets, so that will need to be used on the URL:
http://Myservlets:8080/ServletExample
You will need to insure that the name "Myservlets" resolves to the IP address of your server.
Alternatively, change the defaultHost attribute of your <Engine> to point to "Myservlets"; this will allow you to access your ServletExample via any URL *other* than "localhost", such as the IP address:
http://127.0.0.1:8080/ServletExample
- Chuck
THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Adding a new webapps directory
Posted by Marco Rocco <mr...@gmail.com>.
Caldarale, Charles R ha scritto:
>> From: Marco Rocco [mailto:mr85mr@gmail.com]
>> Subject: Re: Adding a new webapps directory
>>
>> Ok, i think that I would add a new Host, io order to do this: I have to
>> add a new <Host> section in /opt/tomcat/conf/server.xml ?
>>
>
> Correct. Doc for virtual hosting for the current level is here:
> http://tomcat.apache.org/tomcat-6.0-doc/virtual-hosting-howto.html
>
> - Chuck
>
>
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
>
Thanks, I have read
http://tomcat.apache.org/tomcat-6.0-doc/virtual-hosting-howto.html .
But i have the problem that tomcat doesn't views my Servlet for example:
in /opt/tomcat/conf/server.xml i have added:
<Host name="Myservlets" appBase="/home/marco/Myservlets"/>
I have created /home/marco/Myservlets
$ mkdir /home/marco/Myservlets
After i have copied my servlet ("ServletExample") in
/home/marco/Myservlets/ and i have restarted TomCat Daemon.
But if i try to access it at http://localhost:8080/ServletExample
i get: _The requested resource (/ServletExample) is not available.
_the same error also if i access at
http://localhost:8080/Myservlets/ServletExample
The content of ServletExample is this:
$ pwd
/home/marco/Myservlets/ServletExample
$ ls
WEB-INF
$ cd WEB-INF/
$ ls
classes lib web.xml
$ cat web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>ServletExample</display-name>
<servlet>
<description>
</description>
<display-name>ServletExample</display-name>
<servlet-name>ServletExample</servlet-name>
<servlet-class>hello.ServletExample</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>ServletExample</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
</web-app>
If i copy this directory ("ServletExample") in /opt/tomcat/webapps, my
servlet works at this location: http://localhost:8080/ServletExample
What is the problem ?
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RE: Adding a new webapps directory
Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Marco Rocco [mailto:mr85mr@gmail.com]
> Subject: Re: Adding a new webapps directory
>
> Ok, i think that I would add a new Host, io order to do this: I have to
> add a new <Host> section in /opt/tomcat/conf/server.xml ?
Correct. Doc for virtual hosting for the current level is here:
http://tomcat.apache.org/tomcat-6.0-doc/virtual-hosting-howto.html
- Chuck
THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Adding a new webapps directory
Posted by Marco Rocco <mr...@gmail.com>.
Caldarale, Charles R ha scritto:
>> From: Marco Rocco [mailto:mr85mr@gmail.com]
>> Subject: Adding a new webapps directory
>>
>> It's possible to add a new webapps directroy more then the default
>> tomcat webapps (/opt/tomcat/webapps) ?
>>
>
> There is no means of specifying more than one appBase directory per <Host>. However, each <Host> element can specify a separate appBase directory, so you can segregate your webapps that way. You can also create <Context> elements in conf/Catalina/[host]/[appName].xml that have docBase attributes pointing to a specific deployment location for the webapp outside of the <Host> appBase.
>
> - Chuck
>
>
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
>
Ok, i think that I would add a new Host, io order to do this: I have to
add a new <Host> section in /opt/tomcat/conf/server.xml ?
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RE: Adding a new webapps directory
Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Marco Rocco [mailto:mr85mr@gmail.com]
> Subject: Adding a new webapps directory
>
> It's possible to add a new webapps directroy more then the default
> tomcat webapps (/opt/tomcat/webapps) ?
There is no means of specifying more than one appBase directory per <Host>. However, each <Host> element can specify a separate appBase directory, so you can segregate your webapps that way. You can also create <Context> elements in conf/Catalina/[host]/[appName].xml that have docBase attributes pointing to a specific deployment location for the webapp outside of the <Host> appBase.
- Chuck
THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org