Monday, August 29, 2005

Setting up a Drupal site, day two - Cron jobs

Aaaaaargh! Cron jobs! They are so basic, and I spent most of a day getting one Cron job to run. What the hell is a cron job, anyway? It's an alarm clock with all the ease of use of an 80's VCR timer. "Cron" as in chronograph (with bad spelling). A Cron job says stuff like "do this every 5 minutes" or "run this program on Saturday afternoon, around about teatime." Basic stuff, right? You might already use Windows Scheduler or similar software to do these things on your own computer.

But for our purposes, we want to do things on our website, and the best way to do that is by running a scheduler on the webserver. That usually means setting up something in cPanel *, which will continue to run on your hosting company's computer after you've switched off and gone to sleep, and will keep running when your house is flattened in a flood, or you take a few week's holiday. Cron jobs, when they work, are the first step towards making your website autonomous. One obvious but boring use is to do daily backups. Another use, which is a little bit more interesting, is running your own News Aggregator service on your webserver. In practice that means that your website can display the latest news headlines from, say, Yahoo Asia, and can check for updates every 30 minutes so it will always have something new to show to visitors. Drupal has a News Aggregator built in

CPanel users set up Cron jobs from the main screen of CPanel, by scrolling down to the icon named, er, Cron jobs. From there you are offered two options, Standard or Advanced. Frankly, this is a bit of a letdown from cPanel, because they are both as clear as mud unless you are already familiar with the original Linux text version. But go to the Standard anyway. Enter an email address - hint, set up a new mail folder and rule in your mail reader to hold these messages, as you tend to get a lot of them while troubleshooting. Now look inside the box "Entry 1". There are multiple selection menus, and a single line "Command to run:". The selection menus are your timers, and they are all running. If you click the top line of each one, you would be saying "I want you to do this thing every minute of every hour, of every day, on all days of the week, in every month."

Normal people would just say "do it once a minute". I suppose programmers don't like ambiguity; there's no chance to say "do it once a minute, for a while".

So the idea is, you choose options from this menu that combined together, say how frequently your task will happen. Remember, this isn't really a video timer, that was just my metaphor; you can't program a task to happen only once. Once a year, minimum. To do something on every Feb 21st, 5:19pm, you set Minutes to "19", Hours to "17 = 5pm", Days to "21", leave Weekdays at "Every day", and set Months to "February".

Just to clarify some of those selections:
- the Minutes menu lets you choose a frequency, but the second part of the list is the actual minute. If you knew that Yahoo Asia updates its own news headlines exactly on the hour (e.g. 9:00pm), you might want to update yours at 3 minutes past the hour (e.g. 9:03pm) to ensure you don't miss them. So you would select the number 3.
- Days is of course the Day of the month, e.g. 1st of every month would be 1.
- Weekdays menu is strangely titled. Apparently Unix programmers don't know what weekends are (that explains a lot). Anyway, yes, you can choose weekend days as well as weekday.
- Weekdays vs Days. Choose the one that you want to define, and leave the other at "every day". Choosing "Sunday" and "10" will mean "do it on all days that are Sunday, as well as all days that are the 10th.
- On all menus, hold down the CTRL key to select multiple choices (e.g. 9:03, 9:17, 9:31 and 9:46).

Now for the difficult part.... what task is it going to do?

Well, first of all, the answer is going in that single line textbox above the menus. So you only have the chance to tell it one thing. The idea is, you enter your line there, set it to run every 5 minutes, click Save, and wait to see if it works. Once it's working, you can go back and change the timing to something sensible. So what line do you enter to make Drupal's News Aggregator do its stuff?

On the Drupal forum, they talk about Linux commands such as Wget and Curl. Now this is fine for people running their own private webserver, but most of us don't, and at this point you'll probably become familiar with an emailed error message telling you that you don't have permission to do that. (You can comfort yourself with the fact that your web host is not completely careless about security.)

Keep trying.

Drupal has grouped all the necessary tasks into a single file, so that if you just look at that file in your browser, that will trigger those things to happen. Clever. However you don't want to look at a blank page every 30 minutes for the rest of your life. Apparently it's sometimes possible to just enter the address of that page, e.g. "mywebsite.com/cron.php". More likely, you will again be told you don't have permission.

In Drupal's "scripts" folder there are two files called cron-lynx.sh and cron-curl.sh. These scripts can be "executed" directly by your webserver. If you look at them in a text editor, they are just one line; but you can't run that line yourself using Cron; you have to run the script! Confusing? Yes. But I gather it's necessary for security reasons.

One of these is the one you want. Try both. Chances are, you'll be told you don't have permission.

Have you put the correct "path" in front of the script name, on that line in Cron? For a typical cPanel Drupal admin, the correct version looks like this:
/home/username/public_html/scripts/cron-curl.sh
Username is your cPanel login. Yes, you don't normally see the first few folders in your browser, but they are there, hidden, on your webserver.

By this stage, I was tearing my hair out. If I still smoked, I would have gone through several packs at this point. For me, the final answer was this:

In your ftp or cPanel File Manager, select cron-lynx.sh and cron-curl.sh, and change their permissions, to 755. Don't know what that means? The short version is, it says who can or can't use them. In some ftp software, you set permissions by right-clicking on the file. In File Manager, you select the file then click Change Permissions on the right.

I've tried to cover all the mistakes I made today before I got Cron working for the first time. In the end there was nothing particularly difficult, except knowing the correct line, and ignoring all the irrelevant advice about Wget, etc. But it really did take me most of a day to it working. If you've had a similar battle with Cron, and got caught out by something else, please drop a note in the Comments so that others have a chance to avoid it.

* The Cron program is for Unix or Linux webservers only. Remember, your PC is probably Windows and your webserver is probably Linux. Sometimes there are (less standard) alternatives for Windows servers, but I can't help you there.

Friday, August 26, 2005

Setting up a Drupal site, day one

So this morning I pretty much woke up, plonked myself down in front of the PC with a glass of fruit juice and started installing Drupal. Unfortunately I didn't keep a blow-by-blow account of what I was doing, but it included:

* Reorganised my hard drive. Eh? Yes, I've discovered that these things rapidly get out of control. Modules in one place, Themes in another, multiple versions of source files, patches, settings files, hacked versions, backups... Each site of mine has its own area anyway. So now I've completely separated all downloaded (published) code from anything produced/altered by myself. Any site mirrors will go in the site folder, even if they happen to be a precise duplicate of the source code. And so on. I'm sure this is all really basic to professional coders (and one day I'll start asking about CVS), for me it's just one more tottering step to keeping the chaos at bay.

* Downloaded and then uploaded Drupal. Yeah, Fantastico is great for quick installation, but I prefer to check with the main site to confirm what version to use. In the case of Drupal, there'd been an urgent security fix a few days before, which wasn't yet on Fantastico. So I took that. Less patches, the better. Patches are a nightmare for those of us with limited shell access (only on my main account).

The Drupal installation instructions are a bit out of date at the moment, but I know my way through them now, so here's what you need to know if you're installing Drupal with cPanel. (Those programmer-types who actually wrote and maintain Drupal typically have a self-built webserver sitting beside their feet, and enjoy typing cryptic codes at a blank screen - and assume that everyone works that way. One day we'll be sending anthropologists to study their culture.)
So, the cPanel version of the Drupal INSTALL.TXT file (in the main Drupal folder) starts like this:

Do I have the requirements? Yes you do.
Do I have the optional requirements? Yes you do.
  1. Download Drupal - you've already done this, or you wouldn't be reading the file.
  2. Create a database -
    - Go to cPanel, then go to MySQL databases. It looks really complicated. Most of it can be ignored.
    - Scroll to the bottom, then look up a bit for a button, "Add Db". Enter a database name, e.g. "drupal", and click Add Db. You'll never see any of this again, by the way, it doesn't appear on the site. Important note: if your login to cPanel is "widget-network", then your database will be called widget-network_drupal. Do not forget this!
    - Just below Add Db, you have Add User. Create a user called User.
    - And the bit I always forget and get confused about: above Add Db, there is "Add User to Db", and a bunch of checkboxes and dropdowns. Select your new username, and your new database; make sure only the first checkbox is checked, and click that button.

  3. Load the Drupal database scheme. This means go into phpMyAdmin. There's a link for that at the bottom of the MySQL page that you are on. When the new window loads, select your new database in the top left corner. Then select the SQL tab in the main window. Now open the file database/database.mysql (I mean open the one on your hard drive, in a text editor such as Notepad using File>Open. You need a better text editor.) Copy and paste EVERYTHING from there into the box in the SQL tab. Click Go. Got some error messages? Did you copy ALL the text (ctrl-A)?

  4. Connecting Drupal [it means, to the new database you created.]
    - I can't help you much here. Follow the instructions in the INSTALL file. You need to be using a text editor such as Notepad and upload the edited Settings file with FTP. Or I suppose you could open the file from cpanel's Filemanager and work in that. BTW, if you are using a proper text editor, they will highlight the text in colours, so you can happily scroll through the entire settings file in seconds. Because apart from the relevant lines, it's all comments. First interesting line is on line 80.

  5. Configure Drupal. Pah. Look at Drupal in your browser. See anything? Don't worry, no one's ever made their first jump. Got an error message? Copy a relevant bit of it and google it. Got nothing? Check the Drupal user forum for "blank page on install" or similar. Check this really useful page for troubleshooting. It happens to be for Wordpress not Drupal, and assumes a slightly higher tech level than this page, but lots of "silly basic stuff" that can trip up anyone. Finally, ask the experts, or ask me. I get Comments emailed to me, you know.
The rest of my day involved jumping around setting up user permissions, blocks, theme engine and picking a theme, Adsense, forums, searching for feeds, and trying to get the News Aggregator to work, which is where I'm stuck now. Cron jobs. I know what I'm supposed to be doing now (I think) but it ain't doing it; but that's for another day.

But at the end of day one, I had a site online, with the basic "shape" that I want, and that's got a definite feel-good factor.

Drupal vs Xoops, a personal battle.

Okay, it's official. After finding myself more and more dissatisfied with Drupal, I'm going ahead and installing Xoops. Not, I hasten to add, as a replacement for a Drupal blog. The Drupal blog is somewhat on hold, while I discuss it with a friend; in the meantime I've decided to set up yet another one. And rather than leverage my knowledge of Drupal so far, I've decided to explore Xoops.

Is this wise? To be honest, I'm not entirely sure... But it's another learning experience (yet another). It's all Fantastico's fault. Fantastico encourages you to be blasé about such things. I've already done another Wordpress installation and some playing with it today, just to remind myself of the look and feel of it. I'll do Xoops the same way, and think some more about what I'm commiting myself to - but the flip side is, what have I already committed to, by leaping into Drupal?

So what's wrong with Drupal? Well, number one has got to be the forums. They simply don't feel like forums, to an extent which I believe would utterly confuse the average user - you can't just throw away look and feel like that. It's as if someone replaced the metaphor of files and folders with, er.... I can't think of an alternative. See how deeply ingrained it is... (and to completely distance myself from the subject - try asking a computer-literate young non-English speaker if they know the word for those dusty old cardboard covers full of pieces of paper... ) Number two is the callous way they treat all content in the same way, whether it's a Quote that obviously has one purpose in life, to sit in a sidebar; or a 5,000 word article that deserves an ensuing discussion. Er, not that I've written any 5,000 word articles (yet)... All "comments" are treated the same too, hence forums looking absurd - they are just a collection of comments to an initial piece of content.

Aaaaaargh - screeching halt on the Xoops project - apparently it doesn't actually have search engine friendly URLs. Talk about forgetting the basics. Another absurdity is that the Download page offers a load of different versions up to 2.2, but it turns out that no one's built any modules or themes for it, and the real current version is still 2.0.13. Right, time to overcome my grudges at Drupal and plunge into editing themes to reduce the above problems....

Update: and it seems that someone already did 95% of the work for me. This article explains (and provides code) how to make Drupal's forums look like proper forums. It limits me to phpTemplate-based themes, which is fine because I prefer them.

Wednesday, August 24, 2005

Colour-matched Google Adsense

Google Adsense adverts look much better than most flashy banners - but if you use the default styles, you've probably found they are just a few shades away from matching with your blog's colours. It can be quite tricky to match exactly the colour you want. Here's an easy way that I use.

First, login to Adsense, go to the Adsense for Content tab and scroll down to the Color Palettes section.


Click Manage color palettes...




This screen lets you pick the colors you want. First pick an existing palette (perhaps one similar to what you want). Now you can change each colour, as shown in the on-screen example. It's possible to pick colours from their colour grid provided; but that's still quite limiting. To get a perfect match, you need to type the precise code for that colour, into the boxes. In the above screenshot, my red arrow indicates where to enter the code to set the border colour.

But how do you know what code you need? Well you could read through your template, but that's the slow and painful way. No, what you need is this handy little tool: Color Detector. It's free (freeware), and you can download it from www.cosmin.com/colordetector/. Here's what it looks like:


The way it works is simple - it tells you the colour code of whatever is under your mouse. So you can find the colors of your blog's post titles, or even the precise shade of your eyes in your photo.

Then go back and paste the code into Adsense (or just type it, it's only 6 digits - but be careful not to delete the '#' symbol.) Save your new settings with an easy name like My-blog-sidebar, so you can select them again in the future. Then make your Adsense advert as usual.

That's it!

Was this post useful? Do you have any questions?

Monday, August 22, 2005

Finding a good web host

To find a good value web host, you --

Wait! How much does web hosting cost?!



Ahem. Under $10 per month, if you look around. Or under $5 per month. You can get everything you need (previous) for that price. Seriously. The hard part is getting good quality hosting for that price, but that too is possible if you search. By good quality, I mean their computers don't disappear off the face of the internet for a weekend; and they do answer your emails...

I'm a natural miser. It took me two bad experiences before I realised I had to stop concentrating my search on the absolute minimum price, and look for recommendations. Unfortunately none of my friends could recommend a good host (although two could tell me to avoid the hosting they used). Of course I could find opinions on the web, but I could hardly expect the search engines to throw up unbiased results. Fortunately there IS a way to get recommendations on the web, even on such a heavily spammed subject. Forums. A busy forum is full of contributors who are obsessed with a given topic, and generally happy to show off their knowledge to passing newbies. Try it (results open in new window):

Google
Here's the place to ask if your prospective host has a reputation for problems. One person's good experience isn't necessarily more reliable here than anywhere else, and one person with a grudge can make more noise than 20 happy customers. But the rest of the community will probably unmask such posters. Best of all, if you flick back through the pages you'll likely find a poll on good hosts... simply looking at the top few of these is an excellent place to start.

So who do I host with now? HostingZoom.com. I'm not affiliated with them and I don't earn anything if you follow that link, I'm just happy to recommend them. Although I have a "reseller" account which doesn't provide for phone or instant chat customer service, they've still answered every email within a few minutes, even with our 12 hour time difference. I've just taken a look and currently their giant "basic" package allows 6 different domains, depending on whether you pay in advance or monthly installments, for $5-$10 per month.

Of course this is the internet, so you can't necessarily trust me :-) Please feel free to leave recommendations, commercial or otherwise, in the comments.

Saturday, August 20, 2005

Hosting your own website

The good news is, hosting your own blog on your own website is either very cheap, or free.

Hosting space is available everywhere. The space used in a Blogger account is free, and seemingly unlimited (there's a limit per post, and a limit of 300Mb for images, although you'd be hard-pressed to reach them unless you write an entire novel in each post.) You may already store your photos online with Picasa, Imagebucket or other free services. So it's not surprising that there's various free options for hosting too. One of the most infamous is Geocities, which has a limit of 15Mb, tiny by modern standards. Frankly Geocities is more limiting than Blogger.

Another common type of free account is one supplied by your ISP/broadband/cable service. Again, these really aren't worth looking at. If you're thinking about hosting your own site, the most basic need is to use it with your own domain name. If that involves paying someone an extra charge (as well as paying for the name itself), then you might as well start off by paying for the hosting.

The trouble with looking for unbiased opinions on what you really need for web hosting is that the web is so full of people trying to make a buck. I'd like to make a few baht myself (different currency), and I will if you click on those adverts on the left. Don't click yet. I haven't seen the adverts or advertisers (they're chosen by Google) but I suspect they'll be offering web hosting deals and full of big numbers boasting how much diskspace and bandwidth they offer. What about comparing long lists of other features? Each seems to offer a near-infinite list of features, but which hosting features are essential? Which are so basic as to not be worth mentioning? and maybe most importantly, what hosting features don't they provide, that will cause you headaches and extra expense later?

I'm not going to tell you :-)

But I'll give you a huge hint. If you're considering cheap web hosting, look for this:
cPanel

CPanel is the Microsoft Windows of web hosting, and I mean that in a good way. Technically that's not accurate, but it's an easy way to understand it. It's a simple and standardised way of working with the web server via your browser, and if you ever decide to move to a new web host, you can expect them to have cPanel too.* But perhaps more importantly, it provides a standard feature set, so you don't have to memorise a huge list of things to look for when comparing web hosts. Its standard feature set is this: everything. Well okay, that was a small exaggeration. But for example, you can safely assume lots of POP email accounts, MySql databases, subdomains... you may not understand these things, and perhaps you'll never care. But to be honest these things cost the host nothing - the only reason to limit them would be to charge you more money later. The point is, cPanel puts you in the right ballpark, or at least the carpark of the ballpark.

I'll explain more about what cPanel actually provides in a later article.

So assuming cPanel, what else matters? Well, those big numbers... diskspace and bandwidth**. Diskspace says how much files you can put in it. A typical amount is 1Gb for the most basic package. For example, if your family photos are 1Mb each, and you put them on your website without resizing them for the web, you can fit 1,000 of them. Because you already knew that 1Gb ("gig") equals 1,000Mb ("Meg"), right? (Extra points if you knew that it's actually 1,024Mb. And if you knew why, give yourself a pat on the back, a sprained shoulder and the next two weeks off. The rest of you - trust me, it's not important.)

However in this case a picture is worth rather a lot more than a thousand words. 1Mb can hold around 160,000 words, unless you're superfluously sesquipedalianistic. Or Finnish. For those of you that are following the story of my own site, I have 3Gb. But that's actually spread across a number of sites, and the amount I allocated to AnEnergyOfHisOwn is just 200Mb, which is more than it'll ever need. Currently, it uses around 2Mb, which represents the software Drupal that it uses.

The other big number, bandwidth**, says how many visitors you can have each month. A typical amount is 10Gb per month. So if your family photo album is now online, with each photo 1Mb, and the average visitor looks at 100 photos, then your site can accept 100 visitors every month. Enough for the biggest and most photo-obsessed families. But if you like other people to see your pictures too, you might have a problem - better resize your photos fast. What happens if you exceed your bandwidth? In most cases, visitors to your site will see a notice from your web host saying something like "sorry, this site has exceeded its bandwidth. Please try again later." You've probably seen these messages on sites hosting the latest amusing video clip, since video uses even more bandwidth than pictures. Meanwhile, as the site owner you should have received advance warning emails as you approached your limit. Your options are fairly simple: if you pay nothing, your site will recover next month. Or depending on the host, you can pay more to upgrade to the next package, or pay more for this month's bandwidth and hope it doesn't happen again. However, a warning here: a few hosts will allow you to exceed your limit, and then bill you later at super-high rates mentioned in the fine print of the contract. This is of course very nasty.

As you can see, for almost all people, diskspace is never an issue. If you're planning on having a popular blog, and like to post lots of high-quality pictures, bandwidth might be.

Two other important points haven't been mentioned yet. They're not measured in numbers or yes/no questions. One is customer service. If your website disappears or your new email stops working, it might be their fault or it might be yours - either way, you have to solve it and there's no shop to go back to. (There are limits to what is reasonable - don't expect them to tell you how to fix the website itself - if you have trouble with your blog software, go back to the people who made it, your host just hosts it. )

And finally there's reliability. Now many companies like to "prove" their reliability by claiming 99.9% uptime guarantee. That means the amount of time that normal service is available, and 99.9% means they can be unavailable for 8 hours per year. However a guarantee means nothing if the companies ceases to exist. My first web host turned out to be a one-man operation. He provided good service so I had no problems with that - until he sold his company. The new guy ran the business into the ground within a few months and stopped answering emails. As he was in the U.S. and I'm in Thailand, I had no practical option but to switch to a new host, and accept my lesson.




* cPanel is of course commercial software. Although you don't buy it, your web host does, and ultimately part of that fee is passed on to you. Sadly I don't have any shares or interests in cPanel Inc. Like most successful commercial software, there is an open-source equivalent - Webmin. I'm sorry to say I know very little about it except it doesn't seem to be available with any commercial deals yet. I predict we'll hear more about it in a couple of years...

** The correct term is data transfer. Bandwidth really means something else, but the battle has already been won and the most popular word is bandwidth.

Friday, August 19, 2005

Getting your domain name

Domain names first; they're easy. The first thing to learn is; they are never free. Stop searching now. ICANN does not hand out free international domain names to anyone, nor do the individual countries.

Apart from the well-known endings of .com, .org and .net, there are a few other international endings such as .name and .info . There is also a country-specific ending for each country, for example .th for Thailand. These are controlled by an appointed body for each country, which operate under their own laws, and you'll have to find out for yourself the procedure in that country. In many cases you need to have a registered business in the country. The rest of the article applies to the international endings only.

You can save money by shopping around for a cheaper registrar - the company that registers the domain on your behalf. ICANN is an independent organisation, they just make the rules and set the fees for the registrars. Bear in mind that once you register your domain with them, it's not so easy to move your domain to another registrar. Most registrars offer lots of extra services such as website design, hosting and email. You do NOT want to be tied to the registrar for these - generally they are poor value for money. Check that it is possible to "set your own nameservers". That last bit means "point the domain name at my own hosting space (and I'll take care of everything else myself, thanks.)"

One registrar to avoid is Network Solutions. Originally they had a monopoly, and as they still hold the largest share of the market, they have a reptuation for practices that many regard as unfair. I may as well say who I use (and I've registered a number of domains) - Godaddy.com. Have I any complaints? Yes, their website is slow and cluttered with so many adverts for their own services that it's hard to find anything on the page. And when trying to actually pay for something, they push so many "special offers" that I have to closely inspect the total at the end to ensure it's what it should be. Recently I renewed a domain and counted nine extra pages between click-here-to-finish and actually finishing. However, apart from that, they are one of the cheapest at $8.95 per year for a .com domain. Since you don't deal with your registrar very often, that's good enough for me. Europeans should note that most registrars require payment by credit card or Paypal. If anyone knows one that accepts debit cards, please post a comment.

Oh and of course you need to choose a name. You'll need your imagination on this; all the obvious ones were taken years ago. You can't check by typing potential names in your browser - often, they are already taken but don't yet have a website - or went out of business. Any registrar will let you check from their front page. A useful tool is Nameboy, who offer suggestions based on two starting words that you give them. Then there are companies such as DeletedDomains.com, who let you search their list of domains that someone else once thought worthwhile registering, but then allowed their registration to expire.

A word of warning - don't allow your own domain to expire. When setting up an account with the registrar, use an email address that you'll be sure to still have next year, to receive a reminder to renew your registration. You're also required to put an email address on public view in the domain registry - that guarantees it to be on every spam list forever, so I recommend keeping a separate spam-only (i.e. free) email address for that.

If you're still following my story of setting up a new site, thank you for your patience. Ironically, I started my site on an existing domain that I had - one which I use as a general purpose hold-all, like a spare room full of the furniture that you weren't sure what to do with. At that stage, I wasn't too concerned with outward appearances. I wanted to spend some time deciding if I was happy with my chosen tool, Drupal, and generally trying things out. So I put it here: rubberbucket.com/drupal.

The Story So Far

I'm already almost two weeks into creating the site, so I'll have to skip quickly over what happened in that time. First of all, it's only fair to warn you that I'm "a techie", so I didn't learnt everything I needed to know in the last two weeks or months. That said, I have taught myself almost everything that's relevant to websites, without buying a single book. If you're a blogspot blogger and you've thought about going further, my advice is embarrassingly like a certain sportswear manufacturer; just, ah, try it. You'll succeed in the end, and probably you'll spend more time on it than if you did a ten-week guided course - but you'll have learnt a thousand times more. By the way, this isn't a course or a set of instructions. I'm just writing what I did, and if someone finds it it gives them a few pointers, glad to have helped.

Your teacher is here:
Google

Next, I already had a host, and a spare domain name. A domain name is easy to understand, the domain name of this blog is aaaaaargh.blogspot.com. However, we're all part of blogspot.com here, which takes away a bit of the fun. So usually when people say they want their own domain name, they mean like Example.com. A host is computer which is permanently connected to the internet, and specially set up in a fairly complex way, to show your website to other people. For all sensible purposes, this means you DO NOT host your website at home. Really. Don't even think about it. What the world does, is, it uses the services of hosting companies. These companies typically have roomfuls of webservers (computers designed for doing this) in underground air-comditioned secured premises, with deals and super-high-speed connections to multiple ISPs. You don't need to know that. You need to know -
What's it going to cost me?
And if you're thinking clearly, you don't want to pay for lots of optional 'extras', so you should also ask -
What do I really need?
Read on...

How to put Google Adverts in your Blogger blog

(From a guy who's just done it.)

Okay, so I'm not a professional blogger, I've been using Blogger for about four days and this is about my fifth post. You'll notice that I'm using a default template but I have Google Adsense ads over there on the left, and if you scroll down you'll see a few more Google links of a different kind, at the bottom. I think they look pretty good. How?

There are two main things to do: sign up to an Adsense account with Google; and edit your Blogger template. The first one is as easy as signing up for, say, an email account. The second involves "copying" and "pasting". Think you can manage that? :-) Okay, then do it now, as you're reading this.

Signing up to Adsense

Nothing too strenuous here. You'll need:
Ready? Click here to start: Join Adsense, and on that page click the button that looks like this:




Fill in your information as above. It's all on one screen. Then just click Submit. You have a second chance to check your data, then click Confirm. You can close that window now.

Check your email (the one you signed up with!). You should quickly receive an email with a confirmation link. Click that link...



Is this what you see? Congratulations, you can now use Adsense.


So I have to wait a few days, right?

Well yes and no. You have to wait a few days until you can start to earn money with your adverts. But I can show you how simple it is; and when you are approved, it will take seconds to complete the final step.

So here's what you see when you log in.




Since you haven't earned anything yet, skip the Reports (above) and move to the "Adsense for Content" tab (below), which is the only one that's important to us. This is the page where you choose all the options for your advert. Those options decide the shape and colour of the advert, as well as more advanced options that you can learn about later.


Above: leave Ad Type at the default settings.




Above: This decides the shape and size of the block of adverts. "Wide Skyscraper" is the type you can see running down the left side of my blog, and is a good size for fitting in the sidebar of most blogs.




Above: This decides the color scheme of your adverts. For the moment, select one of the default options - you can make up your own one later. See this post for a great tip on setting custom colors.



Above: Alternate Ad, Channel, Framed pages - you can definitely skip these advanced options.



Above: at the bottom of the page, the result! Don't worry, you don't type anything or need to understand this code. You just copy and paste it into your blog's template. If you're following these instructions step by right now, leave your browser open at this point, and open a new window to look at your blog's template.

The Template

If you've glanced at the template tab before, you may have seen a mass of unrecognisable code. Don't worry, this does not involve learning HTML, CSS, or anything else. The basic idea is that you are going to find a suitable place to paste the Adsense code that you saw above. So edit your blog, and click the Template tab:



You need to find a "safe" place in that spaghetti of code, to put the Adsense advert. I'll assume that you still want the long tall shape, and you want to put it in the sidebar. However I can't tell you exactly where to put it, because each template is different. Remember when you signed up to Blogger and choose one of about 20 colorful designs? This is the place where they're different... So start scrolling through that text. You're looking for this text:

<!-- End #sidebar -->

I can give you a tip: scroll all the way to the bottom, and then start searching upwards. In many of the templates, it's towards the bottom. The aim is to insert your Adsense code within the sidebar section (between the beginning and the end...)



Above: this is an example of the original orange template (without my other modifications.) At the bottom of this picture, you can see the End sidebar message. If you paste the Adsense code at this point, it will appear below everything else in the sidebar (but before the end).






Once you've found the End sidebar message, you can scroll up a little, and paste the Adsense code in different places. Above: in the first example, the adverts would be below your photo + profile summary. In the second example (not in all templates) they would be below those links. By the way, I've highlighted the links in blue above: if you don't use them, perhaps it's time to delete them, or replace them with some of your favourite websites.

Once you've pasted your Adsense code into your template, I strongly recommend you click Preview and check the result, before clicking Save. That way, if you do delete something important from the template, you can exit without saving, and try again. If you still can't recover your template, click "Pick new" template, and select your own template again, to reset everything.

My Other Blog is a Porsche

Okay, here's the truth. Aaaaaargh.blogspot.com is just a cover, a front, an excuse for a blog. My 'real' blog is somewhere else... Well okay, this is a real blog too. In fact as far as the reader's concerned, it doesn't matter what blogging tool I'm using, or what my future intentions are, and it might not matter that the URL is aaaaaargh-with-six-a's, since the chances are you got here by clicking random things. But for me, the concept is that I'm slowly starting my first blog elsewhere, and I wanted to document it. In another blog. Here. Got that?

The other blog has its very own shiny new URL, albeit another slightly silly one. It's intended to stop me taking things too seriously, although that's not a guarantee. And it's not made with Blogger, it's made with Drupal. Drupal is open-source software, which means it's free and made by volunteers whose idea of a good time is a night hunched over their keyboard in a darkened room, scrolling through a thousand lines of computer code looking for the missing bracket. If this sounds like you, you should know that putting your monitor at the correct height will improve your posture and improve your chances with members of your preferred gender/species.

Er, where was I? Right, so I'm making a blog with Drupal, which involves rather more work than getting a Blogger account, but on the other hand gives me more freedom to do interesting stuff. I can add non-blog pages, for example if I was writing about a highly specialised subject, I could add a glossary section. Or a simple forum. I could add a selection of witty quotes, and have them appear in rotation in the side column. I can... well, watch. It talks about Peak Oil and economics and the near future and it's at AnEnergyOfHisOwn.com, but if you aren't interested in the subject, you might be interested in reading (here) about my progress in making the website (there).

More about Blogger as a Blogging Tool

I'll come back to this.

Thursday, August 18, 2005

First impressions: it's slow

It's slow. It is reeaalllly slow. It's slower than anything I've ever seen from Google. Hang on, did I go to the wrong site? (Clicks 'Help' button in top-right corner, looks for 'About' link, scans page for word 'Google'.) Nope, this is the Google one, alright. Well guys, I hope it was a momentary glitch, cos frankly if it's this slow, I don't think I can bear to finish my self-assigned task of exploring Blogger's capabilities as a blogging tool. You'll be the Hotmail of the blogging world.

Okay, apart from speed, I'm going to explore the basic options and report back. At least, that was the plan. The sheer slowness is making this hard, since I inevitably switch to another task and forget what I was going to say. So far, I haven't actually looked at my own blog, which is a bit like Christmas morning waiting at the top of the stairs, er, only not quite as dramatic as that really. Especially not for a guy who's opened a few websites before. Er, back to the plot...


First impressions: well, the bit I'm looking into right now, looks like the part where you write your email, in a web-based email program. That means, if you can send emails with Hotmail or Yahoo or any of those sort of things, you can get this far. There's a Title Bar (for this one about, I've written, "First impressions: it's slow"), and there's icons for eight different fonts, making my text bold, italics, setting colours, making a link, and so on. Oh, and there's an Add Image icon, which isn't terribly clear (there are tooltips to tell you what each icon does, though.) Images are always a hassle to put on websites, so let's see how Google does...

7 minutes later... tada! Okay, first, that was pretty quick, really. No messing around here, I started the clock and then went to get my camera, find cable, plug things together, download a bunch of pics, choose one that wouldn't actually embarrass (that was the bit that took most of the time, moved onto computer and so on. The Add Image button brings up a pop-up with the most basic types of alignment, and also allows 'small, medium or large' (no super-size). Now in my head I know that the pictures on my camera are "too large" for the web, ie left to themselves they would fill your screen and be really annoying. So the techie in me is asking certain questions at this point, which I shall ignore. Point being, it works. It was easy. And I can even drag the inserted picture around in my editor. (In case you're wondering, that's a photo of a stormy Bangkok moon beside a "ghost building" - an abandoned skyskycraper.)

BUT, inserting the image messed up the rest of my post. All my text was merged into a single paragraph, which in my mind is a seriously annoying mess. Given the size of this post, that's a lot of hunting around to replace them. Another black mark, I'm afraid.

After the Add Image icon, we have the Preview link. Why it isn't an icon like everything else, I don't know, but it works well and is quick. Now, where's the Save as Draft button? Surely they can't have forgotten that again? (It was bizarrely missing from the first beta version of Gmail, which they were admitted was a rather silly omission. In fact no, it's not missing as such... However on my browser, it's not visible unless I pick up my mouse and scroll down the main window, which is a tad annoying. Admittedly, I have a single toolbar installed - the Google search bar! and Firefox tabs. Other than that I believe I have a typical screen size, so this seems like poor design from Google.

In the botton of the main post frame, I can choose to allow the general public to leave comments on my post (surely the whole point of blogging - feel free to add coments to my lonely blog posts), and a 'cheat' function to change the time and date of my post.... presumably so my employer doesn't find out that I wrote all that gossip during working hours. While those are handy options, they don't strike me as the most essential to have around cluttering up the interface. Oh well.

So having typed my first post keeping my family and friends updating, what else do you need to do? Well, beside the Save as Draft button, there's a bright orange Publish Post button. What does this button do?.... aaaaaargh!








P.S. After your post is published (available for the world to see), you're given the option of going to see it yourself, optionally in a separate window.

P.P.S. There are 6 'a's in
aaaaaargh.blogspot.com . Remember, that's 6 'a's, and an r, g and h. Add me to your bookmarks.

P.P.P.S. If you read the last one and added me you your bookmarks, thank you sir, you are a gentleman/lady. As a reward, let me give you a hint. You know when the internet pops up big flashing lights saying "Congratulations, you are our 500,000th visitor!!! Click here to collect your prize!!!!!!" ....? Don't click. It's a scam.

"My First Blog" isn't getting off to a very good start.

Ok, ha ha Google/Blogspot/Blogger, thanks a lot. Now, first of all, what the hell is my own URL? And second of all, that did NOT take less than five minutes. All I know is, I was getting more and more frustrated with "sorry, that name is not available", with all my imaginative array of URLs, and I finally tried aargh.blogspot.com, which of course was taken, so I tried aaargh and then aaaargh and by this stage I was punching the keyboard until oops, one of them was suddenly available. So now I have an impossible-to-remember URL. Aaaaargh!

Funnily enough, in the middle of all this I decided to check whether my wonderfully imaginative names were also registered as .com addresses. They're not, apart from one guy, aboutblogging.com, and it's one solid mass of marketing gumph.

Note to self: next time Google starts a new service, jump on the bandwagon very very quickly, just to grab the name. I dismissed a Blogspot blog as something I don't need, since I'm capable of making my own blog, thank you very much. And in the end, I find myself back here anyway, with the web's hardest-to-remember name yet. Even the guy/girl running aaaargh.blogspot.com is doing better than me.

Now where was I?

 Previously:    Basics of Using Categories    Phuket-live.com - another Drupal website    Setting up a Drupal site, day two - Cron jobs    Setting up a Drupal site, day one    Drupal vs Xoops, a personal battle.    Colour-matched Google Adsense    Finding a good web host    Hosting your own website    Getting your domain name    The Story So Far   

Rate Me on BlogHop.com!
the best pretty good okay pretty bad the worst help?

This page is powered by Blogger. Isn't yours?