Monday, January 1, 2018

The Perfect Setup Fedora Core 3

The Perfect Setup Fedora Core 3


This is a detailed description about the steps to be taken to setup a Fedora Core 3 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.). In addition to that I will show how to use Debians package manager apt on an rpm-based system because it takes care of package dependencies automagically which can save a lot of trouble.
I will use the following software:
  • Web Server: Apache 2.0.x
  • Mail Server: Postfix (easier to configure than sendmail; has a shorter history of security holes than sendmail)
  • DNS Server: BIND9
  • FTP Server: proftpd
  • POP3/IMAP servers
  • Webalizer for web site statistics
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
To install such a system you will need the following:
  • Download the 4 Fedora Core 3 CD iso images from a mirror near you (the list of mirrors can be found here:http://fedora.redhat.com/download/mirrors.html), e.g. ftp://ftp.tu-chemnitz.de/pub/linux/fedora-core/3/i386/iso/FC3-i386-disc1.iso,ftp://ftp.tu-chemnitz.de/pub/linux/fedora-core/3/i386/iso/FC3-i386-disc2.iso, ftp://ftp.tu-chemnitz.de/pub/linux/fedora-core/3/i386/iso/FC3-i386-disc3.iso and ftp://ftp.tu-chemnitz.de/pub/linux/fedora-core/3/i386/iso/FC3-i386-disc4.iso, or download the DVD iso image, e.g.ftp://ftp.tu-chemnitz.de/pub/linux/fedora-core/3/i386/iso/FC3-i386-DVD.iso
  • an internet connection...

1 The Base System

Boot from your Fedora Core 3 CD (CD 1) or DVD.
It can take a long time to test the installation media so we skip this test here:
The welcome screen of the Fedora installer appears:
Choose your language next:
Select your keyboard layout:
We want to install a server so we choose Server here:
Now we have to partition our hard disk. You can choose to let the Fedora installer do the partitioning, or you can do it yourself. I want to create a small /boot partition (less than 100 MB) with the file system ext3, a swappartition and a huge / partition (again with ext3):
Now the boot loader GRUB will be installed. You can leave the default settings unchanged and click on Next:
On to the network settings. The default setting here seems to be to configure the network interfaces with DHCP, but we are installing a server, so static IP addresses are not a bad idea... Click on the Edit button at the top right. In the window that pops up uncheck Configure using DHCP and give your network card a static IP address (in this tutorial Im using the IP address 192.168.0.100 for demonstration purposes):
Set the hostname manually, e.g. server1.example.com, and enter a gateway (e.g. 192.168.0.1) and up to three DNS servers (e.g. 145.253.2.75 and 193.174.32.18):
On the next screen we select No firewall (theres a firewall coming with ISPConfig that we want to use) and disable SELinux:
Click on Proceed (remember, we are going to use the ISPConfig firewall):
Select the default language for the system:
Choose your time zone:
Give root a password:
Now we are to select the package groups we want to install. Select EditorsText Based InternetServer Configuration ToolsWeb ServerMail ServerDNS Name ServerFTP ServerMySQL DatabaseNetwork ServersDevelopment ToolsAdministration Tools and System Tools and click on Next:
The installer tells you which CDs it will need to install the selected packages:
The installation begins. This will take a few minutes:
Finally, the installation is complete, and you can remove your CD/DVD from the computer and reboot it:



2 Installing And Configuring The Rest Of The System

Configure Additional IP Addresses
Lets assume our network interface is eth0. Then there is a file /etc/sysconfig/network-scripts/ifcfg-eth0which looks like this:
DEVICE=eth0
BOOTPROTO=static
BROADCAST=192.168.0.255
IPADDR=192.168.0.100
NETMASK=255.255.255.0
NETWORK=192.168.0.0
ONBOOT=yes
TYPE=Ethernet
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
BROADCAST=192.168.0.255
IPADDR=192.168.0.101
NETMASK=255.255.255.0
NETWORK=192.168.0.0
ONBOOT=yes
TYPE=Ethernet
Afterwards we have to restart the network:
/etc/init.d/network restart

Setting The Hostname
echo server1.example.com > /etc/hostname 
/bin/hostname -F /etc/hostname

Install apt For Fedora
apt is the packaging system used on Debian. Since it cares much better for package dependencies than rpm it would be nice if we could use it on our new Fedora system. This would save us a lot of hassle. Fortunately, apt has been ported to a lot of rpm based distributions, and is also available for Fedora Core 3 (you will love it... :-)).
rpm -ivh http://ftp.freshrpms.net/pub/freshrpms/fedora/linux/3/apt/apt-0.5.15cnc6-1.1.fc3.fr.i386.rpm
Edit /etc/apt/sources.list. It should contain the following lines:
rpm http://ayo.freshrpms.net fedora/linux/3/i386 core updates freshrpms
rpm http://ayo.freshrpms.net fedora/linux/3/i386 tupdates
rpm-src http://ayo.freshrpms.net fedora/linux/3/i386 core updates freshrpms
rpm-src http://ayo.freshrpms.net fedora/linux/3/i386 tupdates
rpm http://ayo.freshrpms.net fedora/linux/2/i386 core updates freshrpms
rpm http://ayo.freshrpms.net fedora/linux/1/i386 core updates freshrpms
Run
apt-get update

Install Some Software
apt-get install which fetchmail wget bzip2 unzip zip nmap openssl lynx fileutils ncftp

Quota
apt-get install quota
Edit /etc/fstab to look like this (I added ,usrquota,grpquota to LABEL=/ (mount point /):
# This file is edited by fstab-sync - see man fstab-sync for details
LABEL=/ / ext3 defaults,usrquota,grpquota 1 1
LABEL=/boot /boot ext3 defaults 1 2
none /dev/pts devpts gid=5,mode=620 0 0
none /dev/shm tmpfs defaults 0 0
none /proc proc defaults 0 0
none /sys sysfs defaults 0 0
LABEL=SWAP-sda3 swap swap defaults 0 0
/dev/hdc /media/cdrecorder auto pamconsole,ro,exec,noauto,managed 0 0
/dev/fd0 /media/floppy auto pamconsole,exec,noauto,managed 0 0
Then run:
touch /aquota.user /aquota.group
chmod 600 /aquota.*
mount -o remount /
quotacheck -avugm
quotaon -avug

DNS-Server
apt-get install bind-chroot
chmod 755 /var/named/
chmod 775 /var/named/chroot/
chmod 775 /var/named/chroot/var/
chmod 775 /var/named/chroot/var/named/
chmod 775 /var/named/chroot/var/run/
chmod 777 /var/named/chroot/var/run/named/
cd /var/named/chroot/var/named/
ln -s ../../ chroot
chkconfig --levels 235 named on
/etc/init.d/named start
Bind will run in a chroot jail under /var/named/chroot/var/named/.

MySQL
apt-get install mysql mysql-devel mysql-server
chkconfig --levels 235 mysqld on
/etc/init.d/mysqld start
Now check that networking is enabled. Run
netstat -tap
It should show a line like this:
tcp 0 0 *:mysql *:* LISTEN 6621/mysqld
If it does not, edit /etc/my.cnf, comment out the option skip-networking:
# Dont listen on a TCP/IP port at all. This can be a security enhancement,
# if all p

visit to link download

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.