LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-02-2013, 01:06 AM   #1
mlnm
Member
 
Registered: Jun 2011
Posts: 96

Rep: Reputation: Disabled
Image links showing 404 error on Apache


Hi, i have redirected Apache to tomcat webapp using mod_proxy.The redirection was successful but when i open my my website and click on some images ,they show me 404 error saying "requested source is unavailable".On Apache website everything other links works fine but only images dont work.But when i open through tomcat, the images also work fine.
Cant find anything in logs regarding this.

Details:
Server : RHEL 5
Apache 2.2
Tomcat 7.0.37
Mysql 5.5
jdk ver : 7
Selinux : disabled

Any help would be greatly appreciated.
Thank you..
 
Old 04-02-2013, 01:47 AM   #2
eklavya
Member
 
Registered: Mar 2013
Posts: 619

Rep: Reputation: 136Reputation: 136
Are you facing this problem for particular extention image like jpeg, gif, png or all types of image files.

When you type path of the image, does it open?
Code:
http://localhost/myproject/myimage.png
Are these lines are uncommented in your httpd.conf file
Code:
EnableMMAP off
EnableSendfile off
If not, made them uncommented and restart apache.
 
Old 04-02-2013, 03:06 AM   #3
mlnm
Member
 
Registered: Jun 2011
Posts: 96

Original Poster
Rep: Reputation: Disabled
1. These lines were commented in httpd.conf ,i uncommented them and restarted apache but doesn't work.
EnableMMAP off
EnableSendfile off

I have my website public you can check it : http://cypherlogics.com

Try clicking the images that rotate next to the main tabs.

Last edited by mlnm; 04-02-2013 at 03:08 AM.
 
Old 04-02-2013, 06:11 AM   #4
eklavya
Member
 
Registered: Mar 2013
Posts: 619

Rep: Reputation: 136Reputation: 136
When I click on the CD image it goes on 404
http://cypherlogics.com/CypherLogics...lid=CID2345690

but if I click on home link, it opens the page.

You haven't replied my other questions of previous post.
Are you facing this problem for particular extention image like jpeg, gif, png or all types of image files?
When you type path of the image, does it open?
Code:
http://localhost/myproject/myimage.png
Have you defined this attribute in httpd.conf
Code:
AddType image/png png
AddType image/jpg jpg
 
Old 04-02-2013, 06:27 AM   #5
mlnm
Member
 
Registered: Jun 2011
Posts: 96

Original Poster
Rep: Reputation: Disabled
1.Yes ,images work fine through localhost on Tomcat.This is happening since the redirection was done.

2.All formats of images are not working.

3.I tried the following attributes but still doesn't work.
AddType image/png png
AddType image/jpg jpg

Thanks for your reply..
 
Old 04-03-2013, 12:31 AM   #6
mlnm
Member
 
Registered: Jun 2011
Posts: 96

Original Poster
Rep: Reputation: Disabled
My problem has been solved ,i tried the 301 redirect instead of mod_proxy and now all images working fine and links are also working fine.

But i have a small problem,while redirecting ,the url shows the 8080 port publicly,i dont want to show that ,could you please tell me how can i mask that port?

I tried masking through mod_rewrite but didn't work out.

Thank you..
 
Old 04-03-2013, 12:49 AM   #7
eklavya
Member
 
Registered: Mar 2013
Posts: 619

Rep: Reputation: 136Reputation: 136
You means it shows port name with your domain name?
because if it shows with localhost like http://localhost:8080
That is how the browsers work. They assume port 80 for http unless you specify a different port. If you specify different port, then the port number must be specified in the url.

But if it shows with domain name then this is a problem, confirm first.
 
Old 04-03-2013, 03:22 AM   #8
mlnm
Member
 
Registered: Jun 2011
Posts: 96

Original Poster
Rep: Reputation: Disabled
I have used the following code in httpd.conf

<VirtualHost *:80>
ServerName cypherlogics.com
ServerAlias www.cypherlogics.com
Redirect 301 / http://cypherlogics.com:8080/CypherLogics/
</VirtualHost>

i tried Redirect 301 / http://cypherlogics.com/CypherLogics/ but it didn't work.

when i go to http://www.cypherlogics.com ,it shows url like this http://cypherlogics.com:8080/CypherL...hannelsServlet

Previously when i was doing redirection through proxy,this was not happening but as you know i had problem with images in that so i removed it and applied the code in the virtual host.
 
Old 04-03-2013, 07:41 AM   #9
eklavya
Member
 
Registered: Mar 2013
Posts: 619

Rep: Reputation: 136Reputation: 136
I think you need to set up *mod_proxy* with the following config:

ProxyPass / http://localhost:8080/AppName/
ProxyPassReverse / http://localhost:8080/AppName/

It can be done through reverse proxy, may be I am not showing you the exact way, google it, you will get solution for this.
 
Old 04-03-2013, 08:49 AM   #10
mlnm
Member
 
Registered: Jun 2011
Posts: 96

Original Poster
Rep: Reputation: Disabled
As i mentioned in my last post ,actually i was using
ProxyPass / http://localhost:8080/AppName/
ProxyPassReverse / http://localhost:8080/AppName/

but as you know the image links were not working while i was using above code.

I think i have to go back to mod_proxy and try find the solution to image link errors.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Apache: rewritten links return 404 error, AllowOverride makes things even worse craseal Linux - Server 2 08-28-2010 05:05 PM
Apache error: 404 Not Found, why? cucolin@ Ubuntu 3 08-14-2006 12:01 PM
Unwanted 404 error with apache Vossy Linux - Software 0 12-26-2005 09:31 PM
why is apache giving me a 404 error linuxmandrake Linux - Software 4 06-17-2005 10:16 AM
odd Apache 404 error Seventh Linux - Software 1 03-27-2005 04:43 AM


All times are GMT -5. The time now is 06:20 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration