Caldarale, Charles R ha scritto:
From: Marco Rocco [mailto:mr8...@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-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@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-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to