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 Moore <jb...@microps.com> on 2007/03/13 02:28:59 UTC

How does one configure Plain host domain url to run web app?

(Tomcat 4.x)

I have the following url that runs an application (pseudo url for 
discussion only)


http://www.mydomain.com/mysite/thecontext

works fine..

I would like to configure it so that..

http://www.mydomain.com

gets me to the same place..

I can place a "redirect" html page at

http://www.mydomain.com/mysite/index.html

which redirects to

http://www.mydomain.com/mysite/thecontext

but have yet to get a plain

http://www.mydomain.com

to work.. I keep getting either the "No Context configured....." error 
or the dreaded index of the directory..

I've tried Aliaes, Document root, Directory, and various JkMount 
settings in the Virtual host conf file that seemed like it might work, 
but so far, no joy..  (Tried Googling it, but have not come up with the 
right key words..)

Some of the things I have tried  in the conf file..

==========================
Alias /mysite "usr/tomcat/webapps/mysite"
Alias / "usr/tomcat/webapps/mysite"

 DocumentRoot "/usr/local/tomcat/webapps/mysite/"

 <Directory "/usr/local/tomcat/webapps/mysite">
        Options Indexes FollowSymLinks
        DirectoryIndex index.html index.htm index.jsp
  </Directory>

    JkMount /mysite/thecontext  ajp13
    JkMount /mysite/*.jsp  ajp13

..variations of..
    JkMount /*.jsp  ajp13  -- gives me a dreaded index of the correct 
directory
   JkMount /*.html  ajp13  -- same as above
   JkMount /*.  ajp13  -- blank document (strange)
   JkMount /*  ajp13  -- context error
=================================

Suggestions appreciated..

(all of my other machines are running Tomcat 5.. I will be moving this 
app next month.. so a Tomcat 5 suggestion would be welcome as well)

John..



---------------------------------------------------------------------
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: How does one configure Plain host domain url to run web app?

Posted by John Moore <jb...@microps.com>.
Folks,

I found the solution and it was embarrassingly simple.. (an often 
occurrence..)

All I had to do was set the DocumentRoot to where I wanted the 
index.html to be run from.

(I found it when I was deleting all of the various "test" settings, 
Directory tags, Aliaes, redirects and left the DocumentRoot setting just 
for grins.  I then tested the site to see if the webapps were still 
working but quickly tried the domain root.. what the heck.. it worked..!!!)

So.. there you go..

John...



---------------------------------------------------------------------
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: Can one map a servlet to a specific connctor?

Posted by Peter Kennard <pe...@livingwork.com>.
Thanks - I assume "any way you want" would include the port?
I'll have to dive more into Filters.

At 01:15 3/13/2007, you wrote:
> > From: Peter Kennard [mailto:peterk@livingwork.com]
> > Subject: Can one map a servlet to a specific connctor?
> >
> > On a stand alone tomcat with more than one connector (port)
> > Is it possible to map a servlet to only one or a subset of connectors?
>
>No, but you can use a filter or valve to restrict access any way you
>want.
>
>  - Chuck



---------------------------------------------------------------------
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: Can one map a servlet to a specific connctor?

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Peter Kennard [mailto:peterk@livingwork.com] 
> Subject: Can one map a servlet to a specific connctor?
> 
> On a stand alone tomcat with more than one connector (port)
> Is it possible to map a servlet to only one or a subset of connectors?

No, but you can use a filter or valve to restrict access any way you
want.

 - 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 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: Can one map a servlet to a specific connctor?

Posted by Peter Kennard <pe...@livingwork.com>.
>Try ServletRequest.getLocalPort() rather than getServerPort().

Yes exactly, thanks - that is an addition to the api after the book I read :)
eclipse auto-complete and the sun website is your friend :)

*****

Part of all these questions is I am looking to implement a servlet 
subclass which will "auto register" itself with an upstream front end 
(maybe AJP does this?) so ideally I would want to be able to query 
what URI "host,port,path" would access the proper connector and 
servlet when it's "init()" is called so I can pass it to upstream to 
the front-end router.  Of course at this time no request has been 
recieved.  I guess I could do it by parsing the server.xml or putting 
in rendundant per servlet initParameters but that makes me queasy, I 
like the thing itself to propagate it's own state changes :)

PK

At 11:58 3/13/2007, you wrote:
> > From: Caldarale, Charles R [mailto:Chuck.Caldarale@unisys.com]
> > Subject: RE: Can one map a servlet to a specific connctor?
>
>Try ServletRequest.getLocalPort() rather than getServerPort().



---------------------------------------------------------------------
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: Can one map a servlet to a specific connctor?

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Caldarale, Charles R [mailto:Chuck.Caldarale@unisys.com] 
> Subject: RE: Can one map a servlet to a specific connctor?

Try ServletRequest.getLocalPort() rather than getServerPort().

 - 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 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: Can one map a servlet to a specific connctor?

Posted by Peter Kennard <pe...@livingwork.com>.
This could be the ticket!

At 11:53 3/13/2007, you wrote:
>You could configure proxyPort in your <Connector> to some value that you
>could use as a flag for your particular environment.  This will override
>the header value returned by getServerPort().  Don't know if there would
>be any undesirable side effects.
>
>  - Chuck



---------------------------------------------------------------------
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: Can one map a servlet to a specific connctor?

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Peter Kennard [mailto:peterk@livingwork.com] 
> Subject: RE: Can one map a servlet to a specific connctor?
> 
> I Verified this returns the port indicated by the client in 
> the header.

You could configure proxyPort in your <Connector> to some value that you
could use as a flag for your particular environment.  This will override
the header value returned by getServerPort().  Don't know if there would
be any undesirable side effects.

 - 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 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: Can one map a servlet to a specific connctor?

Posted by Peter Kennard <pe...@livingwork.com>.
I Verified this returns the port indicated by the client in the header.

Not the port the request was recieved by at the tomcat instance.
Appropriate for a client to send and passed through by proxys, 
remappers, front ends etc. but not to determine where it ends up.
PK

At 07:23 3/13/2007, you wrote:
>Damn! I missed that :)  Thanks.
>
>I assume this is taking it from where the hit arrives in at the 
>server and not the HTTP headers passed in (which could be anything)
>
>At 01:32 3/13/2007, you wrote:
>> > From: Peter Kennard [mailto:peterk@livingwork.com]
>> > Subject: Re: Can one map a servlet to a specific connctor?
>> >
>> > Can I determine the connector port connected to for a request from
>> > service() I don't see it in the servlet API but am willing to access
>> > somthing tomcat specific.
>>
>>ServletRequest.getServerPort() is inherited by HTTPServletRequest.
>>
>>  - Chuck



---------------------------------------------------------------------
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: Can one map a servlet to a specific connctor?

Posted by Peter Kennard <pe...@livingwork.com>.
Damn! I missed that :)  Thanks.

I assume this is taking it from where the hit arrives in at the 
server and not the HTTP headers passed in (which could be anything)

At 01:32 3/13/2007, you wrote:
> > From: Peter Kennard [mailto:peterk@livingwork.com]
> > Subject: Re: Can one map a servlet to a specific connctor?
> >
> > Can I determine the connector port connected to for a request from
> > service() I don't see it in the servlet API but am willing to access
> > somthing tomcat specific.
>
>ServletRequest.getServerPort() is inherited by HTTPServletRequest.
>
>  - 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 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: Can one map a servlet to a specific connctor?

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Peter Kennard [mailto:peterk@livingwork.com] 
> Subject: Re: Can one map a servlet to a specific connctor?
> 
> Can I determine the connector port connected to for a request from 
> service() I don't see it in the servlet API but am willing to access 
> somthing tomcat specific.

ServletRequest.getServerPort() is inherited by HTTPServletRequest.

 - 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 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: Can one map a servlet to a specific connctor?

Posted by Peter Kennard <pe...@livingwork.com>.
I guess a corrollary question to this would be.
Can I determine the connector port connected to for a request from 
service() I don't see it in the servlet API but am willing to access 
somthing tomcat specific.
PK

At 21:57 3/12/2007, you wrote:

>On a stand alone tomcat with more than one connector (port)
>Is it possible to map a servlet to only one or a subset of connectors?
>
>Thanks PK
>
>
>---------------------------------------------------------------------
>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


Can one map a servlet to a specific connctor?

Posted by Peter Kennard <pe...@livingwork.com>.
On a stand alone tomcat with more than one connector (port)
Is it possible to map a servlet to only one or a subset of connectors?

Thanks PK


---------------------------------------------------------------------
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: How does one configure Plain host domain url to run web app?

Posted by Hassan Schroeder <ha...@gmail.com>.
On 3/13/07, John Moore <jb...@microps.com> wrote:

> > Front-ending Tomcat with Apache is messy :-)
>
> Really..????   Why.. ??

By which I meant, httpd is an extraneous complication, unless you
really need to have something like PHP or other service outside of
Tomcat. Do you?

If that's the case, mod_proxy_ajp is far simpler to configure than mod_jk.
But if not, simplify your life :-)

-- 
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: How does one configure Plain host domain url to run web app?

Posted by John Moore <jb...@microps.com>.
Hassan Schroeder wrote:
> On 3/13/07, John Moore <jb...@microps.com> wrote:
>
>> Problem with this an your solution is that is it messy..
>
> Front-ending Tomcat with Apache is messy :-)

Really..????   Why.. ??


---------------------------------------------------------------------
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: How does one configure Plain host domain url to run web app?

Posted by Hassan Schroeder <ha...@gmail.com>.
On 3/13/07, John Moore <jb...@microps.com> wrote:

> Problem with this an your solution is that is it messy..

Front-ending Tomcat with Apache is messy :-)

If you *must* use Apache for whatever reason, you'd be better off
using mod_proxy_ajp in conjunction with mod_rewrite to handle this
configuration.

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: How does one configure Plain host domain url to run web app?

Posted by John Moore <jb...@microps.com>.
org@kewlstuff.co.za wrote:
> Hi John,
>
> Ok, I'm going to try show you how I think about this stuff... and I'm 
> often wrong ;)
>
> Dont use a redirect... it goes back to the browser and its not cool.
>
> Firstly make a servlet and have a look at the CONTEXT.XML file under 
> META-INF
>
Thank you for taking the time to explain your idea..   I actually often 
do it another way.. I create another "host" for the webapp and then 
place the plain domain "www.mydomain.com" as an Apache HTdocs and then 
redirect to the webapp host..

Problem with this an your solution is that is it messy.. We serve a LOT 
of webapps and need to keep it as simple as possible..  I will study 
your idea and see if it can help me on finding a cleaner solution..

John..

---------------------------------------------------------------------
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: How does one configure Plain host domain url to run web app?

Posted by John Moore <jb...@microps.com>.
Caldarale, Charles R wrote:
>> From: org@kewlstuff.co.za [mailto:org@kewlstuff.co.za] 
>> Subject: Re: How does one configure Plain host domain url to 
>> run web app?
>>
>> Dont use a redirect... it goes back to the browser and its not cool.
>>     
>
> Nothing wrong with redirects.  They're quite appropriate to allow the
> browser to properly evaluate relative links in pages without the need
> for the extra gyrations you're suggesting.
>
>   
  I agree...

Do you have any thoughts on a solution...????

John..

RE: How does one configure Plain host domain url to run web app?

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: org@kewlstuff.co.za [mailto:org@kewlstuff.co.za] 
> Subject: Re: How does one configure Plain host domain url to 
> run web app?
> 
> Dont use a redirect... it goes back to the browser and its not cool.

Nothing wrong with redirects.  They're quite appropriate to allow the
browser to properly evaluate relative links in pages without the need
for the extra gyrations you're suggesting.

> Firstly make a servlet and have a look at the CONTEXT.XML file under 
> META-INF
> 
> Now have a look at WEB.XML under WEB-INF

Watch out for case sensitivity here; both context.xml and web.xml must
be lower-case file names.

 - 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 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: How does one configure Plain host domain url to run web app?

Posted by or...@kewlstuff.co.za.
Hi John,

Ok, I'm going to try show you how I think about this stuff... and I'm often 
wrong ;)

Dont use a redirect... it goes back to the browser and its not cool.

Firstly make a servlet and have a look at the CONTEXT.XML file under 
META-INF

Change it to......
<?xml version="1.0" encoding="UTF-8"?>
<Context path=""/>

Now have a look at WEB.XML under WEB-INF

make sure the mapping is
    <servlet-mapping>
        <servlet-name>NewServlet</servlet-name>
        <url-pattern>/*</url-pattern>
    </servlet-mapping>

OK.... now that servlet will run for any URI from the domain name up ie 
www.host.com/ANYTHINGorNOTHING

You can play with the mapping if you dont want that... but let me show you 
how I do this sort of stuff, and then you can tweak it as you want.

Now in the servlet make this routine

    protected void displayPage(HttpServletRequest request, 
HttpServletResponse response, String thePage)
    throws ServletException, IOException {

                RequestDispatcher dispatch = 
request.getRequestDispatcher(thePage);
                dispatch.forward(request, response);
     }

Now when the servlet is called in
    protected void processRequest(HttpServletRequest request, 
HttpServletResponse response)

do this

displayPage( request,  response,  "index.jsp");

So all of a sudden you can direct any URL to any page without redirects.... 
can use the API to check the URL and use a case statement whatever.

OK... heres the final trick coz it looks like you trying to run behind 
Apache

put this in the servlet.xml file in Tomcat.conf

    <Host name=www.site.com appBase="webapps"

    unpackWARs="true" autoDeploy="true"

    xmlValidation="false" xmlNamespaceAware="false">

    <!-- USE THIS FOR AUTO GEN OF JK MOD for Apache Forwarding to tomcat 
MODIFY PATHS FOR YOUR SYSTEM-->

    <Listener className="org.apache.jk.config.ApacheConfig" append="true" 
forwardAll="false" modJk="D:/DEV/Apache2.2/modules/mod_jk.so"/>



    </Host>

Now when you start Tomcat it will create a folder under conf/auto it puts 
all the stuff apache needs in a mod_jk.file

looks like this.... but its AUTOMATICALLY generated when tomcat starts.

    # Static files
    Alias /jsp-examples "D:/DEV/Tomcat 5.5/webapps/jsp-examples"

    <Directory "D:/DEV/Tomcat 5.5/webapps/jsp-examples">
        Options Indexes FollowSymLinks
        DirectoryIndex index.html index.htm index.jsp
    </Directory>


    # Deny direct access to WEB-INF and META-INF
    #
    <Location "/jsp-examples/WEB-INF/*">
        AllowOverride None
        deny from all
    </Location>

    <Location "/jsp-examples/META-INF/*">
        AllowOverride None
        deny from all
    </Location>
    #
    # Use Directory too. On Windows, Location doesn't work unless case 
matches
    #
    <Directory "D:/DEV/Tomcat 5.5/webapps/jsp-examples/WEB-INF/">
        AllowOverride None
        deny from all
    </Directory>

    <Directory "D:/DEV/Tomcat 5.5/webapps/jsp-examples/META-INF/">
        AllowOverride None
        deny from all
    </Directory>

    JkMount /jsp-examples/security/protected/j_security_check  ajp13
    JkMount /jsp-examples/forward/one.jsp  ajp13
    JkMount /jsp-examples/tagplugin/foreach.jsp  ajp13
    JkMount /jsp-examples/dates/date.jsp  ajp13
    JkMount /jsp-examples/jsp2/tagfiles/panel.jsp  ajp13
    JkMount /jsp-examples/xml/xml.jsp  ajp13
    JkMount /jsp-examples/jsp2/simpletag/repeat.jsp  ajp13
    JkMount /jsp-examples/CompressionTest  ajp13
    JkMount /jsp-examples/cal/cal2.jsp  ajp13
    JkMount /jsp-examples/sessions/carts.jsp  ajp13
    JkMount /jsp-examples/tagplugin/choose.jsp  ajp13
    JkMount /jsp-examples/jsptoserv/jsptoservlet.jsp  ajp13
    JkMount /jsp-examples/jsp2/misc/config.jsp  ajp13
    JkMount /jsp-examples/checkbox/checkresult.jsp  ajp13
    JkMount /jsp-examples/security/protected/login.jsp  ajp13
    JkMount /jsp-examples/jsp2/simpletag/book.jsp  ajp13
    JkMount /jsp-examples/forward/forward.jsp  ajp13
    JkMount /jsp-examples/jsp2/jspx/textRotate.jspx  ajp13
    JkMount /jsp-examples/simpletag/foo.jsp  ajp13
    JkMount /jsp-examples/security/protected/index.jsp  ajp13
    JkMount /jsp-examples/include/include.jsp  ajp13
    JkMount /jsp-examples/error/err.jsp  ajp13
    JkMount /jsp-examples/jsp2/el/basic-arithmetic.jsp  ajp13
    JkMount /jsp-examples/*.jspx  ajp13
    JkMount /jsp-examples/jsp2/jspx/basic.jspx  ajp13
    JkMount /jsp-examples/snp/snoop.jsp  ajp13
    JkMount /jsp-examples/error/errorpge.jsp  ajp13
    JkMount /jsp-examples/jsp2/jspattribute/jspattribute.jsp  ajp13
    JkMount /jsp-examples/include/foo.jsp  ajp13
    JkMount /jsp-examples/jsp2/el/functions.jsp  ajp13
    JkMount /jsp-examples/jsp2/tagfiles/products.jsp  ajp13
    JkMount /jsp-examples/jsp2/simpletag/hello.jsp  ajp13
    JkMount /jsp-examples/jsp2/el/basic-comparisons.jsp  ajp13
    JkMount /jsp-examples/colors/colrs.jsp  ajp13
    JkMount /jsp-examples/jsp2/jspattribute/shuffle.jsp  ajp13
    JkMount /jsp-examples/num/numguess.jsp  ajp13
    JkMount /jsp-examples/*.jsp  ajp13
    JkMount /jsp-examples/plugin/plugin.jsp  ajp13
    JkMount /jsp-examples/source.jsp  ajp13
    JkMount /jsp-examples/servletToJsp  ajp13
    JkMount /jsp-examples/tagplugin/if.jsp  ajp13
    JkMount /jsp-examples/cal/cal1.jsp  ajp13
    JkMount /jsp-examples/jsp2/tagfiles/hello.jsp  ajp13
    JkMount /jsp-examples/jsptoserv/hello.jsp  ajp13
    JkMount /jsp-examples/jsp2/misc/dynamicattrs.jsp  ajp13
    JkMount /jsp-examples/security/protected/error.jsp  ajp13
    JkMount /jsp-examples/jsp2/el/implicit-objects.jsp  ajp13


THEN in a apache add

# I added this for jk connector jk is auto gen by tomcat======
 Include "D:/DEV/Tomcat 5.5/conf/auto/mod_jk.conf"


Apache will use Tomcat and the servlet configuaration in Tomcat..... DONE!

Now even for load balancing I remove the Apache include but still leave the 
Autogeneration in tomcat because Tomcat generates the code and I can just 
copy and paste.

You'll find you can do anything.... and you should be able to because its a 
simple MVC model.

Now you going to tell me you have used Struts or Spring or something..... oh 
well, guess you'll have to ask the framework gods.... this is so easy I 
really cant understand why people use that stuff.

Hope this helps....

Good luck.



----- Original Message ----- 
From: "John Moore" <jb...@microps.com>
To: "Tomcat Users List" <us...@tomcat.apache.org>
Sent: Tuesday, March 13, 2007 3:28 AM
Subject: How does one configure Plain host domain url to run web app?


> (Tomcat 4.x)
>
> I have the following url that runs an application (pseudo url for 
> discussion only)
>
>
> http://www.mydomain.com/mysite/thecontext
>
> works fine..
>
> I would like to configure it so that..
>
> http://www.mydomain.com
>
> gets me to the same place..
>
> I can place a "redirect" html page at
>
> http://www.mydomain.com/mysite/index.html
>
> which redirects to
>
> http://www.mydomain.com/mysite/thecontext
>
> but have yet to get a plain
>
> http://www.mydomain.com
>
> to work.. I keep getting either the "No Context configured....." error or 
> the dreaded index of the directory..
>
> I've tried Aliaes, Document root, Directory, and various JkMount settings 
> in the Virtual host conf file that seemed like it might work, but so far, 
> no joy..  (Tried Googling it, but have not come up with the right key 
> words..)
>
> Some of the things I have tried  in the conf file..
>
> ==========================
> Alias /mysite "usr/tomcat/webapps/mysite"
> Alias / "usr/tomcat/webapps/mysite"
>
> DocumentRoot "/usr/local/tomcat/webapps/mysite/"
>
> <Directory "/usr/local/tomcat/webapps/mysite">
>        Options Indexes FollowSymLinks
>        DirectoryIndex index.html index.htm index.jsp
>  </Directory>
>
>    JkMount /mysite/thecontext  ajp13
>    JkMount /mysite/*.jsp  ajp13
>
> ..variations of..
>    JkMount /*.jsp  ajp13  -- gives me a dreaded index of the correct 
> directory
>   JkMount /*.html  ajp13  -- same as above
>   JkMount /*.  ajp13  -- blank document (strange)
>   JkMount /*  ajp13  -- context error


---------------------------------------------------------------------
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