Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Re: Configure Apache HTTPD not to see the webapp name in the URL

Reply
Thread Tools

Re: Configure Apache HTTPD not to see the webapp name in the URL

 
 
Ben Jessel
Guest
Posts: n/a
 
      06-28-2004
Thanks for everyone's input.

However, I'm a little concerned that there's not a quick and easy
apache way of doing this; what do commercial users do? I'm sure that
there must be an apache way of doing this! Could it be done with
virtual hosting or aliasing?

Its a pity that you can't just define a virtual directory to
c:/tomcat4.1/webapps/mysite, as then this circumvents JK2 and doesn't
use apache.

So is this a limitation of JK2 that you can't ever intercept something
at the root path of your webserver and then forward it to a different
context?

I tried:

[urn:/]
context=/mysite/

But unfortunately it never got picked up.



Btw as anyone successfully managed to get JNI channels working with
apache/tomcat? THe closest I got was an error message saying that it
needed some jni libraries in the java-library-path. I added a dll, but
still no joy......


Original Mesage:



I've successfully set up JK2, Apache HTTPD and Tomcat.
My webapp it called mysite - I've set my workers.properties as
[uri:/mysite/*].
My site is called, say http://welcometomysite.com.

In order to actually make mysite/index.jsp to appear when you go to
http://welcometomysite.com, I used mod_rewrite and added a directive:

<Directory />
Options FollowSymLinks
AllowOverride AuthConfig
RewriteEngine on
RewriteRule / /mysite/ [L]
</Directory>

However, when I go to http://welcometomysite.com, the url is
http://welcometomysite.com/mysite.

Is there any way that I can disguise the URL so it never shows the
web-app name?
One considerations is that all my entries in my struts.config and jsp
pages currently say /mysite/dosomething.do.

Essentially, I'm looking for a solution where I never see my web-app
name in my URL. Can anyone advise? I am an HTTPD newbie.

Thanks

Ben
 
Reply With Quote
 
 
 
 
Davide Bianchi
Guest
Posts: n/a
 
      06-28-2004
In alt.apache.configuration Ben Jessel <(E-Mail Removed)> wrote:
> So is this a limitation of JK2 that you can't ever intercept something
> at the root path of your webserver and then forward it to a different
> context?


Sure you can. Just put your webapp in the ROOT context of the
application server. But then you can have ONE context only. While most
of the time what you want is to have MANY context.

Davide

--
| Academic politics is the most vicious and bitter form of politics,
| because the stakes are so low. -- Wallace Sayre
|
|
 
Reply With Quote
 
 
 
 
Chris Smith
Guest
Posts: n/a
 
      06-28-2004
Davide Bianchi wrote:
> Sure you can. Just put your webapp in the ROOT context of the
> application server. But then you can have ONE context only. While most
> of the time what you want is to have MANY context.


I don't see this at all. I see that the servlet specification is
written from the perspective of having multiple contexts, but this is
mostly an annoyance that can be worked around.

(And, of course, it's quite possible to have a root context plus several
contexts mapped to subpaths, so long as the root context doesn't use
URLs that begin with the path of the subcontext.)

--
www.designacourse.com
The Easiest Way to Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 
Reply With Quote
 
Davide Bianchi
Guest
Posts: n/a
 
      06-28-2004
In alt.apache.configuration Chris Smith <(E-Mail Removed)> wrote:
> (And, of course, it's quite possible to have a root context plus several
> contexts mapped to subpaths, so long as the root context doesn't use
> URLs that begin with the path of the subcontext.)


Hummm... wouldn't that be a mess with which-context-load-first his own
libraries? If you have specific libraries for specific context of course.

Davide


--
| The Third Law of Photography: If you did manage to get any good shots,
| they will be ruined when someone inadvertently opens the darkroom door
| and all of the dark leaks out.
|
 
Reply With Quote
 
Chris Smith
Guest
Posts: n/a
 
      06-28-2004
Davide Bianchi wrote:
> In alt.apache.configuration Chris Smith <(E-Mail Removed)> wrote:
> > (And, of course, it's quite possible to have a root context plus several
> > contexts mapped to subpaths, so long as the root context doesn't use
> > URLs that begin with the path of the subcontext.)

>
> Hummm... wouldn't that be a mess with which-context-load-first his own
> libraries? If you have specific libraries for specific context of course.


Not sure what you mean. Each context will operate within its own
classloader, per the spec. There will be no relationship between the
classes available in the root context and any other context.

--
www.designacourse.com
The Easiest Way to Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 
Reply With Quote
 
marcus
Guest
Posts: n/a
 
      06-29-2004
I believe the difference is setting up your rewrite engine to proxy
through instead of URL rewrite. (I believe) As a proxy the client is
not made aware of the change, which is typical of load balancing servers
and stuff, but rewriting sends a "moved" header or something. I don't
remember why I went the rewrite route, but I think the proxy set-up is a
little more involved.



There used to be some fabulous articles on the apache.org site.

Ben Jessel wrote:
> Thanks for everyone's input.
>
> However, I'm a little concerned that there's not a quick and easy
> apache way of doing this; what do commercial users do? I'm sure that
> there must be an apache way of doing this! Could it be done with
> virtual hosting or aliasing?
>
> Its a pity that you can't just define a virtual directory to
> c:/tomcat4.1/webapps/mysite, as then this circumvents JK2 and doesn't
> use apache.
>
> So is this a limitation of JK2 that you can't ever intercept something
> at the root path of your webserver and then forward it to a different
> context?
>
> I tried:
>
> [urn:/]
> context=/mysite/
>
> But unfortunately it never got picked up.
>
>
>
> Btw as anyone successfully managed to get JNI channels working with
> apache/tomcat? THe closest I got was an error message saying that it
> needed some jni libraries in the java-library-path. I added a dll, but
> still no joy......
>
>
> Original Mesage:
>
>
>
> I've successfully set up JK2, Apache HTTPD and Tomcat.
> My webapp it called mysite - I've set my workers.properties as
> [uri:/mysite/*].
> My site is called, say http://welcometomysite.com.
>
> In order to actually make mysite/index.jsp to appear when you go to
> http://welcometomysite.com, I used mod_rewrite and added a directive:
>
> <Directory />
> Options FollowSymLinks
> AllowOverride AuthConfig
> RewriteEngine on
> RewriteRule / /mysite/ [L]
> </Directory>
>
> However, when I go to http://welcometomysite.com, the url is
> http://welcometomysite.com/mysite.
>
> Is there any way that I can disguise the URL so it never shows the
> web-app name?
> One considerations is that all my entries in my struts.config and jsp
> pages currently say /mysite/dosomething.do.
>
> Essentially, I'm looking for a solution where I never see my web-app
> name in my URL. Can anyone advise? I am an HTTPD newbie.
>
> Thanks
>
> Ben


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
httpd.conf configuration for mod_wsgi.so on wamp (apache)? wojciech777 Python 0 11-05-2011 07:30 PM
Where to start with a webapp that is not really a webapp Andrew Java 7 06-28-2009 08:42 PM
http://httpd.apache.org/docs/2.2/mod/mod_dbd.html gert Python 0 03-06-2008 12:47 AM
What should I do webapp or webservice + webapp? jhooper71@yahoo.com ASP .Net 6 02-10-2006 02:07 PM
Apache HTTPD + Tomcat and random missing images Anders Skar Java 3 02-26-2004 04:25 PM



Advertisments