The Perfect Server - Mandriva 2009.0 Free (i386) - 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 'Main Updates' ''

urpmi.addmedia 'Contrib 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 25980
-rw-r--r-- 1 root root     9791 2008-10-09 17:14 compssUsers.flat
drwxr-xr-x 2 root root     4096 2008-10-09 15:32 Contrib/
drwxr-xr-x 2 root root     4096 2008-10-09 15:32 Contrib Updates/
-rw-r--r-- 1 root root  3519063 2008-10-09 17:05 hdlist.Mandriva Linux - 2009.0 (Free) - Installer (contrib).cz
-rw-r--r-- 1 root root 22476876 2008-10-09 17:05 hdlist.Mandriva Linux - 2009.0 (Free) -
drwxr-xr-x 2 root root     4096 2008-10-09 15:32 Main/
drwxr-xr-x 2 root root     4096 2008-10-09 15:32 Main Updates/
-rw-r--r-- 1 root root        0 2008-10-09 17:14 MD5SUM
-rw-r--r-- 1 root root    50592 2008-10-09 17:14 names.Mandriva Linux - 2009.0 (Free) - Installer
-rw-r--r-- 1 root root     9805 2008-10-09 17:14 names.Mandriva Linux - 2009.0 (Free) - Installer (contrib)
-rw-r--r-- 1 root root    60938 2008-10-09 17:05 synthesis.hdlist.Mandriva Linux - 2009.0 (Free) - Installer (contrib).cz
-rw-r--r-- 1 root root   398380 2008-10-09 17:05 synthesis.hdlist.Mandriva Linux - 2009.0 (Free) -
[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 (Free) - Installer"
urpmi.removemedia "Mandriva Linux - 2009.0 (Free) - Installer (contrib)"

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 libxorg-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=b258edec-9613-11dd-99c4-457f04a19dca / ext3 relatime,usrquota,grpquota 1 1
# Entry for /dev/sda1 :
UUID=b6fa1e84-9613-11dd-84e1-bf4bbb042d23 /boot ext3 relatime 1 2
/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=b748b6b6-9613-11dd-844e-fba510a12ad6 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:

8 Comment(s)

Add comment


From: william at: 2009-05-03 13:07:12

hi can this set up be done with a dynamic ip as my isp don't do static ips

i am new to trying to host my own stuff

any help or info please thanks william

From: FACORAT Fabrice at: 2008-10-17 12:20:48

1. to add a media, you can do it easily with 1 line, without the need to use easyurpmi :

 urpmi.addmedia --distrib --mirrorlist

This command will automatically add all the remote FTP repositories, and will try to select the closest mirror for you. So if you want to only have remote repositories and removed the installation media, you'd better remove all the media/repositories, and then add the new ones :

 urpmi.removemedia -a && urpmi.addmedia --distrib --mirrorlist

2. if you want to do automatic updates, but only install packages from the updates repositories, you can now use --auto-update which will do at the same time a "urpmi.update -a" and a "urpmi --auto-select". So you auto-update script could look like this :

urpmi --auto-update --update  --auto

From: Hoyt at: 2009-03-02 18:57:08

I use a script that also includes the "--wait-lock" option so that the script will wait if another instance of urpmi happens to be running and has locked the database.

From: FACORAT Fabrice at: 2008-10-17 12:35:58

1. renaming the dovecot startup number will not fix dovecot ordering start. Indeed, Mandriva is using prcsys to start services in parallel based on the LSB tags explaining the service dependency : it doesn't use the service number.

So the proper fix to make dovecot be started after ntpd is to add a soft dependency of dovecot on ntpd by adding the following line in the header of the dovecot init file :

Should-Start: ntpd

2. I opened a bug report on Mandriva bugzilla, so maybe in a future update, this issue will be solved and you will no longer need to fix this manually :


From: Eagle at: 2009-02-18 00:44:43

mysql-devel is also needed for succesfuly instalation. Don't forget.

From: boyfren at: 2009-06-30 01:56:57

When I tried this code: urpmi cyrus-sasl libsasl2 libsasl2-devel libsasl2-plug-plain libsasl2-plug-anonymous libsasl2-plug-crammd5 libsasl2-plug-digestmd5 libsasl2-plug-gssapi libsasl2-plug-login postfix dovecot Most of them are not available on the media. How do I directly installl these from online repository?

From: FACORAT Fabrice at: 2008-10-17 12:47:08

1. Since at least Mandriva  2008.1 , there's a metapackage named task-lamp-php which will install most apache+php+mysql packages

urpmi task-lamp-php

Here is the list of packages installed by task-lamp :















2. installing  php-imagick is enough to install imagemagick package ( which no longer have capital letters ).

From: casjay at: 2009-01-04 05:48:38

There is a webalizer rpm package available at