一、配置DNS
--->192.168.10.10mail.tarena.com--->192.168.10.101,安装DNS软件包[root@localhost~]#yum-yinstallbindbind-chrootcaching-nameserver2,配置DNS主配置文件[root@localhost~]#cd/var/named/chroot/etc/[root@localhostetc]#cp-pnamed.caching-nameserver.confnamed.conf[root@localhostetc]#vimnamed.conf15listen-onport53{any;};27allow-query{any;};28allow-query-cache{any;};37match-clients{any;};38match-destinations{any;};[root@localhostetc]#vimnamed.rfc1912.zones51zone"tarena.com"IN{ 52typemaster;53file"tarena.zheng";54};5556zone"10.168.192.in-addr.arpa"IN{ 57typemaster;58file"tarena.fan";59};[root@localhostetc]#named-checkconfnamed.conf3,配置区域数据文件[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;refresh15M;retry1W;expiry1D);minimumINNSdns.tarena.com.INMX5mail.tarena.com.dnsINA192.168.10.10wwwINA192.168.10.10mailINA192.168.10.10[root@localhostnamed]#cattarena.fan$TTL86400@INSOAlocalhost.root.localhost.(42;serial(d.adams)3H;refresh15M;retry1W;expiry1D);minimumINNSdns.tarena.com.INMX5mail.tarena.com.10INPTRdns.tarena.com.10INPTR.10INPTRmail.tarena.com.[root@localhostnamed]#named-checkzonetarena.comtarena.zhengzonetarena.com/IN:loadedserial42OK[root@localhostnamed]#named-checkzonetarena.comtarena.fanzonetarena.com/IN:loadedserial42OK4,启动DNS并测试[root@localhostnamed]#/etc/init.d/namedrestart[root@localhostnamed]#chkconfignamedon[root@localhostnamed]#cat/etc/resolv.conf;generatedby/sbin/dhclient-scriptsearchtarena.comnameserver192.168.10.10[root@localhostnamed]#hosthasaddress192.168.10.10[root@localhostnamed]#hostmail.tarena.commail.tarena.comhasaddress192.168.10.10二、安装前准备工作
1,环境[root@localhost~]#cat/etc/redhat-releaseRedHatEnterpriseLinuxServerrelease5.9(Tikanga)[root@localhost~]#uname-r2.6.18-348.el52,安装与卸载相关软件包[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--allmatches3,验证DNS[root@localhost~]#host-tmxtarena.comtarena.commailishandledby5mail.tarena.com.[root@localhost~]#hostmail.tarena.commail.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.conf100ServerNamemail.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:80tcp00:::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]#vimconfigure52297#$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.cnf38log=/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:3306tcp000.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.conf58AddTypeapplication/x-httpd-php.php171DirectoryIndexindex.phpindex.html[root@localhost~]#cpphp.ini-development/usr/local/php5/etc/php.ini[root@localhost~]#cat/usr/local/apache2/htdocs/test.php<?phpphpinfo();?>[root@localhost~]#/etc/init.d/apachestop[root@localhost~]#/etc/init.d/apachestart测试: