源码搭建LAMP平台 <<

一、配置DNS
www.tarena.com--->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.
10INPTRwww.tarena.com.
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]#hostwww.tarena.com
www.tarena.comhasaddress192.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/
[[email protected]]#./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
[[email protected]]#make&&makeinstall
[[email protected]]#cp/usr/local/apache2/bin/apachectl/etc/init.d/apache
[[email protected]]#head-n5/etc/init.d/apache
#!/bin/sh
#
#chkconfig:23458515
#description:Webserverdaemon
[[email protected]]#chkconfig--addapache
[[email protected]]#chkconfigapacheon
[[email protected]]#vim/usr/local/apache2/conf/httpd.conf
100ServerNamemail.tarena.com:80
[[email protected]]#/etc/init.d/apachestop
[[email protected]]#/etc/init.d/apachestart
[[email protected]]#netstat-ln|grep:80
tcp00:::80:::*LISTEN
验证APACHE
http://mail.tarena.com

四、源码安装MYSQL
[root@localhost~]#tar-zxvfmysql-5.1.63.tar.gz-C/usr/src/
[root@localhost~]#cd/usr/src/mysql-5.1.63/
[[email protected]]#vimconfigure
52297#$RM"$cfgfile"//注释该行
[[email protected]]#./configure--prefix=/usr/local/mysql--with-mysqld-user=mysql
[[email protected]]#make&&makeinstall
[[email protected]]#cpsupport-files/my-medium.cnf/etc/my.cnf
[[email protected]]#/usr/local/mysql/bin/mysql_install_db--user=mysql
[[email protected]]#chown-Rroot.mysql/usr/local/mysql/
[[email protected]]#chown-Rmysql/usr/local/mysql/var/
[[email protected]]#echo"/usr/local/mysql/lib/mysql">>/etc/ld.so.conf
[[email protected]]#ldconfig
[[email protected]]#echo"exportPATH=$PATH:/usr/local/mysql/bin/">>/etc/profile
[[email protected]]#source/etc/profile
[[email protected]]#cpsupport-files/mysql.server/etc/init.d/mysqld
[[email protected]]#chmod+x/etc/init.d/mysqld
[[email protected]]#chkconfig--addmysqld
[[email protected]]#chkconfigmysqldon
[[email protected]]#vim/etc/my.cnf
38log=/var/log/mysqld/mysql.log
[[email protected]]#mkdir/var/log/mysqld
[[email protected]]#chown-Rmysql.mysql/var/log/mysqld/
[[email protected]]#/etc/init.d/mysqldrestart
验证:
[[email protected]]#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
测试:
http://mail.tarena.com/test.php

你可能感兴趣的:(源码,linux,LAMP平台)