The Perfect Server - Mandriva 2009.0 Free (i386) - Page 4
4 Adjust /etc/hosts
Next we edit /etc/hosts. Make it look like this:
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
Both commands should show server1.example.com.
If the output shows a wrong hostname, you can set the correct one like this:
echo server1.example.com > /etc/hostname
6 Configure urpmi
You can use the wizard on http://easyurpmi.zarb.org/ 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' 'http://ftp.free.fr/mirrors/ftp.mandriva.com/MandrivaLinux/official/2009.0/i586/media/main/release'
urpmi.addmedia 'Contrib' 'http://ftp.free.fr/mirrors/ftp.mandriva.com/MandrivaLinux/official/2009.0/i586/media/contrib/release'
urpmi.addmedia 'Main Updates' 'http://ftp.free.fr/mirrors/ftp.mandriva.com/MandrivaLinux/official/2009.0/i586/media/main/updates'
urpmi.addmedia 'Contrib Updates' 'http://ftp.free.fr/mirrors/ftp.mandriva.com/MandrivaLinux/official/2009.0/i586/media/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/
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"
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:
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++
To install the quota package, run
Edit /etc/fstab to look like this (I added ,usrquota,grpquota to the partition with the mount point /):
touch /aquota.user /aquota.group
9 DNS Server
To install the BIND DNS server, run:
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:
Next we create the system startup links for BIND...
chkconfig named on
... and start it: