The Perfect Setup - Mandriva 2007 Free Edition - 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 Configure Additional IP Addresses

(This step is totally optional and is needed only if you want to add more IP addresses to your network interface eth0!)

Let's assume our network interface is eth0. Then there is a file /etc/sysconfig/network-scripts/ifcfg-eth0 which looks like this:

vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=static
IPADDR=192.168.0.100
NETMASK=255.255.255.0
GATEWAY=192.168.0.1
ONBOOT=yes
METRIC=10
MII_NOT_SUPPORTED=no
USERCTL=no
MS_DNS1=145.253.2.75
MS_DNS2=193.174.32.18
RESOLV_MODS=yes
IPV6INIT=no
IPV6TO4INIT=no

Now we want to create the virtual interface eth0:0 with the IP address 192.168.0.101. All we have to do is to create the file /etc/sysconfig/network-scripts/ifcfg-eth0:0 which looks like this:

vi /etc/sysconfig/network-scripts/ifcfg-eth0:0
DEVICE=eth0:0
BOOTPROTO=static
IPADDR=192.168.0.101
NETMASK=255.255.255.0
GATEWAY=192.168.0.1
ONBOOT=yes
METRIC=10
MII_NOT_SUPPORTED=no
USERCTL=no
MS_DNS1=145.253.2.75
MS_DNS2=193.174.32.18
RESOLV_MODS=yes
IPV6INIT=no
IPV6TO4INIT=no

Afterwards we have to restart the network:

/etc/init.d/network restart

You might also want to adjust /etc/hosts after you have added new IP addresses, although this is not necessary.

 

6 Setting The Hostname

(This step is also 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

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

 

7 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 main ftp://ftp.proxad.net/pub/Distributions_Linux/MandrivaLinux/devel/2007.0/i586/media/main/release with media_info/hdlist.cz
urpmi.addmedia contrib ftp://ftp.proxad.net/pub/Distributions_Linux/MandrivaLinux/devel/2007.0/i586/media/contrib/release with media_info/hdlist.cz

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 2007 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

 

8 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++

 

9 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
/dev/sda6 / ext3 defaults,usrquota,grpquota 1 1
/dev/sda1 /boot ext3 defaults 1 2
/dev/hdc /mnt/cdrom auto umask=0,users,iocharset=utf8,noauto,ro,exec 0 0
none /mnt/floppy supermount dev=/dev/fd0,fs=ext2:vfat,--,umask=0,iocharset=utf8,sync 0 0
none /proc proc defaults 0 0
/dev/sda5 swap swap defaults 0 0

Then run:

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

 

10 DNS Server

To install The BIND DNS server, run:

urpmi bind

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

Then start BIND:

/etc/init.d/named start
Share this page:

0 Comment(s)