Category Archives: Ubuntu

Adding a Samba user

Post migrated from my old site:

Samba can be used to share folders with Windows systems.

To add a user to Samba, use

smbpasswd -a <username>

Setting up an encrypted RAID 5 on Ubuntu 10.10

Post migrated from my old site:

Recently I started on configuring an encrypted RAID 5 on Ubuntu 10.10 Server. These were the steps I took:

First, install the required packages:

sudo apt-get install mdadm gddrescue cryptsetup lvm2

I used fdisk to partition each disk as a “Linux raid autodetect” partition.

sudo fdisk /dev/sdb

for each device (in my case /dev/sdb /dev/sdc /dev/sdd and /dev/sde). First use option “n” to add a partition, option “t”to change it to type “fd” and “w” to write the changes to disk.

Next step is to create the RAID5 device:

sudo mdadm /dev/md0 --create -n 4 -l 5 -z 244198584 -c 256 /dev/sd{b..e}1

244198584 is the number of kilobyte of a single disk obtained with:

sudo hdparm -I /dev/sdb

Once it has been created, check its status by

sudo cat /proc/mdstat

and

sudo mdadm --detail /dev/md0

Wait until the status reports that the RAID has been fully build.

Next step is to create a physical volume by:

sudo pvcreate /dev/md0

To create a volume group, use:

sudo vgcreate rawlargevg /dev/md0

To create a logical volume, use:

sudo lvcreate -n rawsharelv -L 732585984k rawlargevg

Obtain the size by using:

sudo vgs --units k

To randomize the disk content use:

sudo ddrescue /dev/urandom /dev/rawlargevg/rawsharelv urandomminglog

This might take a long time, after it is done, start setting up the encrypted volume:

sudo cryptsetup -c aes-cbc-essiv:sha256 -y -s 256 luksFormat /dev/rawlargevg/rawsharelv

Next step is to open it:

sudo cryptsetup luksOpen /dev/rawlargevg/rawsharelv encsharedev

And format it:

sudo mkfs.ext4 -m 0 /dev/mapper/encsharedev

After it is done formatting, create a mounting directory:

sudo mkdir /srv/raid

Now edit the /etc/crypttab file to include:

encsharedev /dev/rawlargevg/rawsharelv none luks

And edit /etc/fstab to include:

/dev/mapper/encsharedev /srv/raid ext4 rw 0 0

Reboot and done you are with setting up your encrypted RAID.

References to pages I used:

User and group Apache is running under Ubuntu 10.10

Post migrated from my old site:

To find out the user and group Apache is running under Ubuntu 10.10, look at:

/etc/apache2/envvars

Look at the lines:

export APACHE_RUN_USER
export APACHE_RUN_GROUP

by default it is www-data.

Installing SugarCRM 6.0.3 on Ubuntu 10.10 Server

Post migrated from my old site:

I have been trying to set up SugarCRM 6.0.3 on a Ubuntu 10.10 VM.

This link has been very helpful:
http://g00t.com/?p=358

Another useful link is:
http://www.howtoforge.com/installing-sugarcrm-community-edition-on-ubuntu-8.10

Canon i-Sensys MF8030Cn on Ubuntu 10.10

Post migrated from my old site:

Driver for Linux can be found here: http://software.canon-europe.com/software/0040355.asp?model=

Some more help might be found here: https://help.ubuntu.com/community/CanonCaptDrv190

Postfix on KPN Direct ADSL

Hi,

I had a lot of trouble setting up Postfix so that it would relay my mail (sending only). I am using KPN Direct ADSL and have documented some tricks here for Ubuntu 12.10.

KPN’s support answer is somewhat useful but not that much:
http://kpn-customer.custhelp.com/app/answers/detail/a_id/13372

The three different addresses they are mentioning for the relayhost, confused me a lot. The right relayhost to use is: mail.kpnmail.nl.

My /etc/postfix/main.cf looks like this:

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
append_dot_mydomain = no
readme_directory = no
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
myhostname = <hostname>
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = <externaldomain>, <hostname>, localhost
relayhost = [mail.kpnmail.nl]
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = loopback-only
default_transport = relay
relay_transport = relay
inet_protocols = all
sender_canonical_maps=hash:/etc/postfix/sender_canonical

Please make sure that you replace <hostname> and <externaldomain> with your machine’s hostname and external domain URL.

The last I found with http://www.whatismyip.com/ to get my external ip address and to get your external domain URL:

host <ip-address>

Notice that I had to change the default_transport and relay_transport to error to:

default_transport = relay
relay_transport = relay

The other thing I had to do is to set the following to change rewrite the from field as KPN does not accept the <user>@<hostname> that your Ubuntu machine provides:

sender_canonical_maps=hash:/etc/postfix/sender_canonical

To set up your sender_canonical file, follow these instructions:
http://ubuntuforums.org/archive/index.php/t-38429.html

Useful background information can be found here:
http://www.postfix.org/

Spotify on Precise Pangolin (Ubuntu 12.04LTS)

Good instructions to install Spotify using apt-get on Ubuntu 12.04LTS Precise Pangolin can be found here:
http://www.liberiangeek.net/2012/04/the-quickest-way-to-install-spotify-client-in-ubuntu-12-04-precise-pangolin/

If you get an error about invalid keys, the solution is here (post by dubbe):
http://community.spotify.com/t5/Desktop-Linux/Can-t-Open-Spotify/td-p/89529

Have fun.

Regards,
Jeroen

Postfix malfunctioning on Ubuntu 11.10

In case Postfix is complaining about /etc/postfix/main.cf missing in your Ubuntu 11.10 Oneiric Ocelot too, follow this link for the solution:

http://ubuntuforums.org/showthread.php?p=9348088

Ubuntu 11.10 (Oneiric Ocelot): PHP dynamic library problem

Hi,

I noticed that my Ubuntu 11.10 Oneiric Ocelot machine was complaining about:

$ php -v
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626/idn.so' - /usr/lib/php5/20090626/idn.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626/sqlite.so' - /usr/lib/php5/20090626/sqlite.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP 5.3.6-13ubuntu3.6 with Suhosin-Patch (cli) (built: Feb 11 2012 03:26:01) 
Copyright (c) 1997-2011 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies

To resolve this issue, take a look at this thread. It works:
http://ubuntuforums.org/showthread.php?t=1610097

http://ubuntuforums.org/showthread.php?t=1610097

Password less login on Linux

Instructions for password less authentication on Linux can be found here:

http://www.cyberciti.biz/faq/ssh-password-less-login-with-dsa-publickey-authentication/