您好,欢迎访问三七文档
RHEL5.4下最新源码搭建Apache+Mysql+Php+Discuz+PhpMyAdmin+Awstats+AB压力测试2010/3/25第一版Bycrazylinux实验目的:完成Linux下面的LAMP环境的搭建,实现Discuz论坛,实现awstats分析Web日志,以及AB实现HTTP性能测试,最后通过phpMyAdmin管理MySQL数据库实验软件包:软件下载地址:Apache::::::实验环境:RHEL5.4Webserver:192.168.0.10/24Dnsserver:192.168.0.20/24Clinet:192.168.0.100/24前提条件:在所有linux主机上配置yum仓库,把DVD光盘挂在到本地/media下,红色字体代表修改后结果[root@localhost~]#cat/etc/yum.repos.d/rhel-debuginfo.repo[rhel-debuginfo]name=RedHatEnterpriseLinux$releasever-$basearch-Debugbaseurl=file:///media/Server//指定本地/mediaenabled=1//开启仓库gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release关闭所有linux防火墙与SELINUX[root@localhostbin]#iptables-F[root@localhostbin]#iptables-X[root@localhostbin]#iptables-Z[root@localhostbin]#setenforce0[root@localhostbin]#serviceiptablessave一、DNS环境的搭建1、安装DNS相关软件包[root@localhost~]#yum-yinstallbindbind-develbind-chrootcaching-nameserver2、配置DNS主配置文件[root@localhost~]#cd/var/named/chroot/etc/[root@localhostetc]#cp-pnamed.caching-nameserver.confnamed.conf[root@localhostetc]#catnamed.conf////named.caching-nameserver.conf////ProvidedbyRedHatcaching-nameserverpackagetoconfigurethe//ISCBINDnamed(8)DNSserverasacachingonlynameserver//(asalocalhostDNSresolveronly).////See/usr/share/doc/bind*/sample/forexamplenamedconfigurationfiles.////DONOTEDITTHISFILE-usesystem-config-bindoraneditor//tocreatenamed.conf-editstothisfilewillbeloston//caching-nameserverpackageupgrade.//options{listen-onport53{any;};listen-on-v6port53{::1;};directory/var/named;dump-file/var/named/data/cache_dump.db;statistics-file/var/named/data/named_stats.txt;memstatistics-file/var/named/data/named_mem_stats.txt;//Thoseoptionsshouldbeusedcarefullybecausetheydisableport//randomization//query-sourceport53;//query-source-v6port53;allow-query{any;};allow-query-cache{any;};};logging{channeldefault_debug{filedata/named.run;severitydynamic;};};viewlocalhost_resolver{match-clients{any;};match-destinations{any;};recursionyes;include/etc/named.rfc1912.zones;};[root@localhostetc]#vimnamed.rfc1912.zones在文件最后添加zonecrazylinux.comIN{typemaster;filecl.zheng;};zonegoogle.comIN{typemaster;fileg.zheng;};zone0.168.192.in-addr.arpaIN{typemaster;filecl.fan;};3、配置区域文件[root@localhostetc]#cd/var/named/chroot/var/named/[root@localhostnamed]#cp-pnamed.zerocl.zheng[root@localhostnamed]#cp-pnamed.zerog.zheng[root@localhostnamed]#cp-pnamed.zerocl.fan[root@localhostnamed]#catcl.zheng$TTL86400@INSOAlocalhost.root.localhost.(42;serial(d.adams)3H;refresh15M;retry1W;expiry1D);minimumINNSdns.crazylinux.com.dnsINA192.168.0.20[root@localhostnamed]#catg.zheng$TTL86400@INSOAlocalhost.root.localhost.(42;serial(d.adams)3H;refresh15M;retry1W;expiry1D);minimumINNSdns.google.com.dnsINA192.168.0.20[root@localhostnamed]#catcl.fan$TTL86400@INSOAlocalhost.root.localhost.(42;serial(d.adams)3H;refresh15M;retry1W;expiry1D);minimumINNSdns.crazylinux.com.20INPTRdns.crazylinux.com.20INPTRdns.google.com.10INPTR[root@localhostnamed]#cat/etc/resolv.confnameserver192.168.0.20searchexample.com[root@localhostnamed]#servicenamedrestart[root@localhostnamed]#chkconfignamedon4、测试DNS[root@localhostnamed]#host[root@localhostnamed]#host、LAMP环境的搭建1、安装APACHE(配置源码包之前先安装GCC环境)[root@localhost~]#yum-yinstallgcc[root@localhostbin]#rpm-ehttpd--nodeps[root@localhostmedia]#tar-jxvfhttpd-2.2.13.tar.bz2-C/usr/local/src/[root@localhosthttpd-2.2.13]#./configure--prefix=/usr/local/apache2--enable-so--enable-rewrite[root@localhosthttpd-2.2.13]#make&&makeinstall做个小技巧,实现开机自动启动APACHE[root@localhosthttpd-2.2.13]#cd/usr/local/apache2/bin/[root@localhostbin]#vimapachectl#!/bin/sh##chkconfig:-8515#description:ApacheisaWorldWideWebserver.Itisusedtoserve\#HTMLfilesandCGI.[root@localhostbin]#cpapachectl/etc/init.d/apache[root@localhostbin]#chkconfig--addapache[root@localhostbin]#serviceapacherestart[root@localhostbin]#chkconfigapacheon测试:在clinet上IE中输入服务器的ip、配置个人主页[root@localhostbin]#vim/usr/local/apache2/conf/httpd.conf把382行前的#去掉381#Userhomedirectories382Includeconf/extra/httpd-userdir.conf[root@localhostbin]#useraddcrazylinux[root@localhostbin]#su-crazylinux[crazylinux@localhost~]$mkdirpublic_html[crazylinux@localhost~]$echoCrazylinux'sHomePagepublic_html/index.html[crazylinux@localhost~]$chmodo+x/home/crazylinux/[crazylinux@localhost~]$exit[root@localhostbin]#serviceapacherestart去掉~[root@localhostbin]#vim/usr/local/apache2/conf/extra/httpd-userdir.conf在第10
本文标题:RHEL5.4搭建LAMP+Discuz+PhpMyAdmin+Awstats+AB压力测试
链接地址:https://www.777doc.com/doc-5391706 .html