您的当前位置:首页CentOS安装说明

CentOS安装说明

2020-06-01 来源:爱问旅游网
完美安装‐完美安装‐CentOS 5.0 (32-bit) 此教程说明如何安装以CentOS 5.0为主的服务器,并提供所有ISP与webhosters所需要的服务: Apache 网络服务器(SSL-capable), 邮件服务器, BIND DNS服务器, Proftpf FTP 服务器, MySQL 服务器, Dovecot POP3/IMAP, 配额, 防火墙等。所使用软件有: • Apache 2.2 与 PHP 5.1.6 • MySQL 5.0 • Postfix • BIND9(chrooted) • Proftpd • Dovecot • Webalizer 最终你应有一个可靠的系统。事先声明,这不是唯一安装此类系统的方法。 1.需求 • 下载六个CentOS 5.0 映像档 • 快速的网际网路连线 2.初步说明 在此教程说明中,我用hostname server1.example.com 与IP位址192.168.0.1 和网关192.168.0.1. 设定可能与你有别,请与适当的资料取代。 3.安裝基本系統 使用光碟1开机。按。 因所需时间可能太长,点击跳过测试。 CentOS 安装器的欢迎介面将出现。点击到下一步。 选择所用的语言。然后点击〈Next〉 选择键盘设定。然后点击〈Next〉 因为我在新系统上安装CentOS5.0, 所以我在问题,would you like to initialize this drive, erasing ALL DATA?,点击 现在选择硬碟分割计划。为了简单,我选择Remove linux partitions on selected drives and create default layout. 以删除旧的Linux,并制造原定布局。然后点击〈Next> 在接下来的问题回答 在网络设定介面,点击右上角的 在下个介面,不要选择Use dynamic IP configuration (DHCP) 和Enable IPv6 support而提供你网络片的static IP位址和适合的netmask(若不肯定,请参考http://www.subnetmask.info) 自己设定 hostname并打入网关与两个或以上的DNS服务器 选择时区 选择密码: 现在选择软件安装。只选择Servers和 Customize now。点击 现在选择要安装的配套组合。请选Editors, Text-based Internet, Development Libraries, Development Tools, DNS Name Server, FTP Server, Mail Server, MySQL Database, Server Configuration Tools, Web Server, Administration Tools, Base, 和System Tools。点击 安装器将检查配套所需的软件: 点击以开始安装 点击 安装开始 安装完毕,重开电脑 开机之后,你将看见以下介面,选择firewall configuration 并点击 关闭 Fedora防火墙和SELinux 因为这两个设定可能带来不必要的问题。点击<0k>: 选择 Server -> Settings -> Email 选择Maildir。然后输入 postconf -e 'home_mailbox = Maildir/' postconf -e 'mailbox_command =' /etc/init.d/postfix restart 11 Apache2 与PHP 安装Apache2 与PHP yum install php php-devel php-gd php-imap php-ldap php-mysql php-odbc php-pear php-xml php-xmlrpc curl curl-devel perl- libwww-perl ImageMagick libxml2 libxml2-devel 更改/etc/httpd/conf/httpd.conf: vi /etc/httpd/conf/httpd.conf [...] DirectoryIndex index.html index.htm index.shtml index.cgi index.php index.php3 index.pl [...] chkconfig --levels 235 httpd on 启动Apache: /etc/init.d/httpd start 12 proftpd 先消除vsftpd yum remove vsftpd 编译Proftpd cd /tmp/ wget --passive-ftp ftp://ftp.proftpd.org/distrib/source/proftpd- 1.3.0a.tar.gz tar xvfz proftpd-1.3.0a.tar.gz cd proftpd-1.3.0a/ ./configure --sysconfdir=/etc make make install cd .. rm -fr proftpd-1.3.0a* 为Proftpd制造symlink ln -s /usr/local/sbin/proftpd /usr/sbin/proftpd 制造init script /etc/init.d/proftpd vi /etc/init.d/proftpd #!/bin/sh # $Id: proftpd.init,v 1.1 2004/02/26 17:54:30 thias Exp $ # # proftpd This shell script takes care of starting and stopping # proftpd. # # chkconfig: - 80 30 # description: ProFTPD is an enhanced FTP server with a focus towards \\ # simplicity, security, and ease of configuration. \\ # It features a very Apache-like configuration syntax, \\ # and a highly customizable server infrastructure, \\ # including support for multiple 'virtual' FTP servers, \\ # anonymous FTP, and permission-based directory visibility. # processname: proftpd # config: /etc/proftp.conf # pidfile: /var/run/proftpd.pid # Source function library. . /etc/rc.d/init.d/functions # Source networking configuration. . /etc/sysconfig/network # Check that networking is up. [ ${NETWORKING} = \"no\" ] && exit 0 [ -x /usr/sbin/proftpd ] || exit 0 RETVAL=0 prog=\"proftpd\" start() { echo -n $\"Starting $prog: \" daemon proftpd RETVAL=$? echo [ $RETVAL -eq 0 ] && touch /var/lock/subsys/proftpd } stop() { echo -n $\"Shutting down $prog: \" killproc proftpd RETVAL=$? echo [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/proftpd } # See how we were called. case \"$1\" in start) start ;; stop) stop ;; status) status proftpd RETVAL=$? ;; restart) stop start ;; condrestart) if [ -f /var/lock/subsys/proftpd ]; then stop start fi ;; reload) echo -n $\"Re-reading $prog configuration: \" killproc proftpd -HUP RETVAL=$? echo ;; *) echo \"Usage: $prog {start|stop|restart|reload|condrestart|status}\" exit 1 esac exit $RETVAL 输入 chmod 755 /etc/init.d/proftpd 打开/etc/proftpd.conf,将Group改成nobody: vi /etc/proftpd.conf [...] Group nobody [...] 为了安全,使用以下指令(http://proftpd.org/localsite/Userguide/linked/userguide.html) vi /etc/proftpd.conf [...] DefaultRoot ~ IdentLookups off ServerIdent on \"FTP Server ready.\" [...] 为Proftpd制造开机连接: chkconfig --levels 235 proftpd on 启动Proftpd /etc/init.d/proftpd start 13. Webalizer 安装Webalizer,输入 yum install webalizer 14.系统时间调整 输入 yum install ntp chkconfig --levels 235 ntpd on ntpdate 0.pool.ntp.org /etc/init.d/ntpd start 15.安装Perl模块 输入 yum install perl-HTML-Parser perl-DBI perl-Net-DNS perl-Digest-SHA1 教程完毕

因篇幅问题不能全部显示,请点此查看更多更全内容