一、配置DNS

--->192.168.10.10
mail.tarena.com--->192.168.10.10
1,安装DNS软件包
[root@localhost~]#yum-yinstallbindbind-chrootcaching-nameserver
2,配置DNS主配置文件
[root@localhost~]#cd/var/named/chroot/etc/
[root@localhostetc]#cp-pnamed.caching-nameserver.confnamed.conf
[root@localhostetc]#vimnamed.conf
15listen-onport53{any;};
27allow-query{any;};
28allow-query-cache{any;};
37match-clients{any;};
38match-destinations{any;};
[root@localhostetc]#vimnamed.rfc1912.zones
51zone"tarena.com"IN{
52typemaster;
53file"tarena.zheng";
54};
55
56zone"10.168.192.in-addr.arpa"IN{
57typemaster;
58file"tarena.fan";
59};
[root@localhostetc]#named-checkconfnamed.conf
3,配置区域数据文件
[root@localhostetc]#cd/var/named/chroot/var/named/
[root@localhostnamed]#cp-pnamed.zerotarena.zheng
[root@localhostnamed]#cattarena.zheng
$TTL86400
@INSOAlocalhost.root.localhost.(
42;serial(d.adams)
3H;refresh
15M;retry
1W;expiry
1D);minimum
INNSdns.tarena.com.
INMX5mail.tarena.com.
dnsINA192.168.10.10
wwwINA192.168.10.10
mailINA192.168.10.10
[root@localhostnamed]#cattarena.fan
$TTL86400
@INSOAlocalhost.root.localhost.(
42;serial(d.adams)
3H;refresh
15M;retry
1W;expiry
1D);minimum
INNSdns.tarena.com.
INMX5mail.tarena.com.
10INPTRdns.tarena.com.
10INPTR.
10INPTRmail.tarena.com.
[root@localhostnamed]#named-checkzonetarena.comtarena.zheng
zonetarena.com/IN:loadedserial42
OK
[root@localhostnamed]#named-checkzonetarena.comtarena.fan
zonetarena.com/IN:loadedserial42
OK
4,启动DNS并测试
[root@localhostnamed]#/etc/init.d/namedrestart
[root@localhostnamed]#chkconfignamedon
[root@localhostnamed]#cat/etc/resolv.conf
;generatedby/sbin/dhclient-script
searchtarena.com
nameserver192.168.10.10
[root@localhostnamed]#host
hasaddress192.168.10.10
[root@localhostnamed]#hostmail.tarena.com
mail.tarena.comhasaddress192.168.10.10

二、安装前准备工作

1,环境
[root@localhost~]#cat/etc/redhat-release
RedHatEnterpriseLinuxServerrelease5.9(Tikanga)
[root@localhost~]#uname-r
2.6.18-348.el5
2,安装与卸载相关软件包
[root@localhost~]#yum-yinstalldb4-utilsdb4-develpam-developenldap-develgcc*makelibtool-ltdllibtool-ltdl-develgd-devellibart_lgpllibtermcap-devellibxml2libxml2-develpcrepcre-developenssl-devellibtoolexpectruby
[root@localhost~]#yum-yremovehttpdmysqlmysql-serverphp
[root@localhost~]#servicesendmailstop
[root@localhost~]#chkconfigsendmailoff
[root@localhost~]#rpm-ecyrus-sasl-libcyrus-sasl-plaincyrus-saslcyrus-sasl-libcyrus-sasl-plaincyrus-sasl-devel--nodeps--allmatches
3,验证DNS
[root@localhost~]#host-tmxtarena.com
tarena.commailishandledby5mail.tarena.com.
[root@localhost~]#hostmail.tarena.com
mail.tarena.comhasaddress192.168.10.10

三、源码安装APACHE

[root@localhost~]#tar-zxvfhttpd-2.2.25.tar.gz-C/usr/src/
[root@localhost~]#cd/usr/src/httpd-2.2.25/
[root@localhosthttpd-2.2.25]#./configure--prefix=/usr/local/apache2--with-mpm=worker--enable-rewrite=shared--enable-so--enable-auth-digest--enable-cgi--with-ssl=/usr/local/ssl--enable-ssl=shared--enable-suexec--with-suexec-caller=daemon--with-suexec-docroot=/usr/local/apache2/htdocs
[root@localhosthttpd-2.2.25]#make&&makeinstall
[root@localhosthttpd-2.2.25]#cp/usr/local/apache2/bin/apachectl/etc/init.d/apache
[root@localhosthttpd-2.2.25]#head-n5/etc/init.d/apache
#!/bin/sh
#
#chkconfig:23458515
#description:Webserverdaemon
[root@localhosthttpd-2.2.25]#chkconfig--addapache
[root@localhosthttpd-2.2.25]#chkconfigapacheon
[root@localhosthttpd-2.2.25]#vim/usr/local/apache2/conf/httpd.conf
100ServerNamemail.tarena.com:80
[root@localhosthttpd-2.2.25]#/etc/init.d/apachestop
[root@localhosthttpd-2.2.25]#/etc/init.d/apachestart
[root@localhosthttpd-2.2.25]#netstat-ln|grep:80
tcp00:::80:::*LISTEN
验证APACHE

四、源码安装MYSQL

[root@localhost~]#tar-zxvfmysql-5.1.63.tar.gz-C/usr/src/
[root@localhost~]#cd/usr/src/mysql-5.1.63/
[root@localhostmysql-5.1.63]#vimconfigure
52297#$RM"$cfgfile"//注释该行
[root@localhostmysql-5.1.63]#./configure--prefix=/usr/local/mysql--with-mysqld-user=mysql
[root@localhostmysql-5.1.63]#make&&makeinstall
[root@localhostmysql-5.1.63]#cpsupport-files/my-medium.cnf/etc/my.cnf
[root@localhostmysql-5.1.63]#/usr/local/mysql/bin/mysql_install_db--user=mysql
[root@localhostmysql-5.1.63]#chown-Rroot.mysql/usr/local/mysql/
[root@localhostmysql-5.1.63]#chown-Rmysql/usr/local/mysql/var/
[root@localhostmysql-5.1.63]#echo"/usr/local/mysql/lib/mysql">>/etc/ld.so.conf
[root@localhostmysql-5.1.63]#ldconfig
[root@localhostmysql-5.1.63]#echo"exportPATH=$PATH:/usr/local/mysql/bin/">>/etc/profile
[root@localhostmysql-5.1.63]#source/etc/profile
[root@localhostmysql-5.1.63]#cpsupport-files/mysql.server/etc/init.d/mysqld
[root@localhostmysql-5.1.63]#chmod+x/etc/init.d/mysqld
[root@localhostmysql-5.1.63]#chkconfig--addmysqld
[root@localhostmysql-5.1.63]#chkconfigmysqldon
[root@localhostmysql-5.1.63]#vim/etc/my.cnf
38log=/var/log/mysqld/mysql.log
[root@localhostmysql-5.1.63]#mkdir/var/log/mysqld
[root@localhostmysql-5.1.63]#chown-Rmysql.mysql/var/log/mysqld/
[root@localhostmysql-5.1.63]#/etc/init.d/mysqldrestart
验证:
[root@localhostmysql-5.1.63]#netstat-ln|grep:3306
tcp000.0.0.0:33060.0.0.0:*LISTEN

五、源码安装PHP

[root@localhost~]#tar-zxvfphp-5.4.19.tar.gz-C/usr/src/
[root@localhost~]#cd/usr/src/php-5.4.19/
[root@localhost~]#./configure--prefix=/usr/local/php5--enable-mbstring--with-apxs2=/usr/local/apache2/bin/apxs--with-mysql=/usr/local/mysql/--with-config-file-path=/usr/local/php5
[root@localhost~]#make
[root@localhost~]#makeinstall
[root@localhost~]#vim/usr/local/apache2/conf/httpd.conf
58AddTypeapplication/x-httpd-php.php
171DirectoryIndexindex.phpindex.html
[root@localhost~]#cpphp.ini-development/usr/local/php5/etc/php.ini
[root@localhost~]#cat/usr/local/apache2/htdocs/test.php
<?php
phpinfo();
?>
[root@localhost~]#/etc/init.d/apachestop
[root@localhost~]#/etc/init.d/apachestart
测试: