Hi Tony and Jurgen,
Thanks so much for your replies. We're running Tomcat
5.5/Turbine/Torque/Velocity here, and I was able to have tomcat configured to
use port 80 instead of 8080. I have tried to edit the web.xml to make my
application URL as:
http://localhost/mywebapp, when setting:
<servlet-mapping>
<servlet-name>MYWEBAPP</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
However, this will mess up Velocity's template link object, which couldn't find
servle path (I think it still be looking under /SERVLET/WEBAPPS kind of path
format, where in this case, servlet path is not there anymore).
If I configure web.xml as the following:
<servlet-mapping>
<servlet-name>MYWEBAPP</servlet-name>
<url-pattern>/S/*</url-pattern>
</servlet-mapping>
I'm able to access my application thru:
http://localhost/S/mywebapp, which is not 100% satisfactory to me.
BTW, how can I configure either Tomcat or Turbine to redirect the request to
mywebapp.com to localhost/S/mywebapp?
Thanks,
David
-----Original Message-----
From: Jürgen Hoffmann [mailto:[EMAIL PROTECTED]
Sent: Sat 6/24/2006 1:08 PM
To: Turbine Users List
Subject: Re: URL rewriting
Hi,
Tony is right, albeit he only addresses the connector and rewrite issue. I
agree that it is better to run the servlet container in conjunction with
apache webserver to serve static content.
The problem I was addressing was that David seemed to be still using the
Invoker Servlet (mywebapp/servlet/mywebapp) which adds just another layer to
your Servlet, and is considered inseucure which is why it is commented out in
newer tomcat releases. With my solution (copied from m.e.t.a.'s web.xml)
there is no further need for the invoker servlet.
Kind regards
Juergen Hoffmann
Am Samstag, 24. Juni 2006 15:47 schrieb Tony Oslund:
> This is a bit of a cross post so you have my appologies...
>
> I am not sure if Jurgen's solution will work for the port number or not, as
> I have not tried it for that. I do know that the following will take care
> of the 8080 portion of the problem however, as well as URL re-writing.
>
> I will make the assumption that you are using Tomcat, JBoss, etc. Are you
> using them as stand alone servers, or are you using them in conjuction with
> other servers, such as Apache, IIS, etc? Apache and IIS are much more
> efficient at serving up static content, and it takes the burden for this
> off of your app server. (For development, you can run all of this on one
> box if you wish).
>
> Anyways you can use a "connector" (see the jakarta site), and relay any
> requests coming into your Apache/IIS web server on port 80 to your (Tomcat,
> JBoss) app server on 8080. The other nice thing about doing this is you
> can use Apache or IIS to setup name based, or IP based virtual domains.
> This way you could refer to your app not only through http://localhost....
> but also through http://domain2...... or http://domain3, etc.
>
> You can also setup matching url patterns with the connector as to what
> requests are mapped to what app servers, etc.
>
> If you are running your app server in conjuction with Apache, there is also
> mod_rewrite. It is a plug in module for apache and allows URL re-writing,
> before the request ever gets relayed to your app server
>
> If you are only running an app server (for your local development) you
> could also make it easy on yourself and simply configure it to accept
> requests on port 80. You have to make sure that you do not have another
> app or web server running that is already bound to that port on your local
> box, but it does work. However, this would present a bit of a problem if
> you needed to run multiple app servers, etc.
>
> Tony
>
> ----- Original Message -----
> From: "David Zhao" <[EMAIL PROTECTED]>
> To: <[email protected]>
> Sent: Friday, June 23, 2006 5:32 PM
> Subject: URL rewriting
>
> > Hi there,
> >
> > How can I simplify my turbine application URL from:
> >
> > http://localhost:8080/mywebapp/servlet/mywebapp to:
> >
> > http://localhost/mywebapp?
> >
> > I've read URL rewriting HowTo on the turbine page, but need to further
> > simply the URL structure.
> > Thanks in advance!
> >
> > David
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
> !EXCUBATOR:1,449d429977961333248546!