The Perfect Server - Mandriva 2008 Spring Free (Mandriva 2008.1) - Page 4

Want to support HowtoForge? Become a subscriber!
 
Submitted by falko (Contact Author) (Forums) on Wed, 2008-04-09 20:18. ::

4 Adjust /etc/hosts

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

vi /etc/hosts

127.0.0.1               localhost.localdomain localhost
192.168.0.100           server1.example.com 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
hostname -f

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
/bin/hostname -F /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:

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

urpmi.addmedia contrib ftp://distrib-coffee.ipsl.jussieu.fr/pub/linux/MandrivaLinux/official/2008.1/i586/media/contrib/release with media_info/hdlist.cz

urpmi.addmedia --update contrib_updates ftp://distrib-coffee.ipsl.jussieu.fr/pub/linux/MandrivaLinux/official/2008.1/i586/media/contrib/updates with media_info/hdlist.cz

urpmi.addmedia main ftp://distrib-coffee.ipsl.jussieu.fr/pub/linux/MandrivaLinux/official/2008.1/i586/media/main/release with media_info/hdlist.cz

urpmi.addmedia --update main_updates ftp://distrib-coffee.ipsl.jussieu.fr/pub/linux/MandrivaLinux/official/2008.1/i586/media/main/updates with media_info/hdlist.cz

 

6.1 Disable The Installation CDs

(This applies only if you're using the three Mandriva 2008.1 installation CDs, not the DVD!)

To disable the Mandriva 2008.1 CDs as a package repository, we run

urpmi.removemedia "Mandriva Linux - 2008.1 (Free) - i586 CD1"
urpmi.removemedia "Mandriva Linux - 2008.1 (Free) - i586 CD2"
urpmi.removemedia "Mandriva Linux - 2008.1 (Free) - i586 CD3"

(This is particularly useful if your server will be in a remote location where you cannot insert the CDs.)

 

6.2 Disable The Installation DVD

(This applies only if you're using the Mandriva 2008.1 installation DVD, not the three CDs!)

I haven't tested this as I'm using the CDs, not the DVD, but for the DVD the command should be as follows:

urpmi.removemedia "Mandriva Linux - 2008.1 (Free) - Installer"
urpmi.removemedia "Mandriva Linux - 2008.1 (Free) - Installer (contrib)"

You can find out the correct names of the media by running:

ls -l /var/lib/urpmi/

[root@server1 ~]# ls -l /var/lib/urpmi/
total 15272
-rw-r--r-- 1 root root    7978 2008-04-09 14:57 compssUsers.flat
-rw-r--r-- 1 root root 5915550 2008-04-09 14:32 hdlist.Mandriva Linux - 2008.1 (Free) - i586 CD1.cz
-rw-r--r-- 1 root root 2620444 2008-04-09 14:32 hdlist.Mandriva Linux - 2008.1 (Free) - i586 CD2.cz
-rw-r--r-- 1 root root 4792018 2008-04-09 14:32 hdlist.Mandriva Linux - 2008.1 (Free) - i586 CD3.cz
-rw-r--r-- 1 root root       0 2008-04-09 14:57 MD5SUM
-rw-r--r-- 1 root root     248 2008-04-09 13:26 MD5SUM.contrib
-rw-r--r-- 1 root root     248 2008-04-09 13:27 MD5SUM.contrib_updates
-rw-r--r-- 1 root root     248 2008-04-09 13:28 MD5SUM.main
-rw-r--r-- 1 root root     248 2008-04-09 13:28 MD5SUM.main_updates
-rw-r--r-- 1 root root   14164 2008-04-09 14:57 names.Mandriva Linux - 2008.1 (Free) - i586 CD1
-rw-r--r-- 1 root root    4468 2008-04-09 14:57 names.Mandriva Linux - 2008.1 (Free) - i586 CD2
-rw-r--r-- 1 root root   11198 2008-04-09 14:57 names.Mandriva Linux - 2008.1 (Free) - i586 CD3
-rw-r--r-- 1 root root 1259740 2008-04-09 13:27 synthesis.hdlist.contrib.cz
-rw-r--r-- 1 root root      20 2008-04-09 13:27 synthesis.hdlist.contrib_updates.cz
-rw-r--r-- 1 root root  652572 2008-04-09 13:28 synthesis.hdlist.main.cz
-rw-r--r-- 1 root root      20 2008-04-09 13:28 synthesis.hdlist.main_updates.cz
-rw-r--r-- 1 root root  136341 2008-04-09 14:32 synthesis.hdlist.Mandriva Linux - 2008.1 (Free) - i586 CD1.cz
-rw-r--r-- 1 root root   55315 2008-04-09 14:32 synthesis.hdlist.Mandriva Linux - 2008.1 (Free) - i586 CD2.cz
-rw-r--r-- 1 root root   70082 2008-04-09 14:32 synthesis.hdlist.Mandriva Linux - 2008.1 (Free) - i586 CD3.cz
[root@server1 ~]#

You can take the correct names from the names.* entries.

 

6.3 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 2008.1 system. The script looks like this:

vi /etc/cron.daily/software_update

#!/bin/bash
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=8e7f6bd0-0630-11dd-bcc1-6787ae22ef91 / ext3 relatime,usrquota,grpquota 1 1
# Entry for /dev/sda1 :
UUID=a0de6628-0630-11dd-91a9-5d76fb80ffee /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=a21dfc56-0630-11dd-a951-df43bffad1b6 swap swap defaults 0 0

Then run:

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

 

9 DNS Server

To install the BIND DNS server, run:

urpmi bind

Mandriva 2008.1'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


Please do not use the comment function to ask for help! If you need help, please use our forum.
Comments will be published after administrator approval.