I need apache to serve images from localhost instead of appserver | Unix Linux Forums | Web Programming

  Go Back    


Web Programming Discuss Web Programming and Web Server Administration, including LAMP, Apache, MySQL, HTML, SEO, and other Web APIs and topics.

I need apache to serve images from localhost instead of appserver

Web Programming


Tags
apache, httpd.conf, serving images

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 03-09-2013
kmaq7621 kmaq7621 is offline
Registered User
 
Join Date: Sep 2008
Last Activity: 26 March 2014, 12:30 PM EDT
Location: NYC
Posts: 14
Thanks: 4
Thanked 0 Times in 0 Posts
I need apache to serve images from localhost instead of appserver

I have an apache/2.2.15 server centos 6.3
The apache server will be serving jboss app via mod_proxy (got that working)
But... I need to serve the images from a local directory on the apache server. Here is my configuration. When I got to the site, I get 404s for all the images.

What am I doing wrong?


Code:
<VirtualHost *:80>


ServerAdmin admim@admin.com
ServerName atg10deva.somedomain.com/
ServerAlias atg10deva
DocumentRoot    /home/atg/www/

ProxyPass / http://atg10deva-app02:8280/
ProxyPassReverse / http://atg10deva-app02:8280/
ProxyPreserveHost On
ProxyPassReverseCookiePath / /

Alias /images/ /home/atg/www/svn/images/catalog
<Directory /home/atg/www/svn/images/>
          Options Indexes FollowSymLinks
        AllowOverride none
        Order allow,deny
        Allow from all
</Directory>



ErrorLog logs/atg10deva-app02-error_log
CustomLog logs/atg10deva-app02-access_log combined
</VirtualHost>


Last edited by kmaq7621; 03-09-2013 at 12:14 AM.. Reason: wrong title, not specific
Sponsored Links
    #2  
Old 03-11-2013
DGPickett DGPickett is offline Forum Advisor  
Registered User
 
Join Date: Oct 2010
Last Activity: 28 August 2014, 4:12 PM EDT
Location: Southern NJ, USA (Nord)
Posts: 4,409
Thanks: 8
Thanked 537 Times in 516 Posts
Not an apache guru, but it looks like / is proxied through, which hides /images/ Others have tried and nobody offered a solution: virtualhost - How to set up a proxy location for all paths except some with apache2? - Stack Overflow

I think conceptualy, using apache as a proxy is very divorced from using apache as a server. It usually does mostly one or the other on any port.
The Following User Says Thank You to DGPickett For This Useful Post:
kmaq7621 (03-18-2013)
Sponsored Links
    #3  
Old 03-14-2013
glev2005 glev2005 is offline
Registered User
 
Join Date: Oct 2008
Last Activity: 19 July 2014, 10:56 PM EDT
Posts: 276
Thanks: 20
Thanked 6 Times in 6 Posts
This is a guess but try putting your alias and images directory directive before your proxypass stuff.
The Following User Says Thank You to glev2005 For This Useful Post:
kmaq7621 (03-18-2013)
    #4  
Old 03-14-2013
DGPickett DGPickett is offline Forum Advisor  
Registered User
 
Join Date: Oct 2010
Last Activity: 28 August 2014, 4:12 PM EDT
Location: Southern NJ, USA (Nord)
Posts: 4,409
Thanks: 8
Thanked 537 Times in 516 Posts
Either that or put you local files on an odd second port server, so there is no confusion. Someone has to make URLs to hook them to the web, so they can put port numbers in the URL. Every system comes with 65536 TCP ports.
The Following User Says Thank You to DGPickett For This Useful Post:
kmaq7621 (03-18-2013)
Sponsored Links
    #5  
Old 03-18-2013
kmaq7621 kmaq7621 is offline
Registered User
 
Join Date: Sep 2008
Last Activity: 26 March 2014, 12:30 PM EDT
Location: NYC
Posts: 14
Thanks: 4
Thanked 0 Times in 0 Posts
as suggested by glev2005, I did a combination of your suggestions. here is what worked for me.

above all the entries, the first one should have been..

Code:
ProxyPass /images/ !



Code:
ServerAdmin admim@admin.com
ServerName atg10deva.somedomain.com/
ServerAlias atg10deva
DocumentRoot    /home/atg/www/

ProxyPass /images/ !
ProxyPass / http://atg10deva-app02:8280/
ProxyPassReverse / http://atg10deva-app02:8280/
ProxyPreserveHost On
ProxyPassReverseCookiePath / /

Alias /images/ /home/atg/www/svn/images/catalog
<Directory /home/atg/www/svn/images/>
          Options Indexes FollowSymLinks
        AllowOverride none
        Order allow,deny
        Allow from all
</Directory>



ErrorLog logs/atg10deva-app02-error_log
CustomLog logs/atg10deva-app02-access_log combined
</VirtualHost>

Sponsored Links
    #6  
Old 03-20-2013
DGPickett DGPickett is offline Forum Advisor  
Registered User
 
Join Date: Oct 2010
Last Activity: 28 August 2014, 4:12 PM EDT
Location: Southern NJ, USA (Nord)
Posts: 4,409
Thanks: 8
Thanked 537 Times in 516 Posts
I suppose if you have a 100% read only and final file set, you could write or find a specialized web server that accepted only dumb GET and pulls the files from preestablished mmap64() areas looked up in a hash map. The overhead would be very low. It could be a thread per socket app, writing with blocking I/O, with the write socket buffers all set to 1-2 pages to keep wired RAM use down.

I suppose that when a file needs to be changed, and migh be a different size, you would need to do that that and not interrupt service. The old file could be deleted, the new file copied, a new mmap made, the new location and size updated into the hash map and when all old transmissions of that file end, the old space unmapped. When you optimize for static, change is a pain!
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Checking for Apache and serving a page kullu Shell Programming and Scripting 1 07-22-2011 04:28 AM
Apache's strange loading of .gif and .jpg images v1xon UNIX for Dummies Questions & Answers 2 02-11-2009 12:06 PM
Apache localhost-access.log sotich82 Solaris 3 12-19-2008 05:20 PM
apache@localhost.localdomain qfwfq Linux 2 03-09-2005 06:47 AM
Application Serving tombobs UNIX for Dummies Questions & Answers 1 06-18-2002 01:15 PM



All times are GMT -4. The time now is 02:05 PM.