The Perfect Server - Mandriva 2010.0 Free (x86_64) [ISPConfig 2] - Page 4

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

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

To have the system set the correct hostname whenever you boot the system, we add the last command to /etc/rc.local:

vi /etc/rc.local

[...]
/bin/hostname -F /etc/hostname

 

 

6 Configure urpmi

By default, Mandriva 2010.0 uses the installation DVD as its only software repository which is inconvenient if the server is in a remote location. Therefore we disable the DVD and enable the Mandriva online repositories:

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

 

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

vi /etc/cron.daily/software_update

#!/bin/bash
urpmi --auto-update --update  --auto

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 Journaled Quota

To install the quota package, run

urpmi quota

Edit /etc/fstab to look like this (I added ,usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0 to the partition with the mount point /):

vi /etc/fstab

# Entry for /dev/sda6 :
UUID=5655e2e6-9865-41be-aafb-ef9111b7b6f9 / ext4 relatime,usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0 1 1
# Entry for /dev/sda1 :
UUID=93aca769-d885-4694-a1c6-1df246caa426 /boot ext4 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=5751d7b7-9d7a-48bf-aedb-48a9bda0a308 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 2010.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

Falko Timme

About Falko Timme

Falko Timme is an experienced Linux administrator and founder of Timme Hosting, a leading nginx business hosting company in Germany. He is one of the most active authors on HowtoForge since 2005 and one of the core developers of ISPConfig since 2000. He has also contributed to the O'Reilly book "Linux System Administration".

Share this page:

Suggested articles

0 Comment(s)

Add comment