CPanel Step By Step Tutorials

I went looking around a while back for some CPanel tutorials that I could recommend. The best I found were the videos at DiscoverCPanel.com.

I’ve said many times that I think CPanel is by far the best website control panel, but like most things IT related, it does have a fairly steep learning curve if you’ve never used it before. Discover CPanel provides 3 free videos, so you can get a good look at what’s on offer without paying a cent. Then, if you find that the videos are useful you have the option of purchasing the full set. So, if you’re a bit od a CPanel newbie, give them a try.


Google Says: You Are Banned For Life – Now Please Go Away

Filed under Soap Box | Leave a Comment

Every now and then I like to jump up on the soap box and preach a little.

I recently had an email from Google stating that my AdSense account had been disabled. That’s no biggie – I’ve made maybe $150 in 3 years and there are several other options if you really want to do the ‘monetizing thing’. What really annoys me is that this information glutton doesn’t pay it’s customers the common courtesy of even a basic clue as to why it was disabled. The message I received said:

“While going through our records recently, we found that your AdSense account has posed a significant risk to our AdWords advertisers. Since keeping your account in our publisher network may financially damage our advertisers in the future, we have decided to disable your account.”

I appealed of course and received a reply that said something along the lines of “we confirm the decision and please don’t reply”.

In my appeal I pointed out that I have never clicked on any ads on my own pages, that I did read and comply with their terms of service and I even provided a list of my sites. So, I’m at a total loss as to how my $50/yr of earnings poses a ‘significant risk’ … particularly when Google have paid out tens of millions of dollars to settle click fraud law suits. My sites are all genuine, human-updated real sites.

Apparently this email I received has been sent to many adsense publishers recently and my guess is that they are simply clearing out all the low earning sites. After all, it’s the very large, well organised ‘made for adsense’ networks that are making Google a lot more income than the little guys. And it’s not in Google’s interest to go after those big players unless they get a specific complaint from one or more of their large Adwords clients.

So, is this all sour grapes on my part? Well..not all, but sure enough I am offended at being labelled some kind of crook by Google. Honesty and integrity are important to me. Heck … I’m the guy who tells the shop assistant that they gave me $5 too much change. Still, it’s not worth getting too worked up about. As I mentioned in opening, Google was an insignificant income over the past few years so it’s just one less option if I ever decide to try that kind of income stream in a big way.


Those Annoying Website Permissions

This little ‘lesson’ is going to be partly a rant … but mostly just good information. The rant is directed at hosting companies that don’t enforce strict and consistent file ownership in their web server configurations. Not only are you doing your customers a disservice, but you also are the cause of so many scripts having to have some directories and files set to be world writable. That in and of itself isn’t necessarily a high risk, but it is completely unnecessary on a properly configured server.

Now that I’ve had my rant, lets look at how permissions work and why many hosting servers are improperly configured.

When a CPanel account is created, almost every file below the home directory of that account is ‘owned’ by the username of the account. This makes sense obviously, because as the owner of the web site that is associated with your CPanel account, you should have permission to add, edit and delete files. So, given that you are the ‘owner’ of the files in your CPanel account, why is it that you have to set files and directories to be writable by ‘everyone else’ in order for some scripts to function properly?

This has to do with how Apache is running on the server and, more importantly, WHO it is running as. A properly configured Apache server will be set to run in such a way that when it is displaying files from your web site it will be running as the ‘owner’ of your web site. This is why Apache allows you to set a ‘User’ and ‘Group’ for each vhost account … so that it can run with the correct permissions for each vhost.

The problem is that some web hsoting companies run their Apache server as the ‘nobody’ user. This doesn’t have an affect on your pages being displayed, but it means that if you are using a script that needs to update any files on your website, it just isn’t going to happen unless the files are set to be ‘world writable’. This is why you are sometimes instructed to set the ‘permissions’ to ‘666’ or ‘777’. That allows the ‘nobody’ user that Apache is running as to modify your files which are owned by your CPanel account.

Clear as mud? I hope not … but if you want to learn some more about Unix file permissions there’s a good guide at  http://www.hackinglinuxexposed.com/articles/20030417.html


Domain.com Is Fine But WWW.Domain.com Doesn’t Work!

This issue didn’t start out being a web problem. A client who was running MySQL 4.0.x needed an upgrade done to MySQL 4.1.x because of a new script they had bought. So, I trawled google for some info on the easiest way to do they upgrade (it was on a WHM-based server). That’s my first tip … it doesn’t matter how many years you have been administering/building/breaking servers … there will nearly always be someone who knows how to do the same job better, faster or cleaner. So, I rarely do anything without first searching around a little.

I found a nice, easy guide to doing this upgrade at WebHostGear and set about getting the job done. It all went to plan and after around 20 minutes the MySQL database had been upgraded. I checked a couple of sites by going directly to their domains (i.e. domain.com rather than www.domain.com) and it looked like all was well.

Some hours later, the client contacted me to tell me that one of the sites was down. I checked it using the address they gave me and sure enough, we were getting the default Apache ‘success’ page instead of the site. That told me straight away that for some reason, Apache wasn’t configured for the domain that I was trying to get to. So, first off I checked that CPanel and DNS were still okay (which they were) and then I did another search. At some point I saw a message from someone saying they had run  EasyApache  to rebuild their web server and since doing it they couldn’t get to any ‘www’ domains but could get to the domain itself.

A light immediately went on 🙂 and I checked a few of my clients domain and sure enough … same problem. It turns out that the EasyApache installer had set most of the ServerAlias config lines to the domain without the ‘www’. The fix is quite easy:

Edit /etc/httpd/conf/httpd.conf and check the ServerAlias for each virtual host. They should be set to www.domain.com rather than domain.com. After doing that, you need to run a command to update WHM’s config otherwise WHM will overwrite your changes. The command to make your changes ‘stick’ is:

/usr/local/cpanel/bin/userdata_update –update

After running that command, just restart your web server (service httpd restart) and it should all be good again.


Welcome To The Server Room

The server room is a new category where I’ll talk about some of the day to day problems that I see and how these problems were fixed. The most common issues are generally related to server software such as WHM, CPanel and all sorts of scripts. Solutions can always be found so this category should, over time, become quite a good dedicated server knowledge base.