Matt McDonald’s Website

Shared Hosting is a Nightmare

I believe I finally have (almost) everything working on my new site. When I set out to remake this page, I figured I had 3 choices

  1. Host the site from my own house.
    Not ideal because I don’t want to open up my home firewall to incoming traffic on ports I don’t have to, and because I don’t have a static IP. It rarely changes, but still, I hate having other people tell me when my own site is down because something I didn’t know about changed.
  2. Host the site on a my employers server.
    Not a bad choice, things are pretty lax around here, no one would really mind unless I started bringing in huge amounts of bandwidth (not likely). The only problem would be in the future, if/when I change jobs, I’d have to move my site.
  3. Use shared hosting.
    I don’t really like paying for hosting, but being a web developer, why can’t I get free hosting somewhere? I asked Matt Frazier if I could piggyback some space and bandwidth off his account, for the price of naming my firstborn son after him, and offered to help him give his site an upgrade as a bonus. He said he didn’t mind, so the choice was made.

This is the first time I have used shared web hosting, and let me tell you, it sucks in ways I hadn’t thought of. I think the main problem is I like to have control over everything that is happening behind the scenes, and I want to figure out exactly why something isn’t working. Let me run down the problems I encountered getting the site up.

First, there was getting the name to point to the right place. So I buy majmcdonald.com and point it towards Matt’s site. The next step will be to somehow get the vhost into the apache config file. The webhost uses cPanel, so I log in and find a button for setting up a parked domain. Bingo! I tell it majmcdonald.com is a parked domain for mattfrazier.net, and get a message that majmcdonald.com must use this hosts’ name servers. Blimey!

Not a huge problem, I log into my registrar, set the nameservers to the shared hosts, then go back into cPanel and set up the parked domain. Now majmcdonald.com and mattfrazier.net are one and the same.

Next I set up a directory in Frazier’s website for my own site. I create a .htaccess file that uses mod_rewrite to send majmcdonald.com traffic to this new directory. It works, hallelujah! Site up and running smooth. This is around 11pm Sunday night. A bit later that night, I log back into cPanel and notice everything has changed. It appears they upgraded their servers. I cross my figures and check my site. Blank… White… Page. Blimey!

I figure it is some type of php error causing this, and they have display_errors turned off. Despite my best attempts to turn it on, using a .htaccess file, the server resists. Then I notice a error_log in my directory when I am logged into ftp. I open in up and see a bunch of errors about unknown cURL functions. So they didn’t compile cURL, even though their site specifically says it is enabled. We send some support requests to the webhost, they recompile php with cURL and increase the memory limit from 8 MB to 32 MB, and we’re back in business.

The next problem happened when I started noticing majmconald.com wasn’t redirecting to my directory. It was just pulling up mattfrazier.net I check out the .htaccess file, my rewrite lines are commented out. I uncomment them. The problem reoccurs, lines commented out again. I uncomment them, and move somet things around. Problem reoccurs AGAIN, this time the lines are simply gone. I figure Frazier is playing a cruel joke on me, or uploading old .htaccess files on accident, but he claims otherwise. The only other thought I have is the host has some type of cron making the changes, or even someone at the company is doing it by hand, which seems really bizarre.

I log into cPanel again, and play with the options. Then I notice there is not only a “Parked Domain” option, but an Addon domain option. This turns out to be what I wanted all along. So I unpark the domain and make it an addon.

The final problem was the Wordpress editor. I was missing the “Visual” editor - the same one you get when writing forum posts to help you with your html style. I did a bunch of research on the Wordpress site, a lot of people were complaining the realpath() function was causing the problem. I poked around the code for a few hours, but nothing worked. There were no errors in the error_log file, and realpath() was behaving as intended. I did notice on my local copy, there was 1 extra javascript file being loaded for the page, so I tried hard coding the include to that file onto the page. Still not working. I tried to pull up the page directly… and saw a 403 error?

So I check the apache error log in cPanel, sure enough, there is a 403 error happening over and over. Since the filename was tiny_mce_config.php, I can only hypothesize apache is set up not to allow “config” files to be viewed in the browser. I renamed the file to tiny_mce_conf.php, hacked the code a bit, and it all started working. I’ll be safe until I forget the change and upgrade Wordpress.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>