TurnKey Linux Virtual Appliance Library

Wordpress/Apache - images/css problems on reboot of appliance [fixed]

Keith Shering's picture

Hi all, I'm a Linux newbie, so apologies in advance if this is (or should be!) obvious - but thought I'd share this to help other newbies! :D

I set up a Wordpress appliance (11RC version) - all worked lovely on a VirtualBox VM. Very impressed!

I then installed the same appliance on a physical PC (a FoxConn Netbox 410 - mini PC, Atom D410, 1GB RAM - that sort of thing). 

I started to see a few "funnies". For example:

  • The CSS for the default theme appeared to not work correctly - wrong fonts, misplaced page elements, etc.
  • Deleting and downloading things would temporarily fix this - sometimes...
  • Images (JPEGs and PNGs) were often either absent, or "got more corrupt" from top to bottom.

I could sometimes fix this temporarily by restoring the affected files from a backup - but even when this worked, rebooting the PC would bring the problems back.

BTW, I could repeat the problem with a LAMP appliance, taking Wordpress out of the picture.

What perplexed me is that the same build on the VM was fine after reboots! On the PC, I also checked a load of physical things like disk surface errors and the like to take hardware faults out of the equation.

Anyway... I did a stack of Googling (with a smattering of Binging for variety) and discovered this link:

http://lovinglinux.ubuntuforums.org/showthread.php?t=1385583

It described the symptoms I saw, and suggested that sendfiles in some kernels doesn't quite work correctly.

I added the line "enablesendfile off" to my Apache config.

This has appeared to solve the problem for my Wordpress appliance on the physical PC. Looks like the size of the image files, and larger CSS files, was bringing the kernel sendfile into play.

As I say, this might just save a beginner like me a day or two of troubleshooting (or 5 minutes for an expert ;)

Keith.

Jeremy's picture

Thanks for posting

This will surely help someone else who has the same issue. Nice work. :)

THANKS!!

arghh!! i've been looking all over for a fix for this!!

Thanks a ton. I had a regualar old computer that i was using for a server, but when i tried to create a new server on my little foxcon, the images crapped out on me. Yeah it kept giving me that images are corrupted crap. Thanks, hopefully this will fix my problem.

Post new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account, used to display your avatar.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <p> <span> <div> <h1> <h2> <h3> <h4> <h5> <h6> <img> <map> <area> <hr> <br> <br /> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <em> <b> <u> <i> <strong> <font> <del> <ins> <sub> <sup> <quote> <blockquote> <pre> <address> <code> <cite> <strike> <caption>

More information about formatting options

Leave this field empty. It's part of a security mechanism.
(Dear spammers: moderators are notified of all new posts. Spam is deleted immediately)