The Perfect Server - Mandriva 2009.0 Free (x86_64) - Page 4

4 Adjust /etc/hosts

Next we edit /etc/hosts. Make it look like this:

vi /etc/hosts               localhost.localdomain localhost  server1


5 Setting The Hostname

(This step is optional.)

This is not necessary if you have set the correct hostname during the installation. You can check the current hostname with the commands

hostname -f

Both commands should show

If the output shows a wrong hostname, you can set the correct one like this:

echo > /etc/hostname
/bin/hostname -F /etc/hostname


6 Configure urpmi

You can use the wizard on to find out how to configure urpmi so that urpmi uses online package repositories:

(When I wrote this tutorial, Mandriva 2009.0 was not yet available in the wizard, so I chose 2008.1 and then replaced 2008.1 with 2009.0 in the urpmi commands. You can do the same, but the wizard should be up-to-date in a few days.)

For me the wizard gave back these commands that I run on the command line:

urpmi.addmedia 'Main' ''

urpmi.addmedia 'Contrib' ''

urpmi.addmedia 'Main32' ''

urpmi.addmedia 'Main Updates' ''

urpmi.addmedia 'Contrib Updates' ''

urpmi.addmedia 'Main32 Updates' ''


6.1 Disable The Installation Media

Disabling the installation media is particularly useful if your server will be in a remote location where you cannot insert the DVD/CDs. To disable the installation media (the Mandriva DVD or the CDs), we must first find out their internal names. We can do this by running

ls -l /var/lib/urpmi/

[root@server1 ~]# ls -l /var/lib/urpmi/
total 25616
-rw-r--r-- 1 root root     9858 2008-10-10 17:49 compssUsers.flat
drwxr-xr-x 2 root root     4096 2008-10-10 16:11 Contrib/
drwxr-xr-x 2 root root     4096 2008-10-10 16:07 Contrib Updates/
-rw-r--r-- 1 root root  3496995 2008-10-10 17:42 hdlist.Mandriva Linux - 2009.0 (Free64) - Installer (contrib).cz
-rw-r--r-- 1 root root 22071087 2008-10-10 17:42 hdlist.Mandriva Linux - 2009.0 (Free64) -
-rw-r--r-- 1 root root    46094 2008-10-10 17:42 hdlist.Mandriva Linux - 2009.0 (Free64) - Installer (main32).cz
drwxr-xr-x 2 root root     4096 2008-10-10 16:11 Main/
drwxr-xr-x 2 root root     4096 2008-10-10 16:13 Main32/
drwxr-xr-x 2 root root     4096 2008-10-10 16:13 Main32 Updates/
drwxr-xr-x 2 root root     4096 2008-10-10 16:07 Main Updates/
-rw-r--r-- 1 root root        0 2008-10-10 17:49 MD5SUM
-rw-r--r-- 1 root root    52072 2008-10-10 17:49 names.Mandriva Linux - 2009.0 (Free64) - Installer
-rw-r--r-- 1 root root     9452 2008-10-10 17:49 names.Mandriva Linux - 2009.0 (Free64) - Installer (contrib)
-rw-r--r-- 1 root root      225 2008-10-10 17:49 names.Mandriva Linux - 2009.0 (Free64) - Installer (main32)
-rw-r--r-- 1 root root    61281 2008-10-10 17:42 synthesis.hdlist.Mandriva Linux - 2009.0 (Free64) - Installer (contrib).cz
-rw-r--r-- 1 root root   389816 2008-10-10 17:42 synthesis.hdlist.Mandriva Linux - 2009.0 (Free64) -
-rw-r--r-- 1 root root     2238 2008-10-10 17:42 synthesis.hdlist.Mandriva Linux - 2009.0 (Free64) - Installer (main32).cz
[root@server1 ~]#

You can take the correct names from the names.* entries. So to disable the Mandriva 2009 DVD, I run

urpmi.removemedia "Mandriva Linux - 2009.0 (Free64) - Installer"
urpmi.removemedia "Mandriva Linux - 2009.0 (Free64) - Installer (contrib)"
urpmi.removemedia "Mandriva Linux - 2009.0 (Free64) - Installer (main32)"

For the CDs, the command will be slightly different - just take a look at the names.* entries on your system.


6.2 Creating An Auto-Update Script

Now we create a script /etc/cron.daily/software_update that will autmatically be run by cron daily and looks for and installs the latest software updates on your Mandriva 2009.0 system. The script looks like this:

vi /etc/cron.daily/software_update

urpmi.update updates
urpmi --auto --update --auto-select

Make the script executable:

chmod 755 /etc/cron.daily/software_update


7 Install Some Packages

Now we install a few packages that are needed later on:

urpmi fetchmail wget bzip2 unzip zip nmap openssl lynx fileutils ncftp flex lib64xorg-x11-devel gcc gcc-c++


8 Quota

To install the quota package, run

urpmi quota

Edit /etc/fstab to look like this (I added ,usrquota,grpquota to the partition with the mount point /):

vi /etc/fstab

# Entry for /dev/sda6 :
UUID=fcf473ac-96e1-11dd-925e-bd3c361d7fff / ext3 relatime,usrquota,grpquota 1 1
# Entry for /dev/sda1 :
UUID=01d7ebd8-96e2-11dd-9d07-87e54e82565e /boot ext3 relatime 1 2
/dev/cdrom /media/cdrom auto umask=0,users,iocharset=utf8,noauto,ro,exec 0 0
/dev/fd0 /media/floppy auto umask=0,users,iocharset=utf8,noauto,exec,flush 0 0
none /proc proc defaults 0 0
# Entry for /dev/sda5 :
UUID=0220c38a-96e2-11dd-af75-abce5298666d swap swap defaults 0 0

Then run:

touch /aquota.user /
chmod 600 /aquota.*
mount -o remount /
quotacheck -avugm
quotaon -avug


9 DNS Server

To install the BIND DNS server, run:

urpmi bind

Mandriva 2009.0's BIND is running chrooted by default, therefore we need to create a few symlinks so that ISPConfig (if you want to install it) can deal with it:

cd /var/lib/named/var
mkdir -p lib/named/var
cd lib/named/var
ln -s ../../../named/ named
ln -s ../../../run/ run
cp /var/lib/named/var/named/reverse/named.local /var/lib/named/var/named/

Next we create the system startup links for BIND...

chkconfig named on

... and start it:

/etc/init.d/named start

Share this page:

3 Comment(s)

Add comment


From: Buchan Milne at: 2008-10-21 06:51:05

1)For a server install, the dual arch mini CD may be better (less to download, more of which you will use).

 2)I would recommend using LVM (available in the partitioning tool in the installer.

 3)You could add the network media during installation, instead of afterwards. The installer will get a list of mirrors for you.

4)Mandriva does not use /etc/hostname, but rather the HOSTNAME setting in /etc/sysconfig/network.

 5)Easyurpmi is no longer a necessity, you can use 'urpmi.addmedia --distrib --mirrorlist'.

6)Why not use 'urpmq --list-media' to list the installation media? Also, you could remove the installation media first (with 'urpmi.removemedia -a'), then add the network media. Much easier.

7)Updating can be done with one command, 'urpmi --auto-update'.

8)lib64sasl2-devel should not be required

9)To get ntpd to start before dovecot, you need to let the dependency-based init know that, so you should add ntpd to the Should-Start LSB tag in the dovecot init script. You could consider filing a bug on this (against the dovecot package).

10)You could consider installing the task-lamp package instead of all the separate packages. Or, I need to get around to packaging ISPConfig (though I don't like the architecture entirely).

11)"Mandriva 2009.0 doesn't come with a Webalizer package anymore, therefore we build the Webalizer binary like this" is not entirely correct. Mandriva has switched to a fork of webalizer, called awffull. 'urpmi webalizer' would have pulled it in for you:

 # urpmi webalizer
To satisfy dependencies, the following packages are going to be installed:
   Package                        Version      Release       Arch
(medium "Contrib (telkomsa-11)")
  awffull                        3.8.2        4mdv2009.0    x86_64
  geoip                          1.4.4        3mdv2009.0    x86_64
  lib64geoip1                    1.4.4        3mdv2009.0    x86_64
  lib64geoipupdate0              1.4.4        3mdv2009.0    x86_64
2.4MB of additional disk space will be used.
893KB of packages will be retrieved.
Proceed with the installation of the 4 packages? (Y/n)


From: admin at: 2008-11-01 23:25:19

You can simply send an email to a new email account, and the Maildir gets created automatically. :-)

From: Per Crusefalk at: 2008-11-01 23:00:19

Thank you for an interesting article!

I followed this howto but had trouble with maildir, postfix would not create the maildir and apparently it should not do so either (it does not create ~/Maildir).

To get maildir (and email) working I:

mkdir ~user/Maildir
mkdir ~user/Maildir/new ~user/Maildir/tmp  ~user/Maildir/cur
chown -R user:mail ~user/Maildir
chmod -R 770 ~user/Maildir

You could use maildirmake instead ("urpmi maildrop" to get that).