Professional Documents
Culture Documents
Install Mandriva
Install Mandriva
Install Mandriva
Version 1.0
Author: Falko Timme <ft [at] falkotimme [dot] com>
Last edited: 11/29/2005
This is a detailed description about the steps to be taken to setup a Mandriva 2006 Free
Edition based server that offers all services needed by ISPs and hosters (web server (SSL-
capable), mail server (with SMTP-AUTH and TLS!), DNS server, FTP server, MySQL server,
POP3/IMAP, Quota, Firewall, etc.).
POP3/IMAP servers
In the end you should have a system that works reliably and is ready for the free
webhosting control panel ISPConfig (i.e., ISPConfig runs on it out of the box).
I want to say first that this is not the only way of setting up such a system. There are many
ways of achieving this goal but this is the way I take. I do not issue any guarantee that this
will work for you!
Requirements
an internet connection...
Boot from your Mandriva 2006 CD (CD 1). Press Enter to start the installation:
Now we have to partition our hard disk. You can choose to let the Mandriva installer do the
partitioning, or you can do it yourself. I want to create a small /boot partition (about 100
MB) with the file system ext3, a swap partition and a huge / partition (again with ext3):
Click on Next if you have all three CDs of the Mandriva Download Edition:
Now we are to select the package groups we want to install. Select Internet
station, Network Computer (client), Configuration, Console Tools,
Development, Web/FTP, Mail, Database, Firewall/Router and Network
Computer server and click on Next:
Now the installer presents us a summary of the installation and gives us the
possibility to change settings by clicking on the appropriate Configure button. First
of all we adjust our keyboard layout (if you don't have a US keyboard...):
Select Hardware clock set to GMT and Automatic time synchronization
(using NTP):
Finally we change the Network - lan settings. Select LAN connection unless you're
using something different:
Select the network interface you want to configure (normally eth0):
Enter the Host name (e.g. server1.example.com), up to three DNS servers (e.g.
145.253.2.75 and 193.174.32.18) and the Gateway:
Do not allow users to start the connection. It's a server, and servers are always
online (at least, they should be...):
We've now made all necessary configurations, so we can leave the summary screen
by clicking on Next:
We do not want to configure X because we do not want to run a desktop on a server:
The base installation is now finished, you can now remove the CD or DVD and reboot
the system:
DEVICE=eth0
BOOTPROTO=static
IPADDR=192.168.0.100
NETMASK=255.255.255.0
NETWORK=192.168.0.0
BROADCAST=192.168.0.255
ONBOOT=yes
METRIC=10
MII_NOT_SUPPORTED=no
USERCTL=no
IPV6INIT=no
IPV6TO4INIT=no
PEERDNS=yes
NETMASK=255.255.255.0
IPADDR=192.168.0.100
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:
DEVICE=eth0:0
BOOTPROTO=static
IPADDR=192.168.0.101
NETMASK=255.255.255.0
NETWORK=192.168.0.0
BROADCAST=192.168.0.255
ONBOOT=yes
METRIC=10
MII_NOT_SUPPORTED=no
USERCTL=no
Afterwards we have to restart the network:
/etc/init.d/network restart
Setting The Hostname
This is not necessary if you have set the correct hostname
during the installation. If you have not, do this:
echo server1.example.com > /etc/hostname
/bin/hostname -F /etc/hostname
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 plf-free http://distrib-
coffee.ipsl.jussieu.fr/pub/linux/plf/mandriva/free/2
006.0/i586 with hdlist.cz
urpmi.addmedia --update updates ftp://ftp-stud.fht-
esslingen.de/pub/Mirrors/Mandrakelinux/official/upda
tes/2006.0/main_updates/ with media_info/hdlist.cz
urpmi.addmedia main ftp://ftp-stud.fht-
esslingen.de/pub/Mirrors/Mandrakelinux/official/2006
.0/i586/media/main with media_info/hdlist.cz
urpmi.addmedia contrib ftp://ftp-stud.fht-
esslingen.de/pub/Mirrors/Mandrakelinux/official/2006
.0/i586/media/contrib 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 2006
system. The script looks like this:
#!/bin/bash
urpmi.update updates
urpmi --auto --update --auto-select
Make the script executable:
chmod 755 /etc/cron.daily/software_update
Install Some Software
urpmi fetchmail wget bzip2 unzip zip nmap openssl
lynx fileutils ncftp flex libxorg-x11-devel
Quota
urpmi quota
Edit /etc/fstab to look like this (I added
,usrquota,grpquota to the partition with the mount point /):
DNS-Server
urpmi bind
/etc/init.d/mysqld start
Now check that networking is enabled. Run
netstat -tap
It should show a line like this:
Type
quit
to return to the system's shell.
<IfDefine HAVE_PHP5>
<IfModule !mod_php5.c>
LoadModule php5_module extramodules/mod_php5.so
</IfModule>
</IfDefine>
<IfModule mod_php5.c>
PHPINIDir /etc
</IfModule>
<IfModule mod_mime.c>
# AddType application/x-httpd-php .php
# AddType application/x-httpd-php .php3
# AddType application/x-httpd-php .php4
# AddType application/x-httpd-php .php5
# AddType application/x-httpd-php .phtml
# AddType application/x-httpd-php-source .phps
</IfModule>
<IfModule mod_php5.c>
<IfModule mod_dir.c>
DirectoryIndex index.php index.phtml index.php3
index.php4 index.php5
</IfModule>
</IfModule>
Edit /etc/httpd/conf/mime.types and comment out the
following lines:
#application/x-perl perl pl
#application/x-php php php3 php4
Edit /etc/httpd/conf/httpd.conf and add the following line
to the LoadModule section:
<Directory /var/www/sharedip>
Options +Includes -Indexes
AllowOverride None
AllowOverride Indexes AuthConfig Limit FileInfo
Order allow,deny
Allow from all
<Files ~ "^\.ht">
Deny from all
</Files>
</Directory>
at the end of /etc/httpd/conf/httpd.conf now although it
is not necessary.)
Restart Apache:
/etc/init.d/httpd restart
Proftpd
urpmi proftpd
/etc/init.d/proftpd start
For security reasons you can add the following lines to /etc/proftpd.conf (thanks to
Reinaldo Carvalho; more information can be found here:
http://proftpd.linux.co.uk/localsite/Userguide/linked/userguide.html):
DefaultRoot ~
IdentLookups off
ServerIdent on "FTP Server ready."
Be sure to comment out the following lines in /etc/proftpd.conf in order to allow ftp users
to CHMOD:
/etc/init.d/proftpd restart
Webalizer
To install all needed Perl Modules, we can use the appropriate Mandriva packages and install
them using urpmi:
The End
The configuration of the server is now finished, and if you wish you can now install
ISPConfig on it.
A Note On SuExec
If you want to run CGI scripts under suExec, you should specify /var/www as the home
directory for websites created by ISPConfig as Mandriva's suExec is compiled with /var/www
as Doc_Root. Run /usr/sbin/suexec -V, and the output should look like this:
To select /var/www as the home directory for websites during the installation of ISPConfig
do the following: When you are asked for the installation mode, select the expert mode.
Later during the installation you are asked if the default directory /home/www should be the
directory where ISPConfig will create websites in. Answer n and enter /var/www as the
home directory for websites.
Links
http://www.mandrivalinux.com
http://easyurpmi.zarb.org
http://www.ispconfig.org