You got a better solution my friend lol :)

-----Original Message-----
From: Mansour Al Akeel [mailto:[email protected]] 
Sent: Wednesday, August 03, 2011 5:06 PM
To: Raj Saini
Cc: [email protected]
Subject: Re: Accessing images from external application

Great work, Raj !
One last question, what would this do with requests to other ofbiz
components? For example http://www.yourdomain.com/myportal or
http://www.yourdomain.com/projectmgr ? 

What about other images under other components ?

I will try your suggestion soon.



On Wed Aug 03,2011 04:52 pm, Raj Saini wrote:
> What you can do is:
> 
> 1. Mount your application in OFbiz as "YourApp" and not root.
> 2. Create a virtual host in the Apache Web server or use the default one 
> if you have just one.
> 3. You can copy the static contents to the document root of the virtual 
> host.
> 4. Use AJP proxy to map your root request to "YourApp". For example, 
> Apache will forward all requests coming at
> http://www.yourdomain.com/ to ajp://localhost:8080/yourapp/ and you can 
> copy your images to the document root of the your virtual host. In your 
> virtual host proxy mapping you can exclude the static contents such as 
> your images. I generally use mod_rewirte and below is a simple example:
> 
> RewriteCond /srv/www/yourdomain/%{REQUEST_FILENAME} !-f
> RewriteCond /srv/www/yourdomain//%{REQUEST_FILENAME} !-d
> RewriteRule ^/(.*)$ ajp://localhost:8009/yourapp/control/$1
> 
> This directive says, if the last part of URL  is not a physical file or 
> directory on filesystem, forward it to OFBiz, else serve it from file 
> system. If you copy your images to the document root and above 
> conditions hold false, they will be served by Apache Web sever.
> 
> You can still access other OFbiz application using 9443 port, or create 
> their own virtual hosts or use a single virtual host to serve them.
> 
> Thanks,
> 
> Raj
> 
> 
> 
> 
> 
> 
> On Wednesday 03 August 2011 04:36 PM, Mansour Al Akeel wrote:
> > Hello Raj,
> >
> > And thank you for the explaination. I totally understand this from
> > Bilgin reply. I didn't think of it, until he reminded me there's an
> > "image" component. But I am interested to see other solutions.
> > With regard to you suggestion, I have the web application already
> > deployed and it works with or without ofbiz. But how would configuring
> > apache server help in solving the issue of accessing static contents
> > under myApplication. Assuming the I will foward all the requests on port
> > 80 to port 8080, and 443 to 8443, how would this solve the issue ?
> >
> >
> >
> > On Wed Aug 03,2011 04:12 pm, Raj Saini wrote:
> >> Your problem is OFBiz image application is conflicting with the image
> >> folder of your root application. One way to solve this is to use Apache
> >> Web server to front your OFbiz instance. This way, you can serve the
> >> images statically and few people claim it is faster to serve static
> >> contents using Apache Web server than servlet engines like Tomcat. This
> >> way, you can also easily have multiple domain serving applications from
> >> single instance of OFbiz.
> >>
> >> If you want to go this way, you will need mod_proxy and mod_proxy_ajp
> >> and configure your Apache web server. There are instructions on wiki
> >> that you can search.
> >>
> >> Thanks,
> >>
> >> Raj
> >>
> >> On Wednesday 03 August 2011 03:22 PM, Mansour Al Akeel wrote:
> >>> Hardik,
> >>> can you please kindly elaborate ?
> >>> What are the parameters that I can pass through ofbiz startup scripts to
> >>> fix this issue?
> >>> I have the application in hot-deploy already.
> >>>
> >>>
> >>>
> >>> On Wed Aug 03,2011 02:27 pm, Hardik Handa wrote:
> >>>> What I would prefer is to keep the application in hot deploy folder and 
> >>>> pass the parameter to the startup file  for the external application 
> >>>> into the startupofbiz.bat , this would lead to the external application 
> >>>> to start whenever you start Ofbiz.
> >>>>
> >>>> Cheers,
> >>>> Hardik Handa
> >>>> [email protected]
> >>>>
> >>>> -----Original Message-----
> >>>> From: Bilgin Ibryam [mailto:[email protected]]
> >>>> Sent: Wednesday, August 03, 2011 2:20 PM
> >>>> To: [email protected]
> >>>> Subject: Re: Accessing images from external application
> >>>>
> >>>> I had a similar problem and if I remember right, the problem was that
> >>>> images folder inside my custom app was confused with images
> >>>> application existing in framework. The solution I found was to rename
> >>>> images folder inside my custom app.
> >>>>
> >>>> HTH
> >>>> Bilgin Ibryam
> >>>>
> >>>> On Wed, Aug 3, 2011 at 8:11 AM, Mansour Al Akeel
> >>>> <[email protected]>   wrote:
> >>>>> I have a web application that I need to run on the same server as ofbiz.
> >>>>> The choices I have are either to deploy ofbiz to an external server
> >>>>> (tomcat or geronimo) and deploy my other webapp to the same server,
> >>>>> or deploy the application under ofbiz and get the built-in servlet
> >>>>> container to serve the requests.
> >>>>>
> >>>>> I found what I am trying to do is described in this document
> >>>>>
> >>>>> https://cwiki.apache.org/confluence/display/OFBIZ/Load+OpenI+%28Mondrian+Implementation%29+under+OFBiz
> >>>>>
> >>>>> I deployed my web application following this document. However, when I
> >>>>> mount the application on something like (mount-point="/myApplicaiton")
> >>>>> everything works fine. But when I make it the default application and
> >>>>> mount it on ( mount-point="/"), I don't see the images on the pages.
> >>>>> css files are served properly, but not images !
> >>>>>
> >>>>> The error I get when I try to browse to the image URL
> >>>>> is error 404. For example, http://localhost:8080/images/lines.png will
> >>>>> result in error 404 only when the application is mounted on "/".
> >>>>> If I mount the same application on "/myApplication" and access it with
> >>>>> http://localhost:8080/myApplication/images/lines.png it will work fine !
> >>>>>
> >>>>> Is there any additional configuration I need to do to get the images to
> >>>>> display properly ?
> >>>>>
> >>>>> Thank you in advance.
> >>>>>
> >>>>>
> >>>>>
> >>>> ::DISCLAIMER::
> >>>> -----------------------------------------------------------------------------------------------------------------------
> >>>>
> >>>> The contents of this e-mail and any attachment(s) are confidential and 
> >>>> intended for the named recipient(s) only.
> >>>> It shall not attach any liability on the originator or HCL or its 
> >>>> affiliates. Any views or opinions presented in
> >>>> this email are solely those of the author and may not necessarily 
> >>>> reflect the opinions of HCL or its affiliates.
> >>>> Any form of reproduction, dissemination, copying, disclosure, 
> >>>> modification, distribution and / or publication of
> >>>> this message without the prior written consent of the author of this 
> >>>> e-mail is strictly prohibited. If you have
> >>>> received this email in error please delete it and notify the sender 
> >>>> immediately. Before opening any mail and
> >>>> attachments please check them for viruses and defect.
> >>>>
> >>>> -----------------------------------------------------------------------------------------------------------------------
> 

Reply via email to