LAMP完美搭建(Apache+Mysql+Php+Discuz+PhpMyAdmin+Awstat

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

Crazylinux工作室发扬开源精神,普及Linux教育crazylinux工作室网址:出自:crazylinux工作室网址:时间:2010.07.02转载请保留此信息----------------------------RHEL5.4下最新源码搭建Apache+Mysql+Php+Discuz+PhpMyAdmin+Awstats+AB压力测试2010/05/14第二版BycrazylinuxEmail:crazy_linux@163.com相比第一版本,改变了实验中的某些步骤顺序,使整个实验更具真实性。并且有些服务版本已经更新。如有什么疑问,请发Email与作者联系。实验目的:完成Linux下面的LAMP环境的搭建,实现Discuz论坛,实现awstats分析Web日志,以及AB实现HTTP性能测试,最后通过phpMyAdmin管理MySQL数据库实验软件包:(都存放到Web服务器的/home下)实验环境:RHEL5.4Webserver:192.168.0.10/24Dnsserver:192.168.0.20/24:192.168.0.100/24前提条件:在所有linux主机上配置yum仓库,把DVD光盘挂在到本地/media下,红色字体代表修改Crazylinux工作室发扬开源精神,普及Linux教育crazylinux工作室网址:后结果[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;Crazylinux工作室发扬开源精神,普及Linux教育crazylinux工作室网址:{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.fanCrazylinux工作室发扬开源精神,普及Linux教育crazylinux工作室网址:[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.20[root@localhostnamed]#servicenamedrestart[root@localhostnamed]#chkconfignamedon4、测试DNS(在clinet中把DNS指向192.168.0.20)[root@localhostnamed]#host工作室发扬开源精神,普及Linux教育crazylinux工作室网址:[root@localhostnamed]#host二、LAMP环境的搭建1、安装APACHE(配置源码包之前先安装GCC环境)[root@localhost~]#yum-yinstall*gcc*[root@localhost~]#rpm-ehttpd–nodeps//卸载系统自带的httpd这个包[root@localhost~]#cd/home/[root@localhosthome]#tar-zxvfhttpd-2.2.15.tar.gz-C/usr/local/src/[root@localhosthome]#cd/usr/local/src/httpd-2.2.15/[root@localhosthttpd-2.2.15]#./configure--prefix=/usr/local/apache2--enable-so--enable-rewrite[root@localhosthttpd-2.2.15]#make&&makeinstall做个小技巧,实现开机自动启动APACHE[root@localhosthttpd-2.2.15]#cd/usr/local/apache2/bin/[root@localhostbin]#vimapachectl#!/bin/sh#chkconfig:358515#description:ApacheisaWorldWideWebServer[root@localhostbin]#cpapachectl/etc/init.d/apache[root@localhostbin]#chkconfig--addapache[root@localhostbin]#serviceapacherestart[root@localhostbin]#chkconfigapacheon测试:在clinet上IE中输入服务器的ip、构建基于域名的虚拟主机前提条件[root@localhostbin]#cat/etc/resolv.confnameserver192.168.0.20searchexample.com[root@localhostbin]#host工作室发扬开源精神,普及Linux教育crazylinux工作室网址:[root@loca

1 / 21
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功