LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   unable to open png file on web page (https://www.linuxquestions.org/questions/linux-newbie-8/unable-to-open-png-file-on-web-page-938002/)

nagabhushan 04-04-2012 12:18 AM

unable to open png file on web page
 
Hi folks,

i was trying to display png image on browser from a linux server. My httpd configuration seems fine.i have same image on /var/www/html and /var/www/cgi-bin paths.
when i try to open this image from browser by using http://serverIp/filename.png its opening, but when i try http://serverIp/cgi-bin/filename.png its not opening.

Please explain.........

j-ray 04-04-2012 01:58 AM

Do you get a 404 error? a permission denied error? Or simply not showing without error?

nagabhushan 04-04-2012 03:08 AM

i used to get the following error -

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, root@192.168.101.19 and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Apache/2.2.3 (Red Hat) Server at 192.168.101.19 Port 80

j-ray 04-04-2012 03:15 AM

Quote:

More information about this error may be available in the server error log.
Did you take a look at that?

nagabhushan 04-04-2012 03:18 AM

where i have to check ?? in /var/log/messages i m not able to find anything related to this....

linuxlover.chaitanya 04-04-2012 03:21 AM

Your apache logs location depend on the distribution you use but assuming that you are using some RH based, it should be under /var/log/httpd/

nagabhushan 04-04-2012 03:25 AM

i checked there... i m getting
[Wed Apr 04 13:45:10 2012] [error] [client 132.1.16.1] (8)Exec format error: exec of '/var/www/cgi-bin/shared-demo1.png' failed
[Wed Apr 04 13:45:10 2012] [error] [client 132.1.16.1] Premature end of script headers: shared-demo1.png
[Wed Apr 04 13:45:11 2012] [error] [client 132.1.16.1] File does not exist: /var/www/html/favicon.ico
[Wed Apr 04 13:45:12 2012] [error] [client 132.1.16.1] File does not exist: /var/www/html/favicon.ico
[Wed Apr 04 13:45:12 2012] [error] [client 132.1.16.1] File does not exist: /var/www/html/favicon.ico
[Wed Apr 04 13:45:13 2012] [error] [client 132.1.16.1] File does not exist: /var/www/html/favicon.ico
[Wed Apr 04 13:45:23 2012] [error] [client 132.1.16.1] File does not exist: /var/www/html/favicon.ico

j-ray 04-04-2012 03:26 AM

...on debian based distros it should be /var/log/apache2/error_log or similar

nagabhushan 04-04-2012 03:27 AM

i got that... i already pasted that above... please check

j-ray 04-04-2012 03:29 AM

Seems you have to embed your image in a cgi script to let it show from there. CGI stands for Common Gateway Interface. The cgi-bin is rather a location for scripts...
Maybe you can configure the directory to serve images as well but I don't know.

But you can easily write a perl or python script that embeds the image in html


All times are GMT -5. The time now is 06:27 PM.