Peter's Blog

Redefining the Impossible

Items filed under oneandone


I was watching the news and they mentioned how the pound is falling against the dollar. This concerned me as I am paying slicehost $70 a month for hosting. Some quick calculations told me I was now paying 30% more than when I chose them. It's about £50 a month! Slicehost have been faultless but I felt a review was in order.

The first place I looked was one and one as their 'value' root dedicated servers are usually temptingly priced, even if the companys customer support is dire. In my experience this isn't too much of an issue: if you need tech support you shouldn't be getting root access. My various sites aren'texactly critical (i.e. I make no money from them) in which case I definitely would want to know good support was there. I had one of their value servers a fewyears ago and it was fine but I cancelled it because back then I wasn't making good use of it.

Their 'value' root server was £30 a month and came with:

  • 64 bit 2ghz processor
  • 1G memory
  • 2 x 80g disks in a raid 1 configuration (mirroring, safe from disk failures).
  • a free domain name
  • 50g of FTP space (only accessible from the server)
  • 1Tb of data/month

A very good deal for the money. The box can be rebooted from their web site, there is an emergency boot mode and also a serial login so you can fix network problems. All these tools help me solve any problems myself without needing some guy to press a reset button for me.

The server can be reconfigured through the web site with a choice of Linux distributions. The only ubuntu was about two years old (dapper) but I chose it anyway and upgraded it to hardy.

Everything went smoothly and the blog is now hosted there.

The one problem I have had is that it is using a kernel that has been compiled by one and one and is missing the modules (!) so I can't use autofs to mount the FTP backup space in a file system. Since the next version of ubuntu is out in two days time I will wait for a clean new kernel.

I'm not so happy with having to deal with one and one but this was too good a deal to miss. I'm using their free domain just to access this server as I don't want the hassle of transferring it away from them if I become attached to it. Also I would prefer to have my sites backed up to a third party (escrow). Rsync.net have just cut their prices so I will probably keep using them.

Peter's Blog previous hosts (from memory):

  • pycs.net
  • site5.com
  • linode (briefly)
  • one and one dedicated server
  • site5.com
  • vpshost (briefly)
  • slicehost
  • one and one

Conclusion: moving up from a Vps to a dedicated server and saving £20 a month, not too shabby.


Filed under: linux oneandone slicehost


I got an email alert from SiteUptime to say:

Dear Peter Wilkinson,

This is an automated message from SiteUptime.

Alert Type: Site Not Available Result: Failed Time: September 12, 2005 09:09:43 PST HostName: petersblog.org Monitor Name: Peter's Blog Service: http

There was another email half an hour later to say the site was back again (the polling period is half an hour).

Looking on the server itself:

$ uptime
 09:01:45 up 21 days, 11:21,  1 user,  load average: 0.00, 0.00, 0.00

so the server didn't reboot.

Grepping through the apache access log for SiteUptime..

67.30.130.180 - - [12/Sep/2005:15:11:18 +0100] "HEAD / HTTP/1.0" 200 - "-" "SiteUptime.com"
67.30.130.180 - - [12/Sep/2005:15:41:20 +0100] "HEAD / HTTP/1.0" 200 - "-" "SiteUptime.com"
67.30.130.180 - - [12/Sep/2005:16:11:21 +0100] "HEAD / HTTP/1.0" 200 - "-" "SiteUptime.com"
67.30.130.180 - - [12/Sep/2005:16:41:22 +0100] "HEAD / HTTP/1.0" 200 - "-" "SiteUptime.com"
67.30.130.180 - - [12/Sep/2005:17:41:24 +0100] "HEAD / HTTP/1.0" 200 - "-" "SiteUptime.com"
67.30.130.180 - - [12/Sep/2005:18:11:25 +0100] "HEAD / HTTP/1.0" 200 - "-" "SiteUptime.com"
67.30.130.180 - - [12/Sep/2005:18:41:26 +0100] "HEAD / HTTP/1.0" 200 - "-" "SiteUptime.com"
67.30.130.180 - - [12/Sep/2005:19:11:27 +0100] "HEAD / HTTP/1.0" 200 - "-" "SiteUptime.com"
67.30.130.180 - - [12/Sep/2005:19:41:29 +0100] "HEAD / HTTP/1.0" 200 - "-" "SiteUptime.com"

Missing entry at 17:11.

Looking around this in the apache access log:

80.88.204.40 - - [12/Sep/2005:17:04:09 +0100]
80.88.204.40 - - [12/Sep/2005:17:04:09 +0100]
194.244.83.8 - - [12/Sep/2005:17:41:16 +0100]
194.244.83.8 - - [12/Sep/2005:17:41:17 +0100]

No traffic between 17:04 and 17:41.

Nothing in the error log. None of the other logs show anything suspicious.

I think my conclusion here is that there was a loss of connectivity within oneandone and my server was temporarily disconnected from the internet. Now lets think, if they promise 99% uptime does this mean the server is running or the server is running and connected to the internet?

Anyway, oneandone sent me this email this morning:

Dear Peter Wilkinson,

Please be advised that due to an upgrade of the 1&1 Data Centre, we will need to shut down your server for a short time while technicians perform an internal realignment of hardware.

This move will be made during the night from 18.09.2005 to 19.09.2005, between 11:00 PM and 06:00 AM.

Your data will not be affected by the move. However, as a precautionary measure, we recommend strongly that you first back up your data and server settings.

Best regards,

The 1&1 Team

so apparently they are shuffling things about and could well be the cause.

The alert emails were forwarded to my vodafone email account but the filters on that prevented me from getting notification text messages (until I got a message I didn't know what 'from' address to set the filter to) so I wasn't sent alarming and costly (2x10p!!) text messages.

Conclusion: I shouldn't panic, I haven't run a site monitor before, this kind of thing probably happened all the time I was on site5 and I was blissfully unaware.


Filed under: oneandone site5 siteuptime

2 Comments

I have closed my Site5 account, now that the years subscription has expired. I don't need it now that I am hosted on oneandone and things have been running smoothly for a while. I find it kind of sad as the Site5 account served me well. If I wanted shared hosting again I would definitely go back to them.


Filed under: oneandone site5

1 Comment

Server paranoia has reached the level that I have subscribed to SiteUpTime a web site monitoring service. This will check my site every half hour and email me if it is down. I have added a link to siteuptime to my site which will show the uptime stats for the site so you can sypathise and decide whether oneandone are any good.


Filed under: oneandone siteuptime

4 Comments

Did my daily check on statcounter and my hits for today were a little low. Checked this site and it was dead with document contains no data. Argh. Try to ssh into oneandone dedicated server and ssh refuses my username. Argh. Try to log in as root (which should not be possible, I disabled root login in sshd) and it let me in: it was running the debian rescue system. Somehow the server had rebooted into the rescue console.

Rebooted the system and it seems ok now.

Little more I can do than hope it doesn't happen again. Worrying.

Update: after posting this, went to wikipedia random article and got this. Bad omen.


Filed under: oneandone randomarticle

1 Comment

I set up awstats on my dedicated server. Awstats is a very comprehensive apache log file analyser that lets me see what has been going on at my site. I mainly use statcounter for visitor analysis is it allows me to see precisely what they have been doing, where they came from, which pages they looked at etc. Awstats is more statistics based, giving overall averages and summaries. Also, Awstats tells me about bots and crawlers which statcounter filters out.

Setting it up amounted to:

  • install awstats package using dselect
  • edit /etc/awstats/conf.local to customise, using settings from /etc/awstats/awstats.conf
    • point it at my log file
    • give it site name
    • set log format 1 which appears to be bog standard apache
    • exclude me/my ip addresses from stats
    • enable reverse DNS to see who is accessing me, not just ip addresses
  • edit /etc/logrotate.d/apache2 and add:
    # pcw: from awstats faq: run awstats before log file is lost
    prerotate
    /usr/lib/cgi-bin/awstats.pl -update -config=petersblog.org
    endscript
    
    so log files get processed before logrotate renames/deletes them
  • set up cron job to update stats every three hours. This is to keep awstats database updated and spread out the time it takes
    10 0,3,6,9,12,15,18,21 * * * /usr/local/awstats/wwwroot/cgi-bin/awstats.pl -config=petersblog.org -update >/dev/null
    
  • set up apache to deny access to awstats from anyone but me. This is for two reasons:
    1. privacy
    2. awstats has had at least one bad vulnerability in the past that allowed sites to be hacked

This gives me a better awstats setup than site5 gave me as I have enabled the reverse DNS lookup, meaning I see originating site names rather than IP addresses.


Filed under: awstats debian oneandone


Moved Peter's Blog to new oneandone dedicated server. Observations:

The speed may be due to:

  • dedicated server to itself
  • mod_php instead of cgi on site5.

In summary, woo hoo.


Filed under: blogging oneandone php site5


Now I have debian and webmin running on my oneandone server I must admit to being happy. It is much more to my taste than the plesk and fedora setup preinstalled on the server. I've lost the web reselling tools but I've got a powerful server that I feel I have some control over.


Filed under: debian oneandone webmin


I have a few problems with my oneandone dedicated server:

  • I don't know my way around Fedora Core and cannot find anything
  • Plesk seems to hide most of the configuration deep in it's own directories, making finding anything even harder.
  • It is Fedora Core 2 which is a year or two old. The packages available are a little long-in-the-tooth (Mysql 3.2, Subversion 1.0.9) and the versions are becoming deprecated. Plesk 7.5.3 only supports Fedora Core 2 so ultimately again Plesk is an annoyance.

So I decided to install debian. Ubuntu, my distribution of choice is derived from debian so I know my way around it. Also there is a complete debian mirror on oneandone's servers that I can access without impact on my bandwidth allocation.

I was inspired by this article about installing debian on a oneandone server which gave me the confidence to give it a try. However I didn't follow these instructions for a few reasons:

  1. It requires building a kernel on a running debian system. I don't have one of those and didn't feel like making one. The instructions erroneously say that the network interface has to be built into the kernel but mine is ok as a module.
  2. It sets up static ip addresses instead of using dhcp. The oneandone faqs seem very insistant on using dhcp. Getting this going was the most difficult part of this setup but I am glad I have done it this way: my server will not suddenly break if oneandone reconfigure their network.
  3. I didn't want to clear out my entire hard disk, I wanted to keep the fedora/plesk system in case I wanted to return to it. The fedora installation allocates 27G to a /home partition. I decided to copy the little of this that is used to the root partition and use the home partition (/dev/hda7) for my new installation. I can always re-use the fedora partitions later, if 27G is not enough for me.

I am still grateful to the author of that article for making me believe it was possible.

These are essentially the steps I took:

Start of logged into the fedora system, copy the old home directory to the root partition:

mkdir /newhome
cp -a /home /newhome
umount /home

If the umount fails because files in /home are open then run

/usr/sbin/lsof | grep home

to see what has the files open and stop or kill the processes (lsof, list open files, damn useful).

Create new file system in partition where /home was:

/sbin/mkfs.ext3 /dev/hda7

Mount the new installation:

mkdir /mnt/new
mount /dev/hda7 /mnt/new

Download debootstrap from debian mirror on oneandone servers. This mirror is only visible to oneandone customers. Untar and try to run

tar xvfz debootstrap-0.3.1.5.tar.gz
cd debootstrap-0.3.1.5
export DEBOOTSTRAP_DIR=`pwd`
./debootstrap --arch i386 sarge /mnt/new http://update.pureserver.info/debian sarge

gives error:
E: no /home/peter/debootstrap-0.3.1.5/devices.tar.gz. cannot create devices

Hum, supposed to be in debootstrap archive from what I can tell. Installed debootstrap under ubuntu and copied the file up.

If you get:

W: Failure trying to run: chroot /mnt/new mount -t proc proc /proc

then log in properly as root to get path set up correctly:

su -l root

rather than

su

Looking good:

I: Base system installed successfully.

Do base configuration. This is essentially the debian setup program, it installs loads of packages, asks you what time zone you are in etc.

chroot /mnt/new
mount /proc
base-config

Mostly obvious stuff but:

  • apt sources set to
    deb http://update.pureserver.info/debian unstable main contrib non-free
    
  • Install the following
    • Web Server
    • Mail Server
    • SQL database
  • Use readline interface for configuring packages: I find the dialog interface invasive, it pops up and stops you seeing anything else on screen which you sometimes need to understand what is going on.

For me the nfs package failed to install so I ran dselect and removed it. Installed openssh server and, most importantly, vim. sshd just works, needs no configuration.

Setup /etc/fstab:

/proc           /proc   proc    defaults                0       0
/dev/hda7       /       ext3    defaults,noatime        0       0
/dev/hda2       none    swap    defaults                0       0

Set up /etc/network/interfaces:

auto lo eth0
iface lo inet loopback
iface eth0 inet dhcp

Use dselect to install Linux kernel image for PPro/Celeron/PII/PIII/P4 machines.

Ensure network card is in /etc/modules (without this we are lost):

via-rhine

My box has via-rhine, you can check in /var/log/messages to see what yours might be and look in /lib/modules/*/kernel/drivers/net to see if there is a module for it.

Install lilo:

apt-get install lilo

Copy /etc/lilo.conf from fedora and modify it:

boot=/dev/hda
# for fedora
#root=/dev/hda1
root=/dev/hda7

install=/boot/boot.b
vga=normal
timeout=10
prompt
lba32

read-only

default=lx
append="console=tty0 panic=30"

#
# Debian install.
#
image=/vmlinuz
    initrd=/initrd.img
    label=lx

Run lilo to set this up:

lilo

Quit out of the chroot and copy the /etc/hosts from fedora to the new install.

exit
cp /etc/hosts /mnt/new/etc/hosts

Now go to oneandone control panel and reboot the system into the recovery system. This will have you box running an emergeny debian install. It's handy because we are installing debian. Once installed, mount your new install so that you can copy some more files to it:

mount /dev/hda7 /mnt
cp /etc/dhcp3/dhclient.conf /mnt/etc/dhcp3
cp /etc/dhcp3/dhclient-exit-hooks.d/local /mnt/etc/dhcp3/dhclient-exit-hooks
chmod 755 /mnt/etc/dhcp3/dbclient-exit-hooks/local

This last step took me hours to figure out, I think the dhcp3/dhclient-exit-hooks.d/local is the trick as it does not exist in a standard debian install. While I was messing around I managed to reset the execute bits on the files which broke dhcp completely, hence the chmod to make sure.

From the oneandone control panel, reboot server in normal mode and enjoy.

What is so damn cool about linux is that doing something like this is possible at all. Reninstall a different operating system on a pc in a different country (Germany) through a command line terminal? Try doing that in windows.


Filed under: debian fedora mysql oneandone


I've got myself a dedicated server from one and one. I have had problems with them in the past but they were doing a deal that was too good to miss: £29 a month for 40G/2GHz/256M, Plesk panel, remote reboot and debian recovery tool, free copy of Dreamweaver MX. I ordered it lunch time and it was set up by 4pm. One and One is a big company, there are lots of little 2/3 man companys doing servers but this is the real deal.

One problem I have with it: it's fedora core and I've not used that before, I'm ubuntu/debian. Now where has /etc/init.d gone?

I should have known it would happen, I have to go out tonight, can't play with it. Grrr.


Filed under: fedora linux oneandone

8 Comments