WebSphere HTTP Server - HTTP Request redirect problem

This is Interesting: Free IT Magazines  
Home > Archive > WebSphere HTTP Server > April 2004 > HTTP Request redirect problem





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author HTTP Request redirect problem
druide24

2004-04-28, 12:33 pm

Hi,

I have installed WAS 5.1 + IBMHttpServer 1.3.26 on the same machine ( Linux Red Hat 8.0 ). Then i have developped a J2EE Application with an EJB module and a WEB module, with "/" as the root context.

Everything is working fine except except this :

I have a file system directory with PDF files ( let's say /home/j2eeProject/pdf ), and i want to access to any of these files with http://myServer/pdf/myPdfFile.pdf ( it seems quite simple but ... )

My PDF files are likely to be updated regularly using FTP, and I don't want to redeploy my Web component each time i make a change. That's why i didn't put that directory in my WEB module. Besides, I would like my Web server to serve directly my PDF files
without passing by the application server !

So, i created a "/pdf" Alias on the Web server that points to my directory.

Unfortunately, and because my web module context root is "/", every URL passed to the web server and beginning with "http://myServer/" is redirected to the Application server, and my "/pdf/" Alias has no effect at all ! ( error 404 )

Does anyone have an idea how to config my Web Server / Application Server or plugin-cfg.xml file in order to redirect all HTTP requests beginning with "http://myServer/" to the application server except the ones beginning with "http://myServer/pdf" ?

Thanks.
Sunit Patke

2004-04-28, 1:33 pm

Create a symbolic link between /home/j2eeProject/pdf and <web application
root>/pdf
This will get you going i.e. pdf files will start being served but it will
be the appserver that will serve the pdf files and not the HTTP server.

Sunit

"druide24" <druide@akiway.com> wrote in message
news:1073773145.1083169428869.JavaMail.wasadmin@swg3ws006...
> Hi,
>
> I have installed WAS 5.1 + IBMHttpServer 1.3.26 on the same machine (

Linux Red Hat 8.0 ). Then i have developped a J2EE Application with an EJB
module and a WEB module, with "/" as the root context.
>
> Everything is working fine except except this :
>
> I have a file system directory with PDF files ( let's say

/home/j2eeProject/pdf ), and i want to access to any of these files with
http://myServer/pdf/myPdfFile.pdf ( it seems quite simple but ... )
>
> My PDF files are likely to be updated regularly using FTP, and I don't

want to redeploy my Web component each time i make a change. That's why i
didn't put that directory in my WEB module. Besides, I would like my Web
server to serve directly my PDF files without passing by the application
server !
>
> So, i created a "/pdf" Alias on the Web server that points to my

directory.
>
> Unfortunately, and because my web module context root is "/", every URL

passed to the web server and beginning with "http://myServer/" is redirected
to the Application server, and my "/pdf/" Alias has no effect at all ! (
error 404 )
>
> Does anyone have an idea how to config my Web Server / Application Server

or plugin-cfg.xml file in order to redirect all HTTP requests beginning with
"http://myServer/" to the application server except the ones beginning with
"http://myServer/pdf" ?
>
> Thanks.



Aaron W Morris

2004-04-30, 3:33 pm



druide24 wrote:

> Hi,
>
> I have installed WAS 5.1 + IBMHttpServer 1.3.26 on the same machine ( Linux Red Hat 8.0 ). Then i have developped a J2EE Application with an EJB module and a WEB module, with "/" as the root context.
>
> Everything is working fine except except this :
>
> I have a file system directory with PDF files ( let's say /home/j2eeProject/pdf ), and i want to access to any of these files with http://myServer/pdf/myPdfFile.pdf ( it seems quite simple but ... )
>
> My PDF files are likely to be updated regularly using FTP, and I don't want to redeploy my Web component each time i make a change. That's why i didn't put that directory in my WEB module. Besides, I would like my Web server to serve directly my PDF fil

es without passing by the application server !
>
> So, i created a "/pdf" Alias on the Web server that points to my directory.
>
> Unfortunately, and because my web module context root is "/", every URL passed to the web server and beginning with "http://myServer/" is redirected to the Application server, and my "/pdf/" Alias has no effect at all ! ( error 404 )
>
> Does anyone have an idea how to config my Web Server / Application Server or plugin-cfg.xml file in order to redirect all HTTP requests beginning with "http://myServer/" to the application server except the ones beginning with "http://myServer/pdf" ?
>
> Thanks.


You can turn off file serving on the application server. That will
force the web server to serve static content and only JSPs and servlets
will be passed to the application server.

--
Aaron W Morris <aaronmorris@mindspring.com> (decep)

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com