Tải bản đầy đủ (.pdf) (44 trang)

IT training the perfect server CentOS4

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (2.66 MB, 44 trang )

ACE I.T. LEARNING SOLUTIONS, INC.
Rm. 208-210 V.I.R.Bldg., E. Rodriquez, Sr., Ave., Cubao, Q. C.
The Perfect Server - CentOS 4.7 Server
This tutorial shows how to set up a CentOS 4.7 server that offers all services needed by
ISPs and web hosters: Apache web server (SSL-capable), Postfix mail server with
SMTP-AUTH and TLS, BIND DNS server, Proftpd FTP server, MySQL server, Dovecot
POP3/IMAP, Quota, Firewall, etc. This tutorial is written for the 32-bit version of
CentOS 4.7, but should apply to the 64-bit version with very little modifications as well.
I will use the following software:








Web Server: Apache 2.0.x with PHP 4.3.9, mod_ruby, mod_python
Database Server: MySQL 4.1
Mail Server: Postfix
DNS Server: BIND9 (chrooted!)
FTP Server: proftpd
POP3/IMAP server: dovecot
Webalizer for web site statistics

In the end you should have a system that works reliably, and if you like you can install
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 CentOS 4.7 DVD or the four CD iso images from a mirror near you
(the list of mirrors can be found here:
/>a fast internet connection...

1 Install The Base System
Boot from your CentOS 4.7 DVD or CD (CD 1).

Prepared By: Jim “King” Reforma[]
/>

ACE I.T. LEARNING SOLUTIONS, INC.
Rm. 208-210 V.I.R.Bldg., E. Rodriquez, Sr., Ave., Cubao, Q. C.

It can take a long time to test the installation media so we skip this test here:

Prepared By: Jim “King” Reforma[]
/>

ACE I.T. LEARNING SOLUTIONS, INC.
Rm. 208-210 V.I.R.Bldg., E. Rodriquez, Sr., Ave., Cubao, Q. C.

The welcome screen of the CentOS installer appears. Click on Next:

Prepared By: Jim “King” Reforma[]
/>


ACE I.T. LEARNING SOLUTIONS, INC.
Rm. 208-210 V.I.R.Bldg., E. Rodriquez, Sr., Ave., Cubao, Q. C.

Choose your language next:

Prepared By: Jim “King” Reforma[]
/>

ACE I.T. LEARNING SOLUTIONS, INC.
Rm. 208-210 V.I.R.Bldg., E. Rodriquez, Sr., Ave., Cubao, Q. C.

(JavaScript must be enabled in your browser to view the large image as an image
overlay.)

Select your keyboard layout:

Prepared By: Jim “King” Reforma[]
/>

ACE I.T. LEARNING SOLUTIONS, INC.
Rm. 208-210 V.I.R.Bldg., E. Rodriquez, Sr., Ave., Cubao, Q. C.

(JavaScript must be enabled in your browser to view the large image as an image
overlay.)
We want to install a server so we choose Server here:

Prepared By: Jim “King” Reforma[]
/>


ACE I.T. LEARNING SOLUTIONS, INC.
Rm. 208-210 V.I.R.Bldg., E. Rodriquez, Sr., Ave., Cubao, Q. C.

(JavaScript must be enabled in your browser to view the large image as an image
overlay.)
Next we do the partitioning. Select Automatically partition. This will give you a smalll
/boot partition and a large / partition which is fine for our purposes:

Prepared By: Jim “King” Reforma[]
/>

ACE I.T. LEARNING SOLUTIONS, INC.
Rm. 208-210 V.I.R.Bldg., E. Rodriquez, Sr., Ave., Cubao, Q. C.

(JavaScript must be enabled in your browser to view the large image as an image
overlay.)
I'm installing CentOS 4.7 on a fresh system, so I answer Yes to the question Would you
like to initialize this drive, erasing ALL DATA?

Prepared By: Jim “King” Reforma[]
/>

ACE I.T. LEARNING SOLUTIONS, INC.
Rm. 208-210 V.I.R.Bldg., E. Rodriquez, Sr., Ave., Cubao, Q. C.

(JavaScript must be enabled in your browser to view the large image as an image
overlay.)
Select Remove all partitions on this system.

Prepared By: Jim “King” Reforma[]

/>

ACE I.T. LEARNING SOLUTIONS, INC.
Rm. 208-210 V.I.R.Bldg., E. Rodriquez, Sr., Ave., Cubao, Q. C.

(JavaScript must be enabled in your browser to view the large image as an image
overlay.)
We want to remove all Linux partitions, so we answer Yes to the following question:

Prepared By: Jim “King” Reforma[]
/>

ACE I.T. LEARNING SOLUTIONS, INC.
Rm. 208-210 V.I.R.Bldg., E. Rodriquez, Sr., Ave., Cubao, Q. C.

(JavaScript must be enabled in your browser to view the large image as an image
overlay.)
The installer presents you an overview of our new partitions. Click on Next:

Prepared By: Jim “King” Reforma[]
/>

ACE I.T. LEARNING SOLUTIONS, INC.
Rm. 208-210 V.I.R.Bldg., E. Rodriquez, Sr., Ave., Cubao, Q. C.

(JavaScript must be enabled in your browser to view the large image as an image
overlay.)
Now the boot loader GRUB will be installed. You can leave the default settings
unchanged and click on Next:


Prepared By: Jim “King” Reforma[]
/>

ACE I.T. LEARNING SOLUTIONS, INC.
Rm. 208-210 V.I.R.Bldg., E. Rodriquez, Sr., Ave., Cubao, Q. C.

On to the network settings. The default setting here is 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 I'm using the
IP address 192.168.0.100 for demonstration purposes):

Prepared By: Jim “King” Reforma[]
/>

ACE I.T. LEARNING SOLUTIONS, INC.
Rm. 208-210 V.I.R.Bldg., E. Rodriquez, Sr., Ave., Cubao, Q. C.

(JavaScript must be enabled in your browser to view the large image as an image
overlay.)

Prepared By: Jim “King” Reforma[]
/>

ACE I.T. LEARNING SOLUTIONS, INC.
Rm. 208-210 V.I.R.Bldg., E. Rodriquez, Sr., Ave., Cubao, Q. C.

(JavaScript must be enabled in your browser to view the large image as an image
overlay.)
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. 213.191.92.86, 145.253.2.75, and
62.109.123.196):

Prepared By: Jim “King” Reforma[]
/>

ACE I.T. LEARNING SOLUTIONS, INC.
Rm. 208-210 V.I.R.Bldg., E. Rodriquez, Sr., Ave., Cubao, Q. C.

(JavaScript must be enabled in your browser to view the large image as an image
overlay.)
I want to install ISPConfig at the end of this tutorial which comes with its own firewall.
That's why I disable the default CentOS firewall now. Of course, you are free to leave it
on and configure it to your needs (but then you shouldn't use any other firewall later on as
it will most probably interfere with the CentOS firewall).
SELinux is a security extension of CentOS that should provide extended security. In my
opinion you don't need it to configure a secure system, and it usually causes more
problems than advantages (think of it after you have done a week of trouble-shooting
because some service wasn't working as expected, and then you find out that everything
was ok, only SELinux was causing the problem). Therefore I disable it (this is a must if
you want to install ISPConfig later on).

Prepared By: Jim “King” Reforma[]
/>

ACE I.T. LEARNING SOLUTIONS, INC.
Rm. 208-210 V.I.R.Bldg., E. Rodriquez, Sr., Ave., Cubao, Q. C.

(JavaScript must be enabled in your browser to view the large image as an image
overlay.)

Click on Proceed:

Prepared By: Jim “King” Reforma[]
/>

ACE I.T. LEARNING SOLUTIONS, INC.
Rm. 208-210 V.I.R.Bldg., E. Rodriquez, Sr., Ave., Cubao, Q. C.

(JavaScript must be enabled in your browser to view the large image as an image
overlay.)
Select the default language for the system and add further languages, if necessary:

Prepared By: Jim “King” Reforma[]
/>

ACE I.T. LEARNING SOLUTIONS, INC.
Rm. 208-210 V.I.R.Bldg., E. Rodriquez, Sr., Ave., Cubao, Q. C.

(JavaScript must be enabled in your browser to view the large image as an image
overlay.)
Choose your time zone:

Prepared By: Jim “King” Reforma[]
/>

ACE I.T. LEARNING SOLUTIONS, INC.
Rm. 208-210 V.I.R.Bldg., E. Rodriquez, Sr., Ave., Cubao, Q. C.

(JavaScript must be enabled in your browser to view the large image as an image
overlay.)

Give root a password:

Prepared By: Jim “King” Reforma[]
/>

ACE I.T. LEARNING SOLUTIONS, INC.
Rm. 208-210 V.I.R.Bldg., E. Rodriquez, Sr., Ave., Cubao, Q. C.

(JavaScript must be enabled in your browser to view the large image as an image
overlay.)
Now we are to select the package groups we want to install. Select Editors, Text Based
Internet, Server Configuration Tools, Web Server, Mail Server, DNS Name Server, FTP
Server, MySQL Database, Development Tools, Administration Tools and System Tools
and click on Next:

Prepared By: Jim “King” Reforma[]
/>

ACE I.T. LEARNING SOLUTIONS, INC.
Rm. 208-210 V.I.R.Bldg., E. Rodriquez, Sr., Ave., Cubao, Q. C.

(JavaScript must be enabled in your browser to view the large image as an image
overlay.)
Click on Next to start the installation:

Prepared By: Jim “King” Reforma[]
/>

ACE I.T. LEARNING SOLUTIONS, INC.
Rm. 208-210 V.I.R.Bldg., E. Rodriquez, Sr., Ave., Cubao, Q. C.


(JavaScript must be enabled in your browser to view the large image as an image
overlay.)
The hard drive is being partitioned:

Prepared By: Jim “King” Reforma[]
/>

ACE I.T. LEARNING SOLUTIONS, INC.
Rm. 208-210 V.I.R.Bldg., E. Rodriquez, Sr., Ave., Cubao, Q. C.

(JavaScript must be enabled in your browser to view the large image as an image
overlay.)
The installation begins. This will take a few minutes:

Prepared By: Jim “King” Reforma[]
/>

ACE I.T. LEARNING SOLUTIONS, INC.
Rm. 208-210 V.I.R.Bldg., E. Rodriquez, Sr., Ave., Cubao, Q. C.

(JavaScript must be enabled in your browser to view the large image as an image
overlay.)
Finally, the installation is complete, and you can remove your CD from the computer and
reboot it:

Prepared By: Jim “King” Reforma[]
/>


×