You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Javier <xl...@yahoo.com> on 2003/11/02 21:04:43 UTC

Virtual host and app

Hi

I'm new to Tomcat 5 and I trying to get my first virtual host working.

Then I tried to make a test by simply make a HelloWorld servlet deployed in
PruebaJavier directory (below webapps) and I configured Tomcat like this:

host in server.xml
----------------------------
   <Host name="pjkt" debug="0" appBase="PruebaJavier" unpackWARs="true"
autoDeploy="true">
         <Valve className="org.apache.catalina.valves.AccessLogValve"
                 directory="logs"  prefix="pjkt_access_log." suffix=".txt"
                 pattern="common" resolveHosts="false"/>
        <Logger className="org.apache.catalina.logger.FileLogger"
                 directory="logs"  prefix="pjkt_error_log." suffix=".txt"
            timestamp="true"/>
   </Host>

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


pjkt is name asociated with 127.0.0.1 ip address in host files (in my
WinXP).....(it's a dirty way I use to have virtual hosts in my winXP).


In webapps/PruebaJavier/WEB-INF I've a web.xml file like this:

-------------------------------------
<web-app>

    <display-name>Prueba Javier</display-name>
    <description>
      Prueba Javier
    </description>


    <!-- Define example application events listeners -->
    <listener>
        <listener-class>listeners.ContextListener</listener-class>
    </listener>
    <listener>
        <listener-class>listeners.SessionListener</listener-class>
    </listener>

    <!-- Define servlets that are included in the example application -->

    <servlet>
        <servlet-name>HelloWorldExample</servlet-name>
        <servlet-class>HelloWorldExample</servlet-class>
    </servlet>


</web-app>
--------------------------------


Now I tried to run http://pjkt:8080/HelloWorldExample and nothing happens
!!! No errors in log...nothing to see....


What I did wrong ??

How could I configure a simple vhost and how could I configure my servlet
as default index as I made with Apache with my php applications ? (I dont
want to make jsp files).

Thank in advance !


<jl>




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


Re: Re[4]: Virtual host and app

Posted by Dom <do...@free.fr>.
Hi

in your web app web.xml  (see web-app_2_3.dtd)  :

<welcome-file-list>
    <welcome-file>your-servlet-name</welcome-file>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>index.html</welcome-file>
</welcome-file-list>

Dom

----- Original Message -----
From: "Javier" <xl...@yahoo.com>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Monday, November 03, 2003 7:17 PM
Subject: Re[4]: Virtual host and app


> On 03/11/2003 at 17:56 Dominique Batard wrote:
>
> >
> >Having deployed your app under webapps (you shouldn't with virtual hosts)
> ,
> >you can also access it within localhost :
> >http://localhost:8080/PruebaJavier/ (this is possible only because you've
> >used the webapps absolute URL in appBase)
> >
> >If you want a pjkt virtual Host and a PruebaJavier Context :
> >
> ><Host name="pjkt" debug="0" appBase="C:\Program Files\Apache Software
> >Foundation\Tomcat 5.0\webapps\PruebaJavier" unpackWARs="true"
> >autoDeploy="true">
> >   <Context path="/PruebaJavier" reloadable="true" docBase="." />
> ></Host>
> >
>
>
> Ok, thanks...it worked !
>
> The only thing nobody answer is: which is the equivalent setting for
Apache
> DirectoryIndex ?
>
> I mean that if the user write in url just http://pjkt:8080 I want to have
> configured a default servlet to show (as is index.php in my php
> applications).
>
>
> Thanks in advance
>
> <jl>
>
>
>
>
> ---------------------------------------------------------------------
> 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[4]: Virtual host and app

Posted by Javier <xl...@yahoo.com>.
On 03/11/2003 at 17:56 Dominique Batard wrote:

>
>Having deployed your app under webapps (you shouldn't with virtual hosts)
,
>you can also access it within localhost :
>http://localhost:8080/PruebaJavier/ (this is possible only because you've
>used the webapps absolute URL in appBase)
>
>If you want a pjkt virtual Host and a PruebaJavier Context :
>
><Host name="pjkt" debug="0" appBase="C:\Program Files\Apache Software
>Foundation\Tomcat 5.0\webapps\PruebaJavier" unpackWARs="true"
>autoDeploy="true">
>   <Context path="/PruebaJavier" reloadable="true" docBase="." />
></Host>
>


Ok, thanks...it worked !

The only thing nobody answer is: which is the equivalent setting for Apache
DirectoryIndex ?

I mean that if the user write in url just http://pjkt:8080 I want to have
configured a default servlet to show (as is index.php in my php
applications).


Thanks in advance

<jl>




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


Re: Re[2]: Virtual host and app

Posted by Dominique Batard <db...@sf2r.fr>.
Hi

You may have an other instance of Tomcat running.

You really have troubles with Host and Context
(You should avoid spaces in your directory names)

If you need a PruebaJavier virtual Host and a default Context (/) :
<Host name="PruebaJavier" debug="0" appBase="C:\Program Files\Apache
Software Foundation\Tomcat 5.0\webapps\PruebaJavier" unpackWARs="true"
autoDeploy="true">
   <Context path="" reloadable="true" docBase="." />
</Host>

the url will be http://PruebaJavier:8080/

Having deployed your app under webapps (you shouldn't with virtual hosts) ,
you can also access it within localhost :
http://localhost:8080/PruebaJavier/ (this is possible only because you've
used the webapps absolute URL in appBase)

If you want a pjkt virtual Host and a PruebaJavier Context :

<Host name="pjkt" debug="0" appBase="C:\Program Files\Apache Software
Foundation\Tomcat 5.0\webapps\PruebaJavier" unpackWARs="true"
autoDeploy="true">
   <Context path="/PruebaJavier" reloadable="true" docBase="." />
</Host>

(Note the / in path)

the url will be http://pjkt:8080/PruebaJavier/

Dom

----- Original Message -----
From: "Javier" <xl...@yahoo.com>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Sunday, November 02, 2003 10:27 PM
Subject: Re[2]: Virtual host and app


> On 02/11/2003 at 13:34 Sean Dockery wrote:
>
> >You need a Context node in your Host for the default context.
> >
>
>
> Thanks for your reply.
>
> I've tried to get a Context setting in many ways but I give up...
>
> If I've my application in
>
> webapps
> +--PruebaJavier
>    +--images
>    +--WEB-INF
>       +--classes
>          +--listeners
>          +--filters
>          +--compressionFilters
>          +--util
>
> How could I get a well configured context ?
>
> I made
>
> <Context path="PruebaJavier" docBase="C:\Program Files\Apache Software
> Foundation\Tomcat 5.0\webapps\PruebaJavier\" debug="0" />
>
> but I really don't understand difference between path and docBase (after
> read documentation). Also, I want to know wich is the equivalent setting
> for Apache DirectoryIndex.
>
> And as last problem...I receive the following error:
>
> ------------------
> Error initializing endpoint
> java.net.BindException: Address already in use: JVM_Bind:8080
> at
>
org.apache.tomcat.util.net.PoolTcpEndpoint.initEndpoint(PoolTcpEndpoint.java
> :286)
> at org.apache.coyote.http11.Http11Protocol.init(Http11Protocol.java:184)
> at
>
org.apache.coyote.tomcat5.CoyoteConnector.initialize(CoyoteConnector.java:13
> 26)
> at
>
org.apache.catalina.core.StandardService.initialize(StandardService.java:633
> )
> at
>
org.apache.catalina.core.StandardServer.initialize(StandardServer.java:2413)
>
> at org.apache.catalina.startup.Catalina.load(Catalina.java:531)
> at org.apache.catalina.startup.Catalina.load(Catalina.java:552)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:260)
> at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:396)
> 02-nov-2003 22:21:05 org.apache.catalina.startup.Catalina load
> GRAVE: Catalina.start
> LifecycleException:  Protocol handler initialization failed:
> java.net.BindException: Address already in use: JVM_Bind:8080
> at
>
org.apache.coyote.tomcat5.CoyoteConnector.initialize(CoyoteConnector.java:13
> 28)
> at
>
org.apache.catalina.core.StandardService.initialize(StandardService.java:633
> )
> at
>
org.apache.catalina.core.StandardServer.initialize(StandardServer.java:2413)
>
> at org.apache.catalina.startup.Catalina.load(Catalina.java:531)
> at org.apache.catalina.startup.Catalina.load(Catalina.java:552)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:260)
> at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:396)
>
> ------------------------------
>
> And I don't know why it's produced...
>
> Any help will be welcome
>
> <jl>
>
>
>
>
> ---------------------------------------------------------------------
> 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: Basic and Form authhentication in the same webapp (revisited). Request for opinions

Posted by Vincent Aumont <vi...@vsl.ca>.
>
>
>>
>>
>> An HTML browser will never require Basic Auth. 
>
>
> ?? Why? I'm missing something here.....in web.xml, what do you do if I 
> chose BASIC instead of FORM?


If your browser can accept HTML, then it can use FORM authentication.
It is documented that you must use FORM authentication in web.xml when 
you deploy the app.
 Even if you don't, it should still work (as long as you specify the 
login and error page in the login-config tag) because teh authenticator 
Tomcat creates after reding web.xml is never called. I use web.xml just 
to make sure that the LoginConfig  instance that gets passed to my 
authenticator contains the right information.


-Vincent.


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


Re: Basic and Form authhentication in the same webapp (revisited). Request for opinions

Posted by Jean-Francois Arcand <jf...@apache.org>.

Vincent Aumont wrote:

>>
>> How do you manage the case when someone else deploy a web app that 
>> requires basic authentication using the browser? If Tomcat is used 
>> only by your app, then your solution seems correct.
>
>
>
> An HTML browser will never require Basic Auth. 

?? Why? I'm missing something here.....in web.xml, what do you do if I 
chose BASIC instead of FORM?

-- Jeanfrancois


>
> The downside if this solution is that it ties me to Tomcat. I'm ready 
> to pay that price. If we later  need to switch to another container, 
> I'll split the webapp in two.
> -Vincent.
>
>
> ---------------------------------------------------------------------
> 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: Basic and Form authhentication in the same webapp (revisited). Request for opinions

Posted by Vincent Aumont <vi...@vsl.ca>.
>
> How do you manage the case when someone else deploy a web app that 
> requires basic authentication using the browser? If Tomcat is used 
> only by your app, then your solution seems correct.


An HTML browser will never require Basic Auth.
The downside if this solution is that it ties me to Tomcat. I'm ready to 
pay that price. If we later  need to switch to another container, I'll 
split the webapp in two.
-Vincent.


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


Re: Basic and Form authhentication in the same webapp (revisited). Request for opinions

Posted by Jean-Francois Arcand <jf...@apache.org>.

Vincent Aumont wrote:

> Hello,
>
> I need your opinion on a solution I found to allow a single webapp to 
> support two authentication modes.
>
> The application Im working on has two types of clients: HTML and WML. 
> The controller (Struts) can forward a request to the appropriate JSP, 
> depending on the clients type.
> WML clients (PDAs) are limited to Basic authentication; I want to use 
> FORM authentication for HTML clients. Because the Servlet 2.3 specs do 
> not allow to specify more than one authentication mode in web.xml, I 
> have to use 2 webapps if I want to stay compliant.
> Last week I posted a solution to work around this, only to realize 
> that it does not work.
>
> I found this other solution:
>
> 1) I declare the security constraints in web.xml as usual. I set the 
> authentication mode to FORM.
> 2) I have two custom classes: MyBasicAuthenticator and 
> MyFormAuthenticator that inherit from BasicAuthenticator and 
> FormAuthenticator, respectively.
> 3) By nature, these two classes also implement the Valve interface. I 
> register them in my webapps context (in web.xml):
>
> <Context path="/test" docBase="/home/test">
> <Valve className="PortalBasicAuthenticator"/>
> <Valve className="PortalFormAuthentication"/>
> </Context>
>
> 4) These classes do nothing but invoke their super class it the client 
> has the appropriate type:
>
> public class MyBasicAuthenticator{
>
> public void invoke(Request request, Response response,
> ValveContext context)
> throws IOException, ServletException
> {
> if (isWMLClient(request)) {
> super.invoke(&);
> } else {
> context.invokeNext(request, response);
> }
> }
>
> public class MyFormAuthenticator{
>
> public void invoke(Request request, Response response,
> ValveContext context)
> throws IOException, ServletException
> {
> if (isHTMLClient(request)) {
> super.invoke(&);
> } else {
> context.invokeNext(request, response);
> }
> }
>
> Here is how it works:
> - Setting the security constraints in web.xml will cause Tomact to add 
> a FormAuthenticator valve in the pipeline.
> - TC will never execute that particular valve because the two valves I 
> have added to my context will be executed first and will take care of 
> authentication.
> - When a WML client makes a request, MyBasicAuthenticator traps it and 
> executes Tomcat's BasicAuthenticatot code. Because I defined the 
> security constraints in web.xml, the authenticator receives the right 
> login info (protected urls, roles, etc.). If the user enters valid 
> credentials, the form authenticator tomcat created wont be called 
> because we already have a Principal. If the user provides invalid 
> credentials, the user gets an error and the pipeline is interrupted. 
> Therefore, the form authenticator Tomcat created wont be called either.
> - Same thing for a request from an HTML client: MyFormAuthenticator 
> will traps the request and take care of the authentication.
>
> I tried it and it seems to work fine.
>
> Can you think of any gotchas? Am I missing something obvious? Is there 
> a simpler solution? 


How do you manage the case when someone else deploy a web app that 
requires basic authentication using the browser? If Tomcat is used only 
by your app, then your solution seems correct.

-- Jeanfrancois



>
>
> Thanks,
>
> -Vincent.
>
>
>
>
>
>
>
> ---------------------------------------------------------------------
> 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


Basic and Form authhentication in the same webapp (revisited). Request for opinions

Posted by Vincent Aumont <vi...@vsl.ca>.
Hello,

I need your opinion on a solution I found to allow a single webapp to 
support two authentication modes.

The application Im working on has two types of clients: HTML and WML. 
The controller (Struts) can forward a request to the appropriate JSP, 
depending on the clients type.
WML clients (PDAs) are limited to Basic authentication; I want to use 
FORM authentication for HTML clients. Because the Servlet 2.3 specs do 
not allow to specify more than one authentication mode in web.xml, I 
have to use 2 webapps if I want to stay compliant.
Last week I posted a solution to work around this, only to realize that 
it does not work.

I found this other solution:

1) I declare the security constraints in web.xml as usual. I set the 
authentication mode to FORM.
2) I have two custom classes: MyBasicAuthenticator and 
MyFormAuthenticator that inherit from BasicAuthenticator and 
FormAuthenticator, respectively.
3) By nature, these two classes also implement the Valve interface. I 
register them in my webapps context (in web.xml):

<Context path="/test" docBase="/home/test">
<Valve className="PortalBasicAuthenticator"/>
<Valve className="PortalFormAuthentication"/>
</Context>

4) These classes do nothing but invoke their super class it the client 
has the appropriate type:

public class MyBasicAuthenticator{

public void invoke(Request request, Response response,
ValveContext context)
throws IOException, ServletException
{
if (isWMLClient(request)) {
super.invoke(&);
} else {
context.invokeNext(request, response);
}
}

public class MyFormAuthenticator{

public void invoke(Request request, Response response,
ValveContext context)
throws IOException, ServletException
{
if (isHTMLClient(request)) {
super.invoke(&);
} else {
context.invokeNext(request, response);
}
}

Here is how it works:
- Setting the security constraints in web.xml will cause Tomact to add a 
FormAuthenticator valve in the pipeline.
- TC will never execute that particular valve because the two valves I 
have added to my context will be executed first and will take care of 
authentication.
- When a WML client makes a request, MyBasicAuthenticator traps it and 
executes Tomcat's BasicAuthenticatot code. Because I defined the 
security constraints in web.xml, the authenticator receives the right 
login info (protected urls, roles, etc.). If the user enters valid 
credentials, the form authenticator tomcat created wont be called 
because we already have a Principal. If the user provides invalid 
credentials, the user gets an error and the pipeline is interrupted. 
Therefore, the form authenticator Tomcat created wont be called either.
- Same thing for a request from an HTML client: MyFormAuthenticator will 
traps the request and take care of the authentication.

I tried it and it seems to work fine.

Can you think of any gotchas? Am I missing something obvious? Is there a 
simpler solution?

Thanks,

-Vincent.







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


RE: Re[2]: Virtual host and app

Posted by Sean Dockery <j2...@sbdconsultants.com>.
The context path, or simply path, is the logical path under which your
application is deployed.  The context path is part of the URL that is passed
to the web browser.  For example:

http://localhost:8080/path/

docBase is the physical path in the file system where your web application
is located.

I would instead try path="/PruebaJavier" (or perhaps just path="/") in your
Context node.  Then access your web application with
http://pjkt:8080/PurebaJavier (or just http://pjkt:8080/ if you used
path="/").

The JVM_Bind error indicates that something is already listening on port
8080 on your machine.  Is Tomcat already running?


-----Original Message-----
From: Javier [mailto:xleyba@yahoo.com]
Sent: Sunday, November 02, 2003 14:28
To: Tomcat Users List
Subject: Re[2]: Virtual host and app


On 02/11/2003 at 13:34 Sean Dockery wrote:

>You need a Context node in your Host for the default context.
>


Thanks for your reply.

I've tried to get a Context setting in many ways but I give up...

If I've my application in

webapps
+--PruebaJavier
   +--images
   +--WEB-INF
      +--classes
         +--listeners
         +--filters
         +--compressionFilters
         +--util

How could I get a well configured context ?

I made

<Context path="PruebaJavier" docBase="C:\Program Files\Apache Software
Foundation\Tomcat 5.0\webapps\PruebaJavier\" debug="0" />

but I really don't understand difference between path and docBase (after
read documentation). Also, I want to know wich is the equivalent setting
for Apache DirectoryIndex.

And as last problem...I receive the following error:

------------------
Error initializing endpoint
java.net.BindException: Address already in use: JVM_Bind:8080
	at
org.apache.tomcat.util.net.PoolTcpEndpoint.initEndpoint(PoolTcpEndpoint.java
:286)
	at org.apache.coyote.http11.Http11Protocol.init(Http11Protocol.java:184)
	at
org.apache.coyote.tomcat5.CoyoteConnector.initialize(CoyoteConnector.java:13
26)
	at
org.apache.catalina.core.StandardService.initialize(StandardService.java:633
)
	at
org.apache.catalina.core.StandardServer.initialize(StandardServer.java:2413)

	at org.apache.catalina.startup.Catalina.load(Catalina.java:531)
	at org.apache.catalina.startup.Catalina.load(Catalina.java:552)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:260)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:396)
02-nov-2003 22:21:05 org.apache.catalina.startup.Catalina load
GRAVE: Catalina.start
LifecycleException:  Protocol handler initialization failed:
java.net.BindException: Address already in use: JVM_Bind:8080
	at
org.apache.coyote.tomcat5.CoyoteConnector.initialize(CoyoteConnector.java:13
28)
	at
org.apache.catalina.core.StandardService.initialize(StandardService.java:633
)
	at
org.apache.catalina.core.StandardServer.initialize(StandardServer.java:2413)

	at org.apache.catalina.startup.Catalina.load(Catalina.java:531)
	at org.apache.catalina.startup.Catalina.load(Catalina.java:552)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:260)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:396)

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

And I don't know why it's produced...

Any help will be welcome

<jl>




---------------------------------------------------------------------
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[2]: Virtual host and app

Posted by Javier <xl...@yahoo.com>.
On 02/11/2003 at 13:34 Sean Dockery wrote:

>You need a Context node in your Host for the default context.
>


Thanks for your reply.

I've tried to get a Context setting in many ways but I give up...

If I've my application in 

webapps
+--PruebaJavier
   +--images
   +--WEB-INF
      +--classes
         +--listeners
         +--filters
         +--compressionFilters
         +--util

How could I get a well configured context ?

I made 

<Context path="PruebaJavier" docBase="C:\Program Files\Apache Software
Foundation\Tomcat 5.0\webapps\PruebaJavier\" debug="0" />  

but I really don't understand difference between path and docBase (after
read documentation). Also, I want to know wich is the equivalent setting
for Apache DirectoryIndex.

And as last problem...I receive the following error:

------------------
Error initializing endpoint
java.net.BindException: Address already in use: JVM_Bind:8080
	at
org.apache.tomcat.util.net.PoolTcpEndpoint.initEndpoint(PoolTcpEndpoint.java
:286)
	at org.apache.coyote.http11.Http11Protocol.init(Http11Protocol.java:184)
	at
org.apache.coyote.tomcat5.CoyoteConnector.initialize(CoyoteConnector.java:13
26)
	at
org.apache.catalina.core.StandardService.initialize(StandardService.java:633
)
	at
org.apache.catalina.core.StandardServer.initialize(StandardServer.java:2413)

	at org.apache.catalina.startup.Catalina.load(Catalina.java:531)
	at org.apache.catalina.startup.Catalina.load(Catalina.java:552)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:260)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:396)
02-nov-2003 22:21:05 org.apache.catalina.startup.Catalina load
GRAVE: Catalina.start
LifecycleException:  Protocol handler initialization failed:
java.net.BindException: Address already in use: JVM_Bind:8080
	at
org.apache.coyote.tomcat5.CoyoteConnector.initialize(CoyoteConnector.java:13
28)
	at
org.apache.catalina.core.StandardService.initialize(StandardService.java:633
)
	at
org.apache.catalina.core.StandardServer.initialize(StandardServer.java:2413)

	at org.apache.catalina.startup.Catalina.load(Catalina.java:531)
	at org.apache.catalina.startup.Catalina.load(Catalina.java:552)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:260)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:396)

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

And I don't know why it's produced...

Any help will be welcome

<jl>




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


Re: Virtual host and app

Posted by Sean Dockery <us...@sbdconsultants.com>.
You need a Context node in your Host for the default context.

"Javier" <xl...@yahoo.com> wrote in message
news:200311022104430763.00706AA5@smtp.adsl.ya.com...
>
> Hi
>
> I'm new to Tomcat 5 and I trying to get my first virtual host working.
>
> Then I tried to make a test by simply make a HelloWorld servlet deployed
in
> PruebaJavier directory (below webapps) and I configured Tomcat like this:
>
> host in server.xml
> ----------------------------
>    <Host name="pjkt" debug="0" appBase="PruebaJavier" unpackWARs="true"
> autoDeploy="true">
>          <Valve className="org.apache.catalina.valves.AccessLogValve"
>                  directory="logs"  prefix="pjkt_access_log." suffix=".txt"
>                  pattern="common" resolveHosts="false"/>
>         <Logger className="org.apache.catalina.logger.FileLogger"
>                  directory="logs"  prefix="pjkt_error_log." suffix=".txt"
>             timestamp="true"/>
>    </Host>
>
> -----------------------------
>
>
> pjkt is name asociated with 127.0.0.1 ip address in host files (in my
> WinXP).....(it's a dirty way I use to have virtual hosts in my winXP).
>
>
> In webapps/PruebaJavier/WEB-INF I've a web.xml file like this:
>
> -------------------------------------
> <web-app>
>
>     <display-name>Prueba Javier</display-name>
>     <description>
>       Prueba Javier
>     </description>
>
>
>     <!-- Define example application events listeners -->
>     <listener>
>         <listener-class>listeners.ContextListener</listener-class>
>     </listener>
>     <listener>
>         <listener-class>listeners.SessionListener</listener-class>
>     </listener>
>
>     <!-- Define servlets that are included in the example application -->
>
>     <servlet>
>         <servlet-name>HelloWorldExample</servlet-name>
>         <servlet-class>HelloWorldExample</servlet-class>
>     </servlet>
>
>
> </web-app>
> --------------------------------
>
>
> Now I tried to run http://pjkt:8080/HelloWorldExample and nothing happens
> !!! No errors in log...nothing to see....
>
>
> What I did wrong ??
>
> How could I configure a simple vhost and how could I configure my servlet
> as default index as I made with Apache with my php applications ? (I dont
> want to make jsp files).
>
> Thank in advance !
>
>
> <jl>




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