Archive for March, 2012


A few days ago, I received a complaint that the mail services on my server stopped working. When the user attempted to send an email, they got the error message “temporary error, please try again later.” The reason for this error was the fact the anti virus process had been killed, and my mail system refused to handle mails due this problem.

The reason the anti virus process was killed is because the system ran out of memory:

Mar 23 20:36:09 stock kernel: Out of memory: Kill process 24582 (clamd) score 66 or sacrifice child

In the recent month, the number of sites being hosted at my server has increased. Also, due requirements of some new software on my server, I have enabled a number of php modules that hadn’t been enabled before (such as PDO modules for both MySQL and PostgreSQL). These changes are, so far I can tell, responsible for the growth in Apache’s memory usage.

I will still have to investigate how to reduce the memory usage, as the server is running again, but the available memory is still rather low.

A look at Drupal

In the past months, I have been hosting several websites, which were WordPress based. These were my first experiences with the WordPress platform, and these experiences were quite positive. Therefore I decided to use it for my personal blog as well.

However, I was asked to host a website as well, which requirements go beyond the functionality provided by WordPress, and I was not aware of any out-of-the-box solution to forfill these needs. Therefore I was thinking about developing this website myself.

In the past, I have been developing my own website, which used to run at this domain. So I quite confident I could develop this website. I was planning to release this website as an open source product, and make it part of the BlaatSchaap Coding Projects. This would also mean, I would work on my own website as well, and create a kind of framework which supports both projects.

However, a friend of mine pointed me to take a look at Drupal. There is a so-called installation profile, Community Forge that, to some extend, provides the functionality I am looking for. The “offers” and “wants” functionality looks like what I am looking for, but it would require to add regional options, as the site I am asked to make, should indeed offer there functionality, but it should be one site, in which the user should be able to search in his region, but the site should run on national level.

Apart from that, it didn’t seem to function properly. Added items didn’t appear to be listed as they should. There was a message about selecting categories at the right, but they were missing. After disabling some modules, which provided functionality not needed, they suddenly appeared. When re-enabling those modules, the categories where still displayed.

Another problem with this Community Forge is, that it is based on Drupal version 6, while version 7 is the current version, and it appears not to be maintained. Another problem is, the site feels rather slow, while other sites on my server don’t feel that slow, therefore I conclude it is this site being slow.

I have also installed a Drupal 7 installation on my server, which runs faster then the Community Forge Drupal 6 site. Drupal 7 offers some additional features, like being able to install a module by entering it’s download url. In drupal 6, one had to upload the files to the server, and place them in the correct directory manually. In that respect, I find WordPress much better, as the installation process for plugins is fully integrated, and doesn’t require me to search and find the modules through another website.

This also includes dependencies between modules, which should be installed manually. In that respect, WordPress is more user-friendly. However… let’s take a closer look at Drupal. During my investigations I believe I might try using Drupal on my website as well, as it offers some features which might be interesting for my current plans with the BlaatSchaap Project.

But, let’s look at what is the plan for this website I am supposed to make. A desired feature is authentication through other websites. For example FaceBook. Yeah…. big and evil FaceBook. For this I was looking at OpenID Selector which is a nice looking interface for OpenID (as opposed to entering the OpenID URL manually), and can, through an additional module Facebook Connect also authenticate using FaceBook. At least, that’s what’s supposed to happen. However, it doesn’t work. The Facebook Connect module keeps complaining it cannot find the Facebook API, even though I have downloaded and placed the required files in the specified directory. (Yes, something that had to be done manually) The OpenID Selector also requires to place some files manually, and also, this one didn’t work either. A second attempt to install seemed to work better, and didn’t produce a screen full of error messages, and the login screen appears as it should, however, the login procedure fails. Another attempt to enable the Facebook Connect module doesn’t show the API not found error. This is really puzzling me. I haven’t changed anything between previous attempt.

Another thing that looked interesting is OAuth Connector, since many sites such as Facebook, Hyves and MySpace offer OAuth. In that respect, OpenID and OAuth are the two major protocols for cross-site authentication. Therefore, a general OAuth plugin, not specific to any site, would offer much more functionality. However, it appears this connector only provides an API to perform the authentication, however when I enabled it I didn’t find any configuration for it. (as there should be mentoned in this blog)

There are modules on the drupal site that offer a different kind of solution. Authentication through a third party server. So… the user *and* my site will have to trust a third party, a man in the middle. I don’t like the idea much, thank you. One of these Janrain Engage even charges for their services, while Gigya is free for non-commercial use.

Seeing in the Drupal 6 installation, the categories to appear after disabling some modules, seeing the Facebook Connect (on the Drupal 7 installation) complaining about the missing library one time, and working fine the next, gives me the feeling Drupal works rather unpredictable. I guess I will try some more, using a clean installation, perhaps I am overlooking something…

I might have found a possible explanation for this behaviour. It appears Drupal has enabled a cronjob which might have done something that enabled the things not working in previous attempts. This might be the libraries which I had to add manually, and this cronjob might have “found” then. I am just guessing.

Welkom iedereen, mijn blog woont nu op mijn eigen server. Ik denk dat ik met die categorieën een schifting kan maken tussen Nederlandse en Engelse posts, en zodoende, de scheiding die ik enkele jaren geleden had ingevoerd, kan blijven handhaven, zodat mensen die de Nederlandse taal niet machtig zijn niet overdonderd worden door deze prachtige taal ;) gehehehehe

About this post: I have proceeded installing the laptop in two days, which quite some time between them. I have made notes of this, including some mistakes I’ve made. Therefore this is not directly an installation guide. I guess I should clean it up as an installation guide. However, it might give some solutions to problems encountered in the wild.
I am using a mlti
architecture (x86/x86_64) boot cd. This CD fails to boot correctly on
this laptop when the disc is inserted into the internal optical
drive. Flashing caps lock and scroll lock leds, and after a while
they stop blinking, the hard disk led flashing rapidlly.
To solve this
problem I have installed Smart Boot Manager
(
http://www.sourceforge.net/projects/btmgr)
As this is an older
program, not aware of AHCI, therefore I have set the SATA mode to
IDE. However, the Smart Boot Manager still doesn’t detect the optical
drive.
Since it
mentions on
https://wiki.archlinux.org/index.php/USB_Installation_Media#Overwrite_the_USB_drive
it is possible to write the content of the ISO file directly to a
flash medium, and I do have my digital camera with me, I will attempt
to write the content to an MMC card and boot from that. Perhaps the
content of the CDROM is confusing the “BIOS” in the laptop. (It’s
not a real BIOS, but an UEFI in BIOS mode, but enabling UEFI tells me
this is for development purposes only)
However booting from an
MMC card doesn’t seem to work. I suppose the “BIOS” only
recognises SD cards. (SD is electronically compatible with MMC but
uses a different protocol)
Anyhow, I have found a way to boot the CD. Press Escape, and then F9, during the POST to enter the Boot Device Menu, and inserting the disc when this menu is
displayed (NOT any earlier), and then choose the “Notebook Upgrade Bay” option to boot from the CDROM. (Really….Upgrade Bay means Optical Drive???) Sigh Why is it
so difficult to implement a BIOS that correctly boots from CDs. I
thought we had these kind of problems behind us. Appearently, booting
from CD problems are still an issue today.
Anyhow, now the boot
process is completed, I am dropped in a root shell, with the message
“To begin installation run /arch/setup”, so let’s do that.
Selecting the sources.
Since I am at Stack, meaning I got a high speed internet connection
available, I choose remote sources in stead of the local source.
Core-remote, extra-remote, community-remove and multilib-remote.
Next step, selecting the
mirror. Since I am in the Netherlands, I choose the
http://ftp.nluug.org mirror. Next is network setup. Just a few times
hitting enter to set up a wired DHCP configured network, to be used
during installation.
The next question is
choosing an editor. The choise is between nano and vi. It has as
comment nano (easy) and vi (advanced). However I have no expecience
with nano, but I do have experience with vim, which means vi
improved. Well… let’s give nano a try.
Setting the clock and
timezone, Europe/Amsterdam. The next question, the hardware clock, to
set it to UTC or local time. Operating Systems like Microsoft Windows
usually set the hardware clock to local time, while Linux/Unix
operating systems usually set the hardware clock to UTC. As this
system might Dual-boot with windows later, I will set it to localtime
for now. In the next menu, I choose for syncing time with an ntp
server, and continue.
Back in the main
menu, the next step, preparing the hard disk. I keep the default value for the
/boot partition, 100 MiB. For the swap partition, the default value
is 256 MiB. How much swap space does a system require? I believe an
advice many times mentioned is double the amount of RAM in the
system.
https://www.linux.com/news/software/applications/8208-all-about-linux-swap-space.
I have entered a value of 8192 MiB.
The /
file system: the default value is 7500 MiB. In my experience, this
value is way too low, and I advice to set it to 30000 MiB. After
setting this, the installer asks to use the rest for the /home
partition.
However, I just realised I
might need to install Windows on this laptop later. It would usually
be recommended to install Windows first and then other operating
systems. Due this fact, I will revert the partitioning and make the
partitions manually.
So, I will have a 100 MB
ext2 formatted primaty partition at the beginning of the disk, the
/boot partition, and at the end of the disk, extended paritions,
30000 MB ext4 root, 80000 MB ext4 home, 8192 MB swap partition. Note
the cfdisk tool used for manual partitioning uses MB in stead of MiB.
Setting up the file systems and mount points is a separate menu
option.
Installing packages,
selecting grub as bootloader, keeping the default selection. We will
install software later. Next option in the main menu is to configure
the system. We should add another mirror to the mirror list, but we
shouldn’t do so at this moment, as, a new version of pacman has been
released, and chaning the configuration file now will make it not
auto upgrade the configuration file with options required for the new
version to run. Let’s edit the mirrorlist, and uncomment a Dutch
mirror from the list. The rest we will configure later.
Then we continue
installing the boot loader, and finish up this part of the
installation. I am still not convinced this is the most ideal setup.
I have been thining a lot about wether I would install a windows
installation or not, and how this would impact my partitioning.
Booting, logging in with
the root password set duing the installation.
Run
pacman -Syu
to
install updates. The installation medium comes with pacman 3.5.4.
Since pacman 4 is released, we will need to upgrade this first. After
running the upgrade command, pacman will upgrade itself, and suggest
to run
pacman-key –init
As it requires some random
bytes, and the bare system not doing much other activities this might
take a few minutes to complete. To speed up, possible run
dd if=/dev/urandom
of=blaat count=100
while true; do cp blaat
blaat2; done
in a second console.
When this is done, run
pacman -Syu
It may complain about conflicting files in the filesystem package, if so run

pacman -f -S filesystem

then run
pacman -Syu
again, and answer
questions to replace module-init-tools with core/kmod with yes.
I continued installing on
03-03-2012. Since some time passed by since I ran previous steps, another pacman -Syu is required. It seems some more changed happened and the package util-linux required to be forced as well

pacman -Syu

pacman -S util-linux –force

pacman -Syu

If we wish to run a
graphical enviorement we should install X, therefore we need the
package group xorg
pacman -S xorg
Besides xorg, we need also
a desktop environment and window manager. Nowadays, many of the
options provide both functionality. Technically spoken they can still
be run as separate entities. My choice goes to xfce4. The xfce4 group
contains the xfce4 desktop environment and the xfwm4 window manager.
In the xfce4-goodies package group are some utilities, like a
screenshooter and task manager.
pacman -S xfce4
xfce4-goodies
During the resolving of
dependencies a messaage appears “ kmod and module-init-tools
conflict, remove module-init-tools?”. Answer yes here
There might be some more conflicts, –force them as above
Next, we need a display
mananger. As I have always been a gnome user, until they released
Gnome3, which made me make the switch to xfce4. I have always used
the Gnome Display Manager (GDM)
Let’s see what we have
available. The default display manager is XDM. () This is a
minimalistic display manager. A little too minimalistic perhaps. GDM
has an option to choose the session type, which means, if you have
multiple Window Environments installed, you can choose upon login
which one you wish. This option appears to be missing in XDM. Most
alternatives are developed by a Window Manager project, such as KDE,
Gnome, LXDE, Window Maker, etc. However, xfce doesn’t have it’s own
Display Manager. On their page they point to SLiM as an alternatives
that doesn’t have dependencies of KDE or Gnome. I will investigate
this possibility
pacman -S slim
archlinux-themes-slim
Now it is installed, let’s
try it
/etc/rc.d/slim start
Now, my screen goes black.
Therefore I try to espace back to the console by pressting
control+alt+f1, but I see nothing. I type reboot, and the system
reboots. So the console is still running, but the graphics card is
messed up. Xorg is messing something up. Let’s have a look at this.
less /var/log/Xorg.0.log
The auto configure
attempts the following drivers in this order:
  • nouveau (open source
    driver for nvidia cards)
  • nv (older Xorg driver)
  • nvidia (the binary blob
    from nvidia)
  • vesa (VESA interface)
  • fbdev (Framebuffer)
The xorg driver for
nouveau is not installed. Appearently this is not part of the
xorg-drivers package
The nv driver fails due a
kernel driver claiming it. Appearently the kernel part of nouveau is
installed.
The binary blob from
nvidia isn’t installed either.
The VESA driver appears to
be used, and somehow messes up. Probably because the nouveau kernel
module did some initialisation of the graphics card.
As it appears to be, after
unloading the nouveau driver the console becomes unusable. (
http://askubuntu.com/questions/16998/switch-between-nvidia-current-and-nouveau-without-a-reboot)
Well… the question is,
which driver to use? The binary blob from Nvidia or the open source
nouveau. For the time being, I will use the nouveau driver, since
it’s already in the kernel, and so it required the least effort.
Besides… a binary blob in a linux kernel, well… is it desirable?
But that’s a whole different debate.
So… let’s just install
some stuff
pacman -S nouveau-dri
xf86-video-nouveau
now
/etc/rc.d/slim start
gives a graphical login
screen. Press control+alt+f1 to return to the console. We cannot
login yet since we have no users (expect root) yet.
At this point, we might change some config files
nano /etc/rc.conf
or if you prefer vim,
install it first with
pacman -S vim
vim /etc/rc.conf
In the Hardware section we
see
MODULES=()
If we see a () in this
config file, it means an array. The values are space separated.
It might be usefull to add
the module sg here. I had some weird problems in the past due the
fact this module not being auto loaded anymore, as it used to be in
the past. This module inplements an older interface to IDE/SCSI/SATA
drivers, and is required to run certain cd burining software, such as
Nero Burning Rom for Linux.
MODULES=(sg)
Next thing to do, under
the Networking section, set the hostname. (default setting was
myhost)
At the bottom, we can add
slim to the end of the daemons list.
After these changes, we’re
going to add a user
useradd
and answer the questions,
such as username and password. In the usual case the defaults for
the other options are just fine.
After a reboot I am still having issues. I decided to switch to gdm instead, as I am familiar with this, and it basically configures itself.Although I wonder, why does a Display Manager depend on gcc
I made myself some trouble by forcing a complete upgrade and aborting the installation of a kernel with a control C.  I created myself a corrupted initramfs, causing my system not to book.

So, on a side track, if installing a kernel gives the error

Error hook ‘udev’ can
not be found

you got to re-install udev (just enter pacman -S udev)
If the system is unbootable, boot from CD and change root as described on

Rven though I did a
different approach: I booted from the CD, created a new initramfs using that CD, and copied kernel + modules over to my system, so it was bootable again.

So far this side track, installing GDM, and a dependency dbus, which it doesn’t automatically install with gsm
pacman -S gdm dbus

A test run

/etc/rc.d/dbus start
/etc/rc.d/gdm start
now, we get the login
screen, change the session type from gnome to xfcd4-session, enter
username and password, xfce4 should start. For now, I accept the
default panel settings.
With control+alt+f1 I
return to my console
The next thing to do is
adding the archlinux-fr repository, and installing yaourt. Yaourt is
a front end for pacman. But it has more features, it can install from
AUR. Archlinux User Repository.
As it says on their site
http://archlinux.fr/yaourt-en
Simply add

[archlinuxfr]

Server = http://repo.archlinux.fr/$arch

to /etc/pacman.conf and run
pacman
-Sy yaourt
If you wish to install
some closed source software, such as skype or nerolinux, this can
often be found in the AUR repository. Some someware in the AUR
repository will be built from source by the yaourt. Anyways…. it
enables you access to some more software. One of the packages from
AUR we’ll be using is a simple wireless script, which starts
wpa_supplicant and after it connected acquire am IP address through
DHCP.
yaourt -S wpa_auto
Answer edit PKGBUILD with
no . And the following questions with yes
Then we’ll have to edit
the /etc/rc.conf file again
the daemons, add “wpa_auto
dbus gdm” there.
Edit the
/etc/wpa_supplicant.conf file,
remove everytthing, and
just put
update_config=1
ctrl_interface=/run/wpa_supplicant
In the default
installation there are no tools such as ifconfig and iwconfig.
pacman -S net-tools
pacman -S wireless_tools
Also usefull to install is
wpa_supplicant_gui ,
pacman -S
wpa_supplicant_gui
Now, return to the X world
by pressing control+alt+f7
Open a terminal, and get
root
su
wpa_gui
Now we can configure a
wireless network. And we will notice, due the wpa_auto script, we
will see an IP address appear automatically. Do not forget to save
the configuration. (we did allow this in the two line
wpa_supplicant.conf we made earlier)
Well… so far do good.
Done configuring. Now it’s time to just install some more software,
such as firefox, thunderbird, libreoffice, vlc and so on. But that’s
just straight-forward pacman -S and doesn’t require any other
settings.
System maintenance. To
install upgrades
pacman -Syu
That’s it folks
One more thing. I am
running an NFS server, and to configure that
pacman -S nfs-utils
and add to the daemons in
/etc/rc.conf, “rpcbind nfs-common” after network.
I have also added an @ to
the network, so the laptop will not wait for an IP address in case no
ethernet cable is connected.
So, my daemons look like

DAEMONS=(hwclock syslog-ng
@network rpcbind nfs-common netfs crond wpa_auto dbus gdm)