Monday, 28 April 2008

Distribution Upgrade 7.10 -> 8.04

As with the upgrade from 7.04 to 7.10:
  1. sudo do-distribution-upgrade
  2. keep the configuration files
  3. accept deletion of outdated files
  4. reboot
For a complete list of prerequisites visit my old article here.

There is an error in Webmin 1.410. It shows Apache2 server as being stopped. This is not the case as one can verify with ps afx | grep apache2. I will post a fix as soon as I found one.

Configuring VMware Server

In Kernel 2.6.23, a change was introduced that breaks vmware-server (a complete explanation can be found here):

Another solution is to get the vmware-any-any-patch116.tar.gz. I unpacked the tar and copied vmmon.tar and vmnet.tar into /usr/lib/vmware/modules/source.

vmware-config.pl configured the server (ignore the warnings, the server starts fine), and ran vmware-config-mui.pl.

Server is now up and running.

Sunday, 27 April 2008

UMTS Modem in Ubuntu 8.04

Dial up internet connections are easy to set up, one might think. I wanted to connect to my ISP using a PCMCIA UMTS card. Searching the internet I found three different approaches:
  1. use wvdial to set up a ppp connection
  2. use gnome-ppp to set up a ppp connection
  3. use a specific software (like umtsmon or vodaphone-mobile-link)that installs all required drivers
I run Ubuntu 64 on my notebook, so vodaphone does not work. There is an ancient x64 .deb package that refuses to install. The tar files don't compile due to missing twisted python modules. and finally (after installing twisted) it refused to start.

I found a much simpler solution: Gnomes network-manager.

network-manager allows you to configure 1 dial up connection. It requires some tweaking of a configuration file in order to reap the maximum speed from your modem but other than this, it is an easy solution without any bells and whistles.

Configuration of network manager
  1. Left click your network icon in the top right of your Gnome panel. Select "Manual configuration..."
  2. Unlock the dialog
  3. Select "Point to Point connection" and edit its "Properties" (this brings up a 3-tabbed dialog)
  4. On the General-Tab tag "Enable this connection" and adjust the connection type, access point name and account data.
  5. Change connection type to "serial modem" to enter the phone number. Change back to GPRS/UMTS. The phone number gets stored in the configuration file
  6. On the Modem-Tab type the modem port. In my case I hat to overwrite what was offered by the dialog ("/dev/ttyUSB0"). I found this information in the gnome-device-manager.
  7. The Options-Tab allows to set the modem to provide the default route (which is helpful on the road) and to accept the DNS servers from your provider. I did not select "Retry if the ..." reconnect option here, but rather in the configuration file (as this sets it to retry permanently)
  8. OK and close the configuration dialog and you are done.
Insert the card, left click the network icon in the panel. You can "Dial Up Connections>/Connect to ppp0 via Modem...". It takes a few seconds, then the connect is made.

There is not much of an indication as the line being up. On my modem, the LED is on permanently. Network-manager does not change its icon to reflect connection status.

Configuration myths and files

There are lots of rumors out. Here is what I found out:
  • wvdial and other command line tools use /etc/wvdial.conf to configure dialup connection.
  • gnome-ppp and network manager use ~/.wvdial.conf (in your home directory)
Both files use similar syntax but Gnome does not read /etc/wvdial.conf or setup configuration in /etc/ppp...

Here is my .wvdial.conf:
[Dialer Defaults]
Modem = /dev/ttyUSB0
ISDN = off
Modem Type = USB Modem
Baud = 460800
Init = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Init3 = at+cgdcont=1,"IP","mynetwork"
Init4 =
Init5 =
Init6 =
Init7 =
Init8 =
Init9 =
Phone = telefonnumber_from_provider
Phone1 =
Phone2 =
Phone3 =
Phone4 =
Dial Prefix =
Dial Attempts = 1
Dial Command = ATM1L1DT
Ask Password = off
Password = mypassword
Username = myusername@mynetwork.domain
Auto Reconnect = off
Abort on Busy = off
Carrier Check = on
Check Def Route = on
Abort on No Dialtone = on
Stupid Mode = off
Idle Seconds = 180
Auto DNS = on
;Minimize = off
;Dock = on
;Do NOT edit this file by hand!
Despite the last line, the file can be edited by hand. network-manager honors changes in the file. I changed Baud from 57600 to 460800. This provides significant increase in performance.

VMware 6.03 on Ubuntu 8.04 compile error

After upgrading Ubuntu to 8.04, I ran into an error reconfiguring VMware with vmware-config.pl:
include/asm/bitops_32.h:9:2: error: #error only can be included directly, and vmmon-only compile failes
I found a helpful blog describing 10 easy steps to fix the problem. Here is the list of steps (security issues corrected)
  1. cd /usr/lib/vmware/modules/source
  2. cp vmmon.tar vmmon.tar.orig
  3. sudo tar xvf vmmon.tar
  4. cd vmmon-only/include/
  5. sudo vi vcpuset.h
  6. change line 74 from: #include “asm/bitops.h” to: #include “linux/bitops.h”
  7. rm vmmon.tar
  8. sudo tar cvf vmmon.tar vmmon-only/
  9. sudo rm -rf vmmon-only/
  10. sudo vmware-config.pl
After this, I could start VMware. Robert, thank you.

Saturday, 26 April 2008

VMware Server console in 8.04

After upgrading Ubuntu 7.10 to 8.04 my VMware Server console would not start:
wolf@wb:~$ vmware-server-console
/usr/lib/vmware-server-console/bin/vmware-server-console: /usr/lib/vmware-server-console/lib/libgcc_s.so.1/libgcc_s.so.1: version `GCC_3.4' not found (required by /usr/lib32/libcairo.so.2)
/usr/lib/vmware-server-console/bin/vmware-server-console: /usr/lib/vmware-server-console/lib/libgcc_s.so.1/libgcc_s.so.1: version `GCC_4.2.0' not found (required by /usr/lib32/libstdc++.so.6)
/usr/lib/vmware-server-console/bin/vmware-server-console: /usr/lib/vmware-server-console/lib/libgcc_s.so.1/libgcc_s.so.1: version `GCC_3.4' not found (required by /usr/lib32/libcairo.so.2)
/usr/lib/vmware-server-console/bin/vmware-server-console: /usr/lib/vmware-server-console/lib/libgcc_s.so.1/libgcc_s.so.1: version `GCC_4.2.0' not found (required by /usr/lib32/libstdc++.so.6)
/usr/lib/vmware-server-console/bin/vmware-server-console: /usr/lib/vmware-server-console/lib/libgcc_s.so.1/libgcc_s.so.1: version `GCC_3.4' not found (required by /usr/lib32/libcairo.so.2)
/usr/lib/vmware-server-console/bin/vmware-server-console: /usr/lib/vmware-server-console/lib/libgcc_s.so.1/libgcc_s.so.1: version `GCC_4.2.0' not found (required by /usr/lib32/libstdc++.so.6)
I found a helpful link here. The resolution would not work for me (as you can see in the error messages above. However, removing the library libgcc_s.so.1 did the trick.
root@wb:/usr/lib/vmware-server-console/lib/libgcc_s.so.1# mv libgcc_s.so.1 libgcc_s.so.1_orig
Now the console works fine.

Sunday, 30 March 2008

Drupal 5.2 on Ubuntu 7.10 with Postgresql backend

Installing Drupal 5.2 on Ubuntu 7.10 with Postgresql requires several steps.
  1. Install php_pgsql (the required files are not installed after selection of the database
  2. Manually create a database user and a database:
    createuser -D -A -P drupal5
    createdb -O drupal5 drupal5
    Using the automated setup scripts creates a database that is not owned by the drupal user. Later, the installation process will not be able to create the required tables. It seems that dbconfig-common has its trouble handling postgresql databases.
  3. Install drupal using
    apt-get install drupal5
    Choose to set up the database manually. The dialog is likely to frighten you away, but you have already done everything necessary.
  4. Change the ownership of the data files. The script changes /var/lib/drupal5 to www-data (with is what Apache needs to read files). However, the files are in /usr/lib/drupal5. As they are still owned by root -> Error messages.
    chown -R www-data:www-data /usr/lib/drupal5
    does the trick.
  5. In /etc/postgresql/8.x/main/pg_hba.conf add a line:
    host drupal5 drupal5 127.0.0.1 255.255.255.255 password
    allows drupal to access the local database.
  6. Restart Apache and Postgresql
  7. In a browser query the server:
    http://server/drupal5
    You should see the Drupal logon screen.
  8. Create an administrative user
As easy as this list of actions sounds and as clear it seem now what one has to do, it was hard to figure out from all the error messages where the problem lay.

There is a helpful link in the Ubuntu forum. It helped me understand what was going on durign the installation process.

Error in OpenOffice DicOOo wizard

The dictionary installation wizard of OpenOffice 2.3 is not working correctly. You can start it, start DicOOo macro and download language specific dictionaries, thesauruses and hyphenation module. However, after launching OpenOffice again, spellchecking is still missing.

What's wrong?

Apt-get installs OpenOffice with a set of language packs. If one wants to install more language packs, OpenOffice offers a wizard to install them. I need some extra language packs for my work:
de_AT
de_DE
fr_FR
There are two officially announced methods to install:
  1. Use the wizard as root will install additional dictionaries into the /usr/lib/openoffice branch of the file system (I didn't try this, so I don't know whether it works)
  2. Use the wizard as user to install into the local home directory (I tried this and it definately did not work)
If you use local installation, all files fo into ~/.openoffice/user/wordbook directory. All files get copied. A special file - dictionary.lst - contains a list of installed language packs. You can install spell checking, hyphenation and thesauruses seperately (or exclude them by editing dictionary.lst)

In Windows installations local dictionaries get installed into a directory ...dict/ooo in the local application tree. It turns out that OpenOffice looks in ~/.openoffice/user/dict/ooo for additional language packs.

A better solution

Installing something into a directory which is not maintained by the installation scripts of the distribution may backfire later. If you want to give a user a specific language pack, installing into ~/.openoffice/user/dict/ooo is the only working solution.

If you want to install language packs globally, there is a better solution: Install the myspell localized languages.
This will not only install spellchecking, hyphenation and thesaurus for OpenOffice but will provide the same functionality for Mozilla Firefox and Thunderbird.

Preferable.

Friday, 21 March 2008

Adding Spamassassin to Postfix

Adding spam protection to Postfix, I installed Spamassassin. The Postfix web documentation describes installing Amavis as this also provides virus protection. I kept it simple by just using Spamassassin as a post queue filter.

First install the package:
sudo apt-get install spamassassin spamc
(You will need the spamassassin client later).

By default, Spamassassin logs into syslog. So you do not need to modify /etc/spamassassin/local.cf. You do need to enable Spamassassin by enabling launching the spamd daemon. Modify /etc/default/spamassassin by setting:
ENABLED=1
This will do the trick.

Finally you need to modify /etc/postfix/master.cf. Edit the line:
smtp inet n - - - - smtpd
to
smtp inet n - - - - smtpd -o content_filter=spamassassin
and add:
spamassassin unix - n n - - pipe
user=nobody argv=/usr/bin/spamc -f -e
/usr/sbin/sendmail -oi -f ${sender} ${recipient}
to the end of the file (you have to indent line 2 and 3 in order to maintain the logic of filters). You also might find these lines in different forums. They suggest creating a new user account "spamd". I was reluctant to do this as it roadens the attack surface to the server. Starting Spamassassin with user nobody works perfectly fine.

Start Spamassassin and restart Postfix and there you are.