一、配置DNS
www.tarena.com--->192.168.10.10
mail.tarena.com--->192.168.10.10
1,安装DNS软件包
[iyunv@localhost~]#yum-yinstallbindbind-chrootcaching-nameserver
2,配置DNS主配置文件
[iyunv@localhost~]#cd/var/named/chroot/etc/
[iyunv@localhostetc]#cp-pnamed.caching-nameserver.confnamed.conf
[iyunv@localhostetc]#vimnamed.conf
15listen-onport53{any;};
27allow-query{any;};
28allow-query-cache{any;};
37match-clients{any;};
38match-destinations{any;};
[iyunv@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};
[iyunv@localhostetc]#named-checkconfnamed.conf
3,配置区域数据文件
[iyunv@localhostetc]#cd/var/named/chroot/var/named/
[iyunv@localhostnamed]#cp-pnamed.zerotarena.zheng
[iyunv@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
[iyunv@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.
10INPTRwww.tarena.com.
10INPTRmail.tarena.com.
[iyunv@localhostnamed]#named-checkzonetarena.comtarena.zheng
zonetarena.com/IN:loadedserial42
OK
[iyunv@localhostnamed]#named-checkzonetarena.comtarena.fan
zonetarena.com/IN:loadedserial42
OK
4,启动DNS并测试
[iyunv@localhostnamed]#/etc/init.d/namedrestart
[iyunv@localhostnamed]#chkconfignamedon
[iyunv@localhostnamed]#cat/etc/resolv.conf
;generatedby/sbin/dhclient-script
searchtarena.com
nameserver192.168.10.10
[iyunv@localhostnamed]#hostwww.tarena.com
www.tarena.comhasaddress192.168.10.10
[iyunv@localhostnamed]#hostmail.tarena.com
mail.tarena.comhasaddress192.168.10.10 二、安装前准备工作
1,环境
[iyunv@localhost~]#cat/etc/redhat-release
RedHatEnterpriseLinuxServerrelease5.9(Tikanga)
[iyunv@localhost~]#uname-r
2.6.18-348.el5
2,安装与卸载相关软件包
[iyunv@localhost~]#yum-yinstalldb4-utilsdb4-develpam-developenldap-develgcc*makelibtool-ltdllibtool-ltdl-develgd-devellibart_lgpllibtermcap-devellibxml2libxml2-develpcrepcre-developenssl-devellibtoolexpectruby
[iyunv@localhost~]#yum-yremovehttpdmysqlmysql-serverphp
[iyunv@localhost~]#servicesendmailstop
[iyunv@localhost~]#chkconfigsendmailoff
[iyunv@localhost~]#rpm-ecyrus-sasl-libcyrus-sasl-plaincyrus-saslcyrus-sasl-libcyrus-sasl-plaincyrus-sasl-devel--nodeps--allmatches
3,验证DNS
[iyunv@localhost~]#host-tmxtarena.com
tarena.commailishandledby5mail.tarena.com.
[iyunv@localhost~]#hostmail.tarena.com
mail.tarena.comhasaddress192.168.10.10 三、源码安装APACHE
[iyunv@localhost~]#tar-zxvfhttpd-2.2.25.tar.gz-C/usr/src/
[iyunv@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
http://mail.tarena.com 四、源码安装MYSQL
[iyunv@localhost~]#tar-zxvfmysql-5.1.63.tar.gz-C/usr/src/
[iyunv@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
[iyunv@localhost~]#tar-zxvfphp-5.4.19.tar.gz-C/usr/src/
[iyunv@localhost~]#cd/usr/src/php-5.4.19/
[iyunv@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
[iyunv@localhost~]#make
[iyunv@localhost~]#makeinstall
[iyunv@localhost~]#vim/usr/local/apache2/conf/httpd.conf
58AddTypeapplication/x-httpd-php.php
171DirectoryIndexindex.phpindex.html
[iyunv@localhost~]#cpphp.ini-development/usr/local/php5/etc/php.ini
[iyunv@localhost~]#cat/usr/local/apache2/htdocs/test.php
<?php
phpinfo();
?>
[iyunv@localhost~]#/etc/init.d/apachestop
[iyunv@localhost~]#/etc/init.d/apachestart
测试:
http://mail.tarena.com/test.php
|