your £$ support needed

part of a small rebellion | by maryann johanson

server issues, again, and a question for the technically minded

If I’m guessing correctly — based on the last time a comment was posted last night and the kind of traffic I might have expected on an early Sunday morning — FlickFilosopher.com was down again for perhaps as long as 12 hours, up until just a few minutes ago.

If you tried to load the site during that time, you may have gotten something that looked like a error message, or your browser may have suggested that you were trying to download a program and where did you want to save it? That happens because — this is gonna get a little technical, which is as much technical as I can manage — this one line in my htaccess file:

AddHandler application/x-httpd-php5 .html .php .htm .html

keeps mysteriously getting commented out. For reasons that my web host is not able to explain or prevent — though I do keep asking them to — if suddenly turns into this:

# AddHandler application/x-httpd-php5 .html .php .htm .html

which means the server ignores that line and subsequently does not understand how to interpret the HTML pages you’re asking for, and curls up into ball in a virtual corner and starts sobbing.

Now, my host is starting to insist that it’s my job to correct that htaccess file when this problem crops up, which would, indeed, be much faster than waiting on them to do it, except every time I’d tried to make that fix myself in the past, it would hose things even more, as happened this morning: for a few hours after I reuploaded the htaccess file I edited, it was suddenly all Internal Server Errors. So I wasted hours this morning trying to figure out why I was having such problems working on a simple text file, the upshot of which was that I ended up downloading a new program to deal with editing that file, and it seems to have done the trick.

The real issue is, however: I am not the one commenting out that vital directive in the htaccess file. And I think it’s a bit rich for a web host who guarantees 99.9 percent uptime to expect that a customer should have to babysit a site 24/7 so that she can quickly correct a problem that is none of her doing and might recur at any given random interval in order to maintain that uptime.

I’m really at my wit’s end with the whole thing.

So here’s the promised question: Do any of you with hosting/server expertise have any idea what could be automatically commenting out a single directive in an htaccess file? My host has variously blamed Apache and PHP upgrades and unknown server scripts, but no definitive solution to the mystery has been discovered. (If I were really paranoid I might suspect that someone was just fucking with me and trying to drive me crazy.) Could those do it? And if so, how do we stop it?

I really would love not to have to be my own site administrator. It takes too much time away from the real work.

Warning: Invalid argument supplied for foreach() in /home/flick/public_html/wptest/wp-content/themes/FlickFilosopher/loop-single.php on line 106
posted in:
maryann buzz
  • MaryAnn

    So this is what the host is telling me now: that it’s a “feature” within cpanel that after apache rebuilds, the system scans for addhandler or addtype lines it doesn’t like and gets rid of them. And because they added something to my server for another client last night at 1:30am (so FlickFilosopher.com was down since then!), it did the same thing then.

    The obvious question seems to me, If the host knows this problem is gonna recur every time they do something to the server, why aren’t they telling their clients about it so they can prepare to fix it? Or why isn’t the host just fixing it themselves as soon as it happens?!

    Now, this is a host with an impeccable reputation for service and support. And based on my previous hosting experiences, I can’t say that they’re not the best I’ve been with, by far.

    Maybe I’m just in an impossible situation. Maybe it’s just impossible for one person to run a reasonable successful web site on her own. I can’t afford dedicated hosting and I certainly don’t have the expertise to run a server on my own, so that’s it. I’m fucked.

  • Zachary Acreman

    You’re paying them money to break your website at random intervals. Why wouldn’t it be reasonable to ask them to stop? If they aren’t bending over backwards to help you troubleshoot this, then you should be in the market for another hosting provider.

    I’m not a cpanel user, but from the googling I’ve done it seems that the culprit is a script called update_php_mime_types.

    This script can be disabled. Ask them why they haven’t done that. Presumably they have a good reason, and will share it with you, and you can use that info to help you move forward.

    The script’s purpose is to make .htaccess files match up with the configuration selected in the cpanel options for a user’s account. Is PHP turned off in your user configuration? Another thing to find out.


    If you keep hitting a wall with them, there are a million hosting providers out there.

  • Zachary Acreman

    The fact that I’m not seeing any bleating about the problem in Steadfast’s forums suggests to me that the cpanel options for your account might need to be tweaked. Cpanel is used everywhere so if this were a common issue, the Internet would know about it.

    I don’t think the script is broken, so if it’s doing what it is supposed to do, the trick is to figure out why what it’s supposed to do and what you want it to do aren’t lining up.

  • JSW

    I’ve got the directives on how to handle PHP files set up in the main Apache config files on my home server, and the host I use for my low-traffic web site also has PHP handling set up by default, so I haven’t had to do much messing around with .htaccess files. However, if you can set up cron-jobs on your server then there might be a workaround that’ll at least minimise your downtime.

    First, make a copy of your .htaccess file called htaccess.bak. You can do this from a shell login by typing ‘cp .htaccess htaccess.bak’. Then, create a new file and copy/paste the following text into it:

    #! /bin/bash
    if [ -n "`diff .htaccess htaccess.bak`" ]; then
    cp -f htaccess.bak .htaccess;

    Make this file executable by typing ‘chmod u+x <filename>’ at the command prompt (with <filename> being replaced by whatever you called the file) and set up a cron job to run it frequently (once an hour should be reasonably safe.) This will cause the system to check to see if the current .htaccess file is different from the backup copy you’ve made and to replace it with the backup if it is.

    Note that this is a bit of a kludge and really isn’t an ideal solution, but it should keep your downtime to a minimum until you can implement a better fix.

  • JSW

    You know, that cpanel thing suggested by the earlier posters is probably the problem. Try that first. My solution could potentially be more trouble than its worth.

  • MaryAnn

    This script can be disabled.

    They’re telling me now that they’re done just that. We’ll see if it helps.

    If you keep hitting a wall with them, there are a million hosting providers out there.

    Yes, that’s true. But it’s a major pain in the ass to switch hosts — I know, I’ve done it too many times — which would still be true even if it weren’t almost impossible to get any kind of honest assessment of hosting services. How do you choose when all the sites apparently designed to help you choose are also apparently bought-and-paid-for shills? When even the most reputable hosts are the sources of horror stories about sites shut down because a client somehow went over the “unlimited” bandwidth that was supposed to come with hosting? (For just one example of hosting horror stories.)

    There do not seem to be good solutions out there for an individual webmaster running a largish, popularish site. If you’re running a little blog with low traffic, you’re fine. If you’re running a huge site with huge traffic and huge revenue, you have lots of options. For someone in the middle — like me — there doesn’t seem to be much at all.

  • JoshB

    So, cpanel doesn’t like that AddHandler line, but they can’t tell you why? And it’s your job to figure it out?

    That sounds like baaaad tech support to me. They should know these things.

    Most likely there’s a syntax problem that would be easily fixed if they could tell you how cpanel prefers things.

    I wish I knew more about apache and cpanel to give you more than that. I do notice that you have the .html extension twice in that line. Is that necessary? That sort of thing might bother a script…

  • Victor Plenty

    One recommendation I’ve seen is to use two separate hosting providers and keep the site updated on both simultaneously. If you do that, and use a managed DNS provide like http://www.no-ip.com, you’ll always have a backup ready to go automatically within minutes of a failure at your primary hosting service.

    I’m not technical enough to explain just how that would work out in practice for your site, but apparently it’s being done by more and more mid to low traffic sites that want to avoid being taken offline for any extended time. There are probably ways to automate the whole process, so you don’t have to update twice by hand every time you change the site.

  • Yeah, I was gonna email you with some suggestions, but I figured you were probably going out of your mind with frustration (been there). Bottom line is, you should not even need that line in your htaccess… apache should be serving HTML files as HTML all by itself (I know on my computer I was suddenly downloading your pages to a temp directory and displaying them from the local drive).

    Anyway, you’re right to expect them to fix it. Looks like they did… ?? :)

  • Zachary Acreman

    Newbs, that line doesn’t do what you think it does.

    That AddHandler line tells Apache to run .html files through PHP before rendering. Which most certainly IS required for a dynamic, database-driven system like a blog engine.

  • jj

    Still have the same problem? (Me too) my host refuses to accept it is a admin script they are running which is causing me these problems. Anyway changing hosts won’t help if the new host uses cPanel. There is a fix (maybe) according to http://docs.cpanel.net/twiki/bin/view/EasyApache3/UserLevelPHPCustomization

    If you make the .htaccess a symlink to another file (I’m naming mine something other than .htaccess and burying it 4 directories deep) and I’m also going to add the comment “# Use PHP5 as default” just before my AddHandler line it might just work?


Pin It on Pinterest