LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Server corrupting images (https://www.linuxquestions.org/questions/linux-server-73/server-corrupting-images-4175435822/)

countrydj 11-05-2012 07:14 PM

Server corrupting images
 
Hi Guys...
I have a problem with displaying images.
My server is CentOS release 6.1 (Final)

If I a web page displays an image, it doesn't show.
If I click on 'show image' I get a message, something like 'image cannot be displayed because it contains errors'.

I have setup a page to demonstrate the problem:
http://art-burn.co.uk/index.htm
This has 2 pictures:
1. src from within the server.
2. src from an external server.

Using firefox, the 2 images are displayed, first as a small box (from local server), second normal (from external server)
Using IE, the 2 images are displayed, first as a corrupt picture (from local server), second normal (from external server)

I'm utterly confused with this, and cannot find any answers by Googling.

Can anybody suggest what may be wrong.

btw: the server did work fine originally, so it's something that I have done, but I don't know what.

Wim Sturkenboom 11-06-2012 03:05 AM

Running Firefox 16.0.2 on both Windows and Ubuntu 10.04 the first one (from your local server) does not show. Loading http://art-burn.co.uk/images/HonkyTonk-18nov12-sm.jpg directly gives the error message that the file is corrupted.

Inspecting the image properties (with FF) on the page you provided shows that the files have different sizes and your local one shows as 0x0 pixels.

Opening in IE shows a text page with garbage and checking properties in IE shows that it's not a jpg.

Sounds like you've managed to corrupt the image in some way.

r0b0 11-06-2012 03:56 AM

Yes, the server really seems to send gargabe as HTTP response for url http://art-burn.co.uk/images/HonkyTonk-18nov12-sm.jpg Can you inspect (and post) your apache configuration? Have you enabled some modules or changed something w.r.t. apache recently?

countrydj 11-06-2012 04:49 AM

Hi Guys...
Many thanks for your input.
However, I still believe that the problem is with the server.
Quote:

Can you inspect (and post) your apache configuration?
I'm not sure what you mean by this. Do you mean my httpd.conf file ?
If you do, it's very large - size 38431
If you want to see it, it's here:
http://art-burn.co.uk/httpd.conf


Quote:

Have you enabled some modules or changed something w.r.t. apache recently?
No. Recently, I have been trying to find a suitable webmail program
I've tried: Mailview, Webmail Lite, RoundCube and squirrekmail.
I removed ALL the webmail programs and started again with squirrelmail.
This is when I noticed the image problem.
I could load the Squirrelmail image from an external server, but not locally.
This is when I started testing.
Here is another test that I have done this morning:
http://hughes-family-bakers.co.uk/test.htm
This site is located on the 'good' server.

I also installed postfix admin.
This didn't appeal to me when I had it installed, so I removed it.

Hope this info helps.

Thank you...

Wim Sturkenboom 11-06-2012 05:24 AM

Your httpd.conf is also corrupted ;)

Code:

P—38¼®Å-
 E ~Oj@ @  XaÇ’)Vm" P²=CHy5j§ € m¶r  
%6\c€¶¿HTTP/1.1 200 OK
Date: Tue, 06 Nov 2012 11:14:08 GMT
Server: Apache/2.2.15 (CentOS)
Last-Modified: Mon, 05 Nov 2012 17:17:27 GMT
ETag: "8061d-961f-4cdc2a8dab73a"
Accept-Ranges: bytes
Content-Length: 38431
Connection: close
Content-Type: text/plain

#
# This is the main Apache server configuration file.  It contains the
# configuration directives that give the server its instructions.
# See <URL:http://httpd.apache.org/docs/2.2/> for detailed information.
# In particular, see
# <URL:http://httpd.apache.org/docs/2.2/mod/directives.html>
# for a discussion of each configuration directive.
#
...
...
# prefork MPM
# StartServers: number of server processes to start
# MinSpareServers: minimum number of server processes which are kept spare
# MaxSpareServers: maximum number of server processes which are kept spare
# ServerLimit: maximum value for MaxClients for the lifetime of the server
# MaxClients: maximum number of server processes allowed to start
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule prefork.c>
StartServers      8
MinSpa P—38¼®Å-
 E Om@ @  XaÇ’)Vm" P²=CH‰j§ € m¶r  
%70c€·”s      256
MaxRequestsPerChild  4000
</IfModule>

And there are more like that.

I'm not sure where I would start looking.

countrydj 11-06-2012 06:05 AM

Hi Wim Sturkenboom...
Thanks for your reply, and taking the trouble to help me.

The file is NOT corrupt.
I have now copied it to my 'good' server. You can view it here:
http://hughes-family-bakers.co.uk/httpd.conf

This is the same file, copied from
http://art-burn.co.uk/httpd.conf

It is obviously the 'faulty' server that is corrupting the files.

hth

Wim Sturkenboom 11-06-2012 06:55 AM

I understand it's only the copy. It was showing that it's more than just images that are affected.

If possible, I would run a memtest for a night to check memory and badblocks to check your HD; manufacturer's testutilities for your HD are also an option.

r0b0 11-06-2012 07:16 AM

Very weird indeed. I've worked with apache for 10+ years and I've never seen it corrupting files.
I would try a clean install of apache with clean config files and work my way to desired configuration.

countrydj 11-06-2012 06:37 PM

Hi Guys...
Many thanks for your input.
Quote:

If possible, I would run a memtest for a night to check memory and badblocks to check your HD
I've run a memory test with memscope, running for 4 hours - no errors.
My experience is that running memscope will show up any memory problems within the first couple of passes.
I used Hirens to run a surface test on the hard drive, which showed no problems.
Quote:

I would try a clean install of apache with clean config files and work my way to desired configuration.
This certainly is an option, particulary as this is a test server.
However, I'm intrigued to know what I have done wrong - if anything.
I'll leave the thread running for a while to see if anybody has any suggestions.

Thanks for your help and advice,

catkin 11-06-2012 08:46 PM

Could be a file system problem. Can you fsck? The easiest way would be to create a /etc/forcefsck file and reboot. Alternatively boot Linux from media such as a Knoppix DVD. Or, for file systems other than root, go to single user mode.

Could be a disk bus controller or related hardware (inc. HDD-related cables) problem. Easiest way to test would be to replace the motherboard and cables with known good items if available.

lrtward 11-07-2012 10:38 AM

Are you out of disk space?
Run 'df' and see what you get.
I've done that before, and my server acted in a similar fashion to what you're seeing.

countrydj 11-07-2012 11:15 AM

Hi lrtward...
Thanks for your input.
I have plenty of disc space so that's not the problem.

catkin said:
Quote:

Could be a disk bus controller or related hardware (inc. HDD-related cables) problem. Easiest way to test would be to replace the motherboard and cables with known good items if available.
I've removed the hard drive and put it it to a known good computer
I struggled a bit to get the network working, but managed it eventually.
The problem still persists, so back to the drawing board.
Quote:

Could be a file system problem. Can you fsck? The easiest way would be to create a /etc/forcefsck file and reboot.
I followed your suggestion and set the system to check the file system at reboot. In fact it will check the file system at every boot.
Quote:

Alternatively boot Linux from media such as a Knoppix DVD. Or, for file systems other than root, go to single user mode.
I have downloaded knoppix 7 and created a bootable CD.
However, I don't know how to boot it to see my hard drive.
It gets to
boot:
and then continues to a menu.
Now I'm stuck.
Any advice ???

Many thanks for your advice...

catkin 11-07-2012 09:54 PM

Quote:

Originally Posted by countrydj (Post 4824301)
I followed your suggestion and set the system to check the file system at reboot. In fact it will check the file system at every boot.

I have downloaded knoppix 7 and created a bootable CD.
However, I don't know how to boot it to see my hard drive.
It gets to
boot:
and then continues to a menu.
Now I'm stuck.
Any advice ???
.

Interesting -- IIRC the distros I've used /etc/forcefsck with delete the file during boot.

Sorry -- cannot advise; I currently only have access to a netbook without CD/DVD drive so cannot test. IIRC Knoppix boots to a desktop with icons for partitions containing file systems on the desktop. What are the menu items?

EDIT: but how to use Knoppix is academic regards this thread if you have fscked the file system(s) already ... ?

countrydj 11-08-2012 02:24 AM

Quote:

EDIT: but how to use Knoppix is academic regards this thread if you have fscked the file system(s) already ... ?
I thought that, but I thought that I would check it anyway.
Quote:

IIRC the distros I've used /etc/forcefsck with delete the file during boot.
OK. I have never used this before. I placed it in /etc/rc.local. I've now removed it.

I also ran: shutdown -rF now and watched the boot process.
Bootup 'flew' through.

I don't seem to be getting anywhere with this, so I will do a complete reinstall in a couple of days (when I have time)

Thanks for your help and advice


All times are GMT -5. The time now is 09:18 PM.