<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Yousri&#039;s Blog &#187; Apache</title>
	<atom:link href="http://blog.yousri.org/tag/apache/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.yousri.org</link>
	<description>一个人骑单车在陌生城市路上自由穿梭的生活</description>
	<lastBuildDate>Fri, 20 Jan 2012 15:01:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Apache编译安装配置并支持Subversion版本控制</title>
		<link>http://blog.yousri.org/2010/02/25/install_apache_and_subversion.html</link>
		<comments>http://blog.yousri.org/2010/02/25/install_apache_and_subversion.html#comments</comments>
		<pubDate>Thu, 25 Feb 2010 07:39:00 +0000</pubDate>
		<dc:creator>Yousri</dc:creator>
				<category><![CDATA[技术]]></category>
		<category><![CDATA[生活工作]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[kbs_bbs]]></category>
		<category><![CDATA[LAMP]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://jmxc.net/yousri/2010/02/25/install_subversion_on_apache/</guid>
		<description><![CDATA[&#160;&#160;&#160;&#160;&#160; 毫无技术含量的文章,只是对先前一台服务器瞎捣鼓的后来由于上班太无聊的回忆潦草的记录备忘而已吧。。。 &#160;&#160;&#160;&#160;&#160;&#160; 一、更新CentOS系统至最新版本CentOS5.4 修改更新源 使用ustc.edu.cn的更新源 #cd /etc/yum.repos.d/ #mv CentOS-Base.repo CentOS-Base.repo.bak （备份修改前默认更新源） #wget http://centos.ustc.edu.cn/CentOS-Base.repo.5 （下载更新源） #mv CentOS-Base.repo.5 CentOS-Base.repo （因为默认的配置文件中服务器地址用的版本号是变量$releasever，所以需要将其替换为实际的版本号，否则是无法连接到服务器的，当前CentOS最新版是5.4，所以我们修改CentOS-Base.repo ） #vim CentOS-Base.repo vim全文替代命令并保存退出 :%s/$releasever/5.4/ :wq #yum update&#160;&#160; “更新下载 #lsb_release –a “查看验证版本 &#160;&#160;&#160;&#160;&#160;&#160; 二、下载安装配置Apache &#38; Mysql &#38; PHP &#38; KBS_BBS 1、目录定义： $bbs_install_dir&#160;&#160; 表示 bbs 的安装目录 /home/bbs $www_install_dir 表示 apache 的安装目录/home/www $php_install_dir&#160;&#160; 表示 php 的安装目录/home/www/php $phlinux_dir&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 表示花生壳安装目录/usr/local/phlinux/ <a href='http://blog.yousri.org/2010/02/25/install_apache_and_subversion.html'>[...]</a><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.yousri.org%2F2009%2F05%2F16%2F%25E5%25AE%2589%25E8%25A3%2585%25E9%2585%258D%25E7%25BD%25AE%25E5%259F%25BA%25E4%25BA%258Ekbs%25E7%25A8%258B%25E5%25BA%258F%25E7%259A%2584bbs%25E7%25B3%25BB%25E7%25BB%259F.html&from=http%3A%2F%2Fblog.yousri.org%2F2010%2F02%2F25%2Finstall_apache_and_subversion.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">安装配置基于KBS程序的BBS系统</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.yousri.org%2F2008%2F08%2F06%2Flamp.html&from=http%3A%2F%2Fblog.yousri.org%2F2010%2F02%2F25%2Finstall_apache_and_subversion.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Ubuntu 8.04里LAMP手动编译安装架构纪录</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.yousri.org%2F2009%2F04%2F12%2Fapache%25E6%25BD%259C%25E5%259C%25A8%25E6%25BC%258F%25E6%25B4%259E.html&from=http%3A%2F%2Fblog.yousri.org%2F2010%2F02%2F25%2Finstall_apache_and_subversion.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Apache潜在漏洞</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.yousri.org%2F2008%2F08%2F28%2Fapache_tomcat_install.html&from=http%3A%2F%2Fblog.yousri.org%2F2010%2F02%2F25%2Finstall_apache_and_subversion.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Apache与Tomcat整合</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p><font face="微软雅黑" size="2">&#160;&#160;&#160;&#160;&#160; 毫无技术含量的文章,只是对先前一台服务器瞎捣鼓的后来由于上班太无聊的回忆潦草的记录备忘而已吧。。。      </p>
<p></font><font face="微软雅黑" size="2">&#160;&#160;&#160;&#160;&#160;&#160; 一、更新CentOS系统至最新版本CentOS5.4</font></p>
<blockquote><p>修改更新源 使用ustc.edu.cn的更新源      <br />#cd /etc/yum.repos.d/       <br />#mv CentOS-Base.repo CentOS-Base.repo.bak （备份修改前默认更新源）       <br />#wget <a href="http://centos.ustc.edu.cn/CentOS-Base.repo.5">http://centos.ustc.edu.cn/CentOS-Base.repo.5</a> （下载更新源）       <br />#mv CentOS-Base.repo.5 CentOS-Base.repo       <br />（因为默认的配置文件中服务器地址用的版本号是变量$releasever，所以需要将其替换为实际的版本号，否则是无法连接到服务器的，当前CentOS最新版是5.4，所以我们修改CentOS-Base.repo ）       <br />#vim CentOS-Base.repo       <br />vim全文替代命令并保存退出       <br />:%s/$releasever/5.4/       <br />:wq       <br />#yum update&#160;&#160; “更新下载       <br />#lsb_release –a “查看验证版本</p>
</blockquote>
<p><font face="微软雅黑" size="2">&#160;&#160;&#160;&#160;&#160;&#160; 二、下载安装配置Apache &amp; Mysql &amp; PHP &amp; KBS_BBS</font></p>
<blockquote><p>1、目录定义：      <br />$bbs_install_dir&#160;&#160; 表示 bbs 的安装目录 /home/bbs       <br />$www_install_dir 表示 apache 的安装目录/home/www       <br />$php_install_dir&#160;&#160; 表示 php 的安装目录/home/www/php       <br />$phlinux_dir&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 表示花生壳安装目录/usr/local/phlinux/ （默认安装路径）       <br />$code_dir&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 表示存放 kbsbbs、apache 和 php 源代码的目录/home/src       <br />2、软件下载：       <br />Apache：wget -c <a href="http://apache.mirror.phpchina.com/httpd/httpd-2.2.11.tar.gz">http://apache.mirror.phpchina.com/httpd/httpd-2.2.11.tar.gz</a>       <br />Mysql:wget -c <a href="http://mysql.ntu.edu.tw/Downloads/MySQL-5.0/mysql-5.0.67-linux-i686.tar.gz">http://mysql.ntu.edu.tw/Downloads/MySQL-5.0/mysql-5.0.67-linux-i686.tar.gz</a>       <br />PHP：wget -c <a href="http://cn.php.net/get/php-5.3.0.tar.gz/from/cn2.php.net/mirror">http://cn.php.net/get/php-5.3.0.tar.gz/from/cn2.php.net/mirror</a>       <br />KBS_BBS：svn co <a href="http://svn.kcn.cn/repos/kbs/trunk/www2">http://svn.kcn.cn/repos/kbs/trunk/www2</a>       <br />3、编译安装：       <br />#tar zxvf httpd-2.2.11.tar.gz       <br />#cd httpd-2.2.11       <br />#./configure &#8211;prefix=/home/www &#8211;enable-so &#8211;enable-rewrite –enable-ssl       <br />#make &amp;&amp; make install       <br />#cd /home/www/conf/      <br />#vim httpd.conf      <br />&#160;&#160; 添加修改：（使其支持运行php程序）      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; AddType application/x-httpd-php .php      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; User bbs      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Group bbs      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; AddDefaultCharset gb2312      </p>
<p>#cd ..       <br />#tar zxvf mysql-5.0.67.tar.gz       <br />#cd mysql-5.0.67       <br />#./configure &#8211;prefix=/usr/local/mysql &#8211;with-charset=utf8 –with-collation=utf8_general_ci &#8211;with-extra-charsets=latin1       <br />#make &amp;&amp; make install       <br />#cp support-files/my-medium.cnf /etc/my.cnf       <br />#cd /usr/local/mysql/       <br />#bin/mysql_install_db &#8211;user=mysql       <br />#chown –R root .       <br />#chown –R mysql /usr/local/mysql/var       <br />#chgrp –R mysql .       <br />#bin/mysqld_safe &#8211;user=mysql &amp;       <br />#cd /home/src/mysql-5.0.67       <br />#cp support-files/mysql.server /etc/init.d/mysql       <br />#chmod 755 /etc/init.d/mysql       </p>
<p>#yum install php-gd php-xml php-domxml zlib-devel openssl-devel gmp-devel gd libesmtp-devel       <br />#cd /home/src/       <br />#tar zxvf php-5.3.0.tar.gz       <br />#cd php-5.3.0       <br />#./configure &#8211;prefix=/home/www/php &#8211;with-apxs2=/home/www/bin/apxs &#8211;disable-debug &#8211;with-pic &#8211;disable-rpath &#8211;enable-inline-optimization &#8211;with-dom-dir=/usr &#8211;with-gd &#8211;with-freetype-dir=/usr &#8211;with-png-dir=/usr/ &#8211;with-jpeg-dir=/usr &#8211;with-zlib &#8211;enable-track-vars       <br />#make &amp;&amp; make install      <br />#cp&#160; php.ini-production /etc/php.ini      <br />#vim /etc/php.ini      <br />&#160; 修改short_open_tag = Off      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; magic_quotes_gpc = off      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; extension_dir = &quot;/usr/lib/php/modules&quot;      </p>
<p>#cd /home/src/       <br />#svn co &quot;<a href="http://svn.kcn.cn/repos/kbs/trunk/kbs_bbs">http://svn.kcn.cn/repos/kbs/trunk/kbs_bbs</a>&quot;       <br />#cd kbs_bbs/       <br />#./configure &#8211;prefix=/home/bbs &#8211;enable-site=jmubbs –with-php=/home/www/php &#8211;with-mysql=/usr/local/mysql &#8211;enable-ssh &#8211;enable-ssl       <br />#make &amp;&amp; make install       </p>
<p>#cd /home/src/       <br />#svn co <a href="http://svn.kcn.cn/repos/kbs/trunk/www2">http://svn.kcn.cn/repos/kbs/trunk/www2</a>       <br />#cd /home/www/       <br />#ln –s ../src/www2 htdocs </p>
</blockquote>
<p><font face="微软雅黑" size="2">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 三、安装编译配置Subversion版本控制</font></p>
<blockquote><p>1、安装编译支持：apr、apr-util     <br />#cd /home/src      <br />#wget <a href="http://www.sqlite.org/sqlite-amalgamation-3.6.13.tar.gz">http://www.sqlite.org/sqlite-amalgamation-3.6.13.tar.gz</a>      <br />#tar zxvf sqlite-amalgamation-3.6.13.tar.gz      <br />#cd sqlite-3.6.13/      <br />#./configure      <br />#make &amp;&amp; make install      <br />#tar zvxf apr-1.3.3.tar.gz      <br />#tar zvxf apr-util-1.3.4.tar.gz      <br />#tar zvxf zlib-1.2.3.tar.gz      <br />#cd apr-1.3.3      <br />#./configure &#8211;prefix=/usr/local/apr      <br />#make &amp;&amp; make install      <br />#cd ../apr-util-1.3.4      <br />#./configure&#160; &#8211;with-apr=/usr/local/apr      <br />#make &amp;&amp; make install      <br />#cd ../zlib-1.2.3      <br />#./configure&#160; &#8211;prefix=/usr/local/zlib      <br />#make &amp;&amp; make install      <br />2、重新编译apache及全新编译安装subversion      <br />#cd /home/src/httpd-2.2.11      <br />#./configure &#8211;prefix=/home/www &#8211;enable-so &#8211;enable-rewrite &#8211;enable-dav &#8211;with-apr=/usr/local/apr/bin/apr-1-config &#8211;with-apr-util=/usr/local/apr/bin/apu-1-config      <br />#make &amp;&amp; make install      <br />#cd /home/src/subversion-1.6.9/      <br />#./configure &#8211;prefix=/home/subversion &#8211;with-apxs=/home/www/bin/apxs &#8211;with-apr=/usr/local/apr/bin/apr-1-config &#8211;with-apr-util=/usr/local/apr/bin/apu-1-config &#8211;with-ssl &#8211;with-zlib –enable-maintainer-mode      <br />#make &amp;&amp; make install      <br />3、配置Subversion      <br />a、创建账号密码：      <br />#htpasswd –c /home/svndata/www/conf/passwd yousri       <br />注：需输两次密码确认；第一次设置用户密码要加入 –c 这个参数，以后就可以不用了      <br />b、创建资料库：      <br />#/home/subversion/bin/svnadmin create /home/svndata/www      <br />c、确认apache配置文件httpd.conf ,默认应该增加了一下两个模块加载：      <br />LoadModule dav_svn_module&#160;&#160;&#160;&#160; modules/mod_dav_svn.so      <br />LoadModule authz_svn_module&#160;&#160; modules/mod_authz_svn.so      <br />同时添加增加一下配置信息：      <br />&lt;Location /svn&gt;      <br />&#160;&#160;&#160; DAV svn      <br />&#160;&#160;&#160; SVNPath /home/svndata/www      <br />&#160;&#160;&#160; AuthType Basic      <br />&#160;&#160;&#160; AuthName &quot;Subversion repository&quot;      <br />&#160;&#160;&#160; AuthUserFile /home/svndata/www/conf/passwd      <br />&#1<br />
60<br />
;&#160;&#160; Require valid-user      <br />&lt;/Location&gt;      <br />最后设置/home/svndata目录权限设置为755并重启apache服务      <br />d、导入数据至资料库      <br />#/home/subversion/bin/svn import /home/www/htdocs <a href="///home/svndata/www">file:///home/svndata/www</a> –m “web code”      <br />浏览访问测试：<a href="http://jmxc.vicp.net:20102/svn">http://jmxc.vicp.net:20102/svn</a></p>
</blockquote>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.yousri.org%2F2009%2F05%2F16%2F%25E5%25AE%2589%25E8%25A3%2585%25E9%2585%258D%25E7%25BD%25AE%25E5%259F%25BA%25E4%25BA%258Ekbs%25E7%25A8%258B%25E5%25BA%258F%25E7%259A%2584bbs%25E7%25B3%25BB%25E7%25BB%259F.html&from=http%3A%2F%2Fblog.yousri.org%2F2010%2F02%2F25%2Finstall_apache_and_subversion.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">安装配置基于KBS程序的BBS系统</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.yousri.org%2F2008%2F08%2F06%2Flamp.html&from=http%3A%2F%2Fblog.yousri.org%2F2010%2F02%2F25%2Finstall_apache_and_subversion.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Ubuntu 8.04里LAMP手动编译安装架构纪录</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.yousri.org%2F2009%2F04%2F12%2Fapache%25E6%25BD%259C%25E5%259C%25A8%25E6%25BC%258F%25E6%25B4%259E.html&from=http%3A%2F%2Fblog.yousri.org%2F2010%2F02%2F25%2Finstall_apache_and_subversion.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Apache潜在漏洞</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.yousri.org%2F2008%2F08%2F28%2Fapache_tomcat_install.html&from=http%3A%2F%2Fblog.yousri.org%2F2010%2F02%2F25%2Finstall_apache_and_subversion.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Apache与Tomcat整合</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://blog.yousri.org/2010/02/25/install_apache_and_subversion.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Dokuwiki重写URL配置</title>
		<link>http://blog.yousri.org/2009/05/27/dokuwiki%e9%87%8d%e5%86%99url%e9%85%8d%e7%bd%ae.html</link>
		<comments>http://blog.yousri.org/2009/05/27/dokuwiki%e9%87%8d%e5%86%99url%e9%85%8d%e7%bd%ae.html#comments</comments>
		<pubDate>Wed, 27 May 2009 15:28:03 +0000</pubDate>
		<dc:creator>Yousri</dc:creator>
				<category><![CDATA[技术]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[dokuwiki]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[URL重写]]></category>

		<guid isPermaLink="false">http://qingxianyan.cn/?p=334</guid>
		<description><![CDATA[默认情况下，DokuWiki不做任何的URL重写，它的原始URL是这样的：1. http://wiki.qingxianyan.cn/doku.php?id=page这样默认的URL不利于有些搜索引擎不收录，而且也不易于记忆 通过设置DokuWiki的配置设置里面的高级设置的userwrite配置选项它可以支持两种URL重写方法：&#160;&#160;&#160;&#160;&#160; 一个是利用服务器的mod_rewrite，&#160;&#160;&#160;&#160;&#160; 另一个是在DokuWiki内部自己处理URL重写。下面是userewrite选项值的列表及其对应的URL格式：&#160;&#160;&#160;&#160;&#160; 1、默认值没有URL重写 http://wiki.qingxianyan.cn/doku.php?id=wiki:syntax&#160;&#160;&#160;&#160;&#160; 2、htaccess服务器处理 http://wiki.qingxianyan.cn/wiki:syntax&#160;&#160;&#160;&#160;&#160; 3、DokuWiki处理 http://wiki.qingxianyan.cn/doku.php/wiki:syntax使用服务器处理　　先在/wiki/conf/dokuwiki.php中设置：&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $conf['userewrite'] = 1; Apache服务器开启Rewrite功能 　　apache的URL重写是使用mod_rewrite模块。在apache的配置文件中添加如下这行： LoadModule rewrite_module modules/mod_rewrite.so 　　然后使用mod_rewrte的指令来配置URL重写规则。这些规则可以放在apache的全局配置文件内，也可以放在DokuWiki的根目录下的.htaccess文件内，事实上DokuWiki已经为了写好了这些规则放在.htaccess.dist中，修改删除部分“#”注释即可 内容如下： RewriteEngine on RewriteBase /dokuwiki RewriteRule ^_media/(.*) lib/exe/fetch.php?media=$1 [QSA,L] RewriteRule ^_detail/(.*) lib/exe/detail.php?media=$1 [QSA,L] RewriteRule ^_export/([^/]+)/(.*) doku.php?do=export_$1&#38;id=$2 [QSA,L] RewriteRule ^$ doku.php [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule (.*) doku.php?id=$1 [QSA,L] 　　在RewriteBase /dokuwiki这一行，你需要根据实际情况做修改成指向你的DokuWiki目录的路径，Dokuwik就在站点根目录或者已经使用子域名解析到相应目录时，需将.htaccess 文件中的 RewriteBase <a href='http://blog.yousri.org/2009/05/27/dokuwiki%e9%87%8d%e5%86%99url%e9%85%8d%e7%bd%ae.html'>[...]</a><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.yousri.org%2F2010%2F05%2F15%2Fhow-to-upgrade-dokuwiki.html&from=http%3A%2F%2Fblog.yousri.org%2F2009%2F05%2F27%2Fdokuwiki%25E9%2587%258D%25E5%2586%2599url%25E9%2585%258D%25E7%25BD%25AE.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">相对靠谱的Dokuwiki升级方法</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.yousri.org%2F2010%2F02%2F25%2Finstall_apache_and_subversion.html&from=http%3A%2F%2Fblog.yousri.org%2F2009%2F05%2F27%2Fdokuwiki%25E9%2587%258D%25E5%2586%2599url%25E9%2585%258D%25E7%25BD%25AE.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Apache编译安装配置并支持Subversion版本控制</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.yousri.org%2F2009%2F04%2F19%2F%25E5%258A%25A0%25E5%25BC%25BAapache%25E9%2585%258D%25E7%25BD%25AE%25E7%259A%2584%25E5%25AE%2589%25E5%2585%25A8%25E6%2596%25B9%25E6%25B3%2595%25E3%2580%2590%25E8%25BD%25AC%25E3%2580%2591.html&from=http%3A%2F%2Fblog.yousri.org%2F2009%2F05%2F27%2Fdokuwiki%25E9%2587%258D%25E5%2586%2599url%25E9%2585%258D%25E7%25BD%25AE.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">加强Apache配置的安全方法</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.yousri.org%2F2009%2F04%2F12%2Fapache%25E6%25BD%259C%25E5%259C%25A8%25E6%25BC%258F%25E6%25B4%259E.html&from=http%3A%2F%2Fblog.yousri.org%2F2009%2F05%2F27%2Fdokuwiki%25E9%2587%258D%25E5%2586%2599url%25E9%2585%258D%25E7%25BD%25AE.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Apache潜在漏洞</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>默认情况下，DokuWiki不做任何的URL重写，它的原始URL是这样的：<br />1. http://wiki.qingxianyan.cn/doku.php?id=page<br />这样默认的URL不利于有些搜索引擎不收录，而且也不易于记忆<br />
通过设置DokuWiki的配置设置里面的高级设置的userwrite配置选项它可以支持两种URL重写方法：<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 一个是利用服务器的mod_rewrite，<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 另一个是在DokuWiki内部自己处理URL重写。<br />下面是userewrite选项值的列表及其对应的URL格式：<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1、默认值没有URL重写 http://wiki.qingxianyan.cn/doku.php?id=wiki:syntax<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2、htaccess服务器处理 http://wiki.qingxianyan.cn/wiki:syntax<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3、DokuWiki处理 http://wiki.qingxianyan.cn/doku.php/wiki:syntax<br />使用服务器处理<br />　　先在/wiki/conf/dokuwiki.php中设置：<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $conf['userewrite'] = 1;<br />
Apache服务器开启Rewrite功能<br />
　　apache的URL重写是使用mod_rewrite模块。在apache的配置文件中添加如下这行：</p>
<pre lang="apache">LoadModule rewrite_module modules/mod_rewrite.so</pre>
<p>　　然后使用mod_rewrte的指令来配置URL重写规则。这些规则可以放在apache的全局配置文件内，也可以放在DokuWiki的根目录下的.htaccess文件内，事实上DokuWiki已经为了写好了这些规则放在.htaccess.dist中，修改删除部分“#”注释即可  内容如下：</p>
<pre lang="apache">
      RewriteEngine on
      RewriteBase /dokuwiki
      RewriteRule ^_media/(.*)              lib/exe/fetch.php?media=$1  [QSA,L]
      RewriteRule ^_detail/(.*)             lib/exe/detail.php?media=$1  [QSA,L]
      RewriteRule ^_export/([^/]+)/(.*)     doku.php?do=export_$1&amp;id=$2  [QSA,L]
      RewriteRule ^$                        doku.php  [L]
      RewriteCond %{REQUEST_FILENAME}       !-f
      RewriteCond %{REQUEST_FILENAME}       !-d
      RewriteRule (.*)                      doku.php?id=$1  [QSA,L]
</pre>
<p>　　在RewriteBase /dokuwiki这一行，你需要根据实际情况做修改成指向你的DokuWiki目录的路径，Dokuwik就在站点根目录或者已经使用子域名解析到相应目录时，需将.htaccess 文件中的 RewriteBase /dokuwiki 行使用首字符“#”将其注释</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.yousri.org%2F2010%2F05%2F15%2Fhow-to-upgrade-dokuwiki.html&from=http%3A%2F%2Fblog.yousri.org%2F2009%2F05%2F27%2Fdokuwiki%25E9%2587%258D%25E5%2586%2599url%25E9%2585%258D%25E7%25BD%25AE.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">相对靠谱的Dokuwiki升级方法</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.yousri.org%2F2010%2F02%2F25%2Finstall_apache_and_subversion.html&from=http%3A%2F%2Fblog.yousri.org%2F2009%2F05%2F27%2Fdokuwiki%25E9%2587%258D%25E5%2586%2599url%25E9%2585%258D%25E7%25BD%25AE.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Apache编译安装配置并支持Subversion版本控制</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.yousri.org%2F2009%2F04%2F19%2F%25E5%258A%25A0%25E5%25BC%25BAapache%25E9%2585%258D%25E7%25BD%25AE%25E7%259A%2584%25E5%25AE%2589%25E5%2585%25A8%25E6%2596%25B9%25E6%25B3%2595%25E3%2580%2590%25E8%25BD%25AC%25E3%2580%2591.html&from=http%3A%2F%2Fblog.yousri.org%2F2009%2F05%2F27%2Fdokuwiki%25E9%2587%258D%25E5%2586%2599url%25E9%2585%258D%25E7%25BD%25AE.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">加强Apache配置的安全方法</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.yousri.org%2F2009%2F04%2F12%2Fapache%25E6%25BD%259C%25E5%259C%25A8%25E6%25BC%258F%25E6%25B4%259E.html&from=http%3A%2F%2Fblog.yousri.org%2F2009%2F05%2F27%2Fdokuwiki%25E9%2587%258D%25E5%2586%2599url%25E9%2585%258D%25E7%25BD%25AE.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Apache潜在漏洞</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://blog.yousri.org/2009/05/27/dokuwiki%e9%87%8d%e5%86%99url%e9%85%8d%e7%bd%ae.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>加强Apache配置的安全方法</title>
		<link>http://blog.yousri.org/2009/04/19/%e5%8a%a0%e5%bc%baapache%e9%85%8d%e7%bd%ae%e7%9a%84%e5%ae%89%e5%85%a8%e6%96%b9%e6%b3%95%e3%80%90%e8%bd%ac%e3%80%91.html</link>
		<comments>http://blog.yousri.org/2009/04/19/%e5%8a%a0%e5%bc%baapache%e9%85%8d%e7%bd%ae%e7%9a%84%e5%ae%89%e5%85%a8%e6%96%b9%e6%b3%95%e3%80%90%e8%bd%ac%e3%80%91.html#comments</comments>
		<pubDate>Sun, 19 Apr 2009 08:36:18 +0000</pubDate>
		<dc:creator>Yousri</dc:creator>
				<category><![CDATA[技术]]></category>
		<category><![CDATA[Apache]]></category>

		<guid isPermaLink="false">http://qingxianyan.cn/?p=314</guid>
		<description><![CDATA[一、确保你安装的是最新的补丁 &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 如果门是敞开的话，在窗户上加锁就毫无意义。同样道理，如果你没有打补丁，继续下面的操作就没有什么必要。 二、隐藏Apache的版本号及其它敏感信息 &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 默认情况下，很多Apache安装时会显示版本号及操作系统版本，甚至会显示服务器上安装的是什么样的Apache模块。这些信息可以为黑客所用，并且黑客还可以从中得知你所配置的服务器上的很多设置都是默认状态。 &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 这里有两条语句，你需要添加到你的httpd.conf文件中： ServerSignature Off ServerTokens Prod &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ServerSignature出现在Apache所产生的像404页面、目录列表等页面的底部。ServerTokens目录被用来判断 Apache会在Server HTTP响应包的头部填充什么信息。如果把ServerTokens设为Prod，那么HTTP响应包头就会被设置成： Server：Apache &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 如果你非常想尝试其它事物，你可以通过编辑源代码改成不是Apache的其它东西，或者你可以通过下面将要介绍的mod_security实现。 三、确保Apache以其自身的用户账号和组运行 &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 有的Apache安装过程使得服务器以nobody的用户运行，所以，假定Apache和你的邮件服务器都是以nobody的账号运行的，那么通过Apache发起的攻击就可能同时攻击到邮件服务器，反之亦然。 User apache Group apache 四、确保web根目录之外的文件没有提供服务 &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 我们不让Apache访问web根目录之外的任何文件。假设你的所以web站点文件都放在一个目录下（例如/web），你可以如下设置： Order Deny,Allow Deny from all Options None AllowOverride None Order Allow,Deny Allow from all &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 注意，因为我们设置Opitins None 和AllowOverride None，这将关闭服务器的所有Option和Override。你现在必须明确把每个目录设置成Option或者Override。 五、关闭目录浏览 &#160;&#160;&#160;&#160;&#160;&#160;你可以在Directory标签内用Option命令来实现这个功能。设置Option为None或者－Indexes。 &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Options -Indexes 六、关闭includes &#160;&#160;&#160;&#160;&#160;&#160;这也可以通过在Directory标签内使用Option命令来实现。设置Option为None或者－Includes。 <a href='http://blog.yousri.org/2009/04/19/%e5%8a%a0%e5%bc%baapache%e9%85%8d%e7%bd%ae%e7%9a%84%e5%ae%89%e5%85%a8%e6%96%b9%e6%b3%95%e3%80%90%e8%bd%ac%e3%80%91.html'>[...]</a><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.yousri.org%2F2009%2F04%2F12%2Fapache%25E6%25BD%259C%25E5%259C%25A8%25E6%25BC%258F%25E6%25B4%259E.html&from=http%3A%2F%2Fblog.yousri.org%2F2009%2F04%2F19%2F%25E5%258A%25A0%25E5%25BC%25BAapache%25E9%2585%258D%25E7%25BD%25AE%25E7%259A%2584%25E5%25AE%2589%25E5%2585%25A8%25E6%2596%25B9%25E6%25B3%2595%25E3%2580%2590%25E8%25BD%25AC%25E3%2580%2591.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Apache潜在漏洞</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.yousri.org%2F2008%2F08%2F28%2Fapache_tomcat_install.html&from=http%3A%2F%2Fblog.yousri.org%2F2009%2F04%2F19%2F%25E5%258A%25A0%25E5%25BC%25BAapache%25E9%2585%258D%25E7%25BD%25AE%25E7%259A%2584%25E5%25AE%2589%25E5%2585%25A8%25E6%2596%25B9%25E6%25B3%2595%25E3%2580%2590%25E8%25BD%25AC%25E3%2580%2591.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Apache与Tomcat整合</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.yousri.org%2F2010%2F02%2F25%2Finstall_apache_and_subversion.html&from=http%3A%2F%2Fblog.yousri.org%2F2009%2F04%2F19%2F%25E5%258A%25A0%25E5%25BC%25BAapache%25E9%2585%258D%25E7%25BD%25AE%25E7%259A%2584%25E5%25AE%2589%25E5%2585%25A8%25E6%2596%25B9%25E6%25B3%2595%25E3%2580%2590%25E8%25BD%25AC%25E3%2580%2591.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Apache编译安装配置并支持Subversion版本控制</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.yousri.org%2F2009%2F05%2F27%2Fdokuwiki%25E9%2587%258D%25E5%2586%2599url%25E9%2585%258D%25E7%25BD%25AE.html&from=http%3A%2F%2Fblog.yousri.org%2F2009%2F04%2F19%2F%25E5%258A%25A0%25E5%25BC%25BAapache%25E9%2585%258D%25E7%25BD%25AE%25E7%259A%2584%25E5%25AE%2589%25E5%2585%25A8%25E6%2596%25B9%25E6%25B3%2595%25E3%2580%2590%25E8%25BD%25AC%25E3%2580%2591.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Dokuwiki重写URL配置</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>一、确保你安装的是最新的补丁<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 如果门是敞开的话，在窗户上加锁就毫无意义。同样道理，如果你没有打补丁，继续下面的操作就没有什么必要。<br />
二、隐藏Apache的版本号及其它敏感信息<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 默认情况下，很多Apache安装时会显示版本号及操作系统版本，甚至会显示服务器上安装的是什么样的Apache模块。这些信息可以为黑客所用，并且黑客还可以从中得知你所配置的服务器上的很多设置都是默认状态。<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 这里有两条语句，你需要添加到你的httpd.conf文件中：</p>
<pre lang="apache">
    ServerSignature Off
    ServerTokens Prod
</pre>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ServerSignature出现在Apache所产生的像404页面、目录列表等页面的底部。ServerTokens目录被用来判断 Apache会在Server HTTP响应包的头部填充什么信息。如果把ServerTokens设为Prod，那么HTTP响应包头就会被设置成：</p>
<pre lang="apache">Server：Apache</pre>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 如果你非常想尝试其它事物，你可以通过编辑源代码改成不是Apache的其它东西，或者你可以通过下面将要介绍的mod_security实现。<br />
三、确保Apache以其自身的用户账号和组运行<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 有的Apache安装过程使得服务器以nobody的用户运行，所以，假定Apache和你的邮件服务器都是以nobody的账号运行的，那么通过Apache发起的攻击就可能同时攻击到邮件服务器，反之亦然。</p>
<pre lang="apache">
    User apache
    Group apache
</pre>
<p>四、确保web根目录之外的文件没有提供服务<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 我们不让Apache访问web根目录之外的任何文件。假设你的所以web站点文件都放在一个目录下（例如/web），你可以如下设置：</p>
<pre lang="apache">
    Order Deny,Allow
    Deny from all
    Options None
    AllowOverride None
    Order Allow,Deny
    Allow from all
</pre>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 注意，因为我们设置Opitins None 和AllowOverride None，这将关闭服务器的所有Option和Override。你现在必须明确把每个目录设置成Option或者Override。<br />
五、关闭目录浏览<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;你可以在Directory标签内用Option命令来实现这个功能。设置Option为None或者－Indexes。<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Options -Indexes<br />
六、关闭includes<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;这也可以通过在Directory标签内使用Option命令来实现。设置Option为None或者－Includes。<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    Options -Includes<br />
七、关闭CGI执行程序<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 如果你不用CGI，那么请把它关闭。在目录标签中把选项设置成None或-ExecCGI就可以：<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    Options -ExecCGI<br />
八、禁止Apache遵循符号链接<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 同上，把选项设置成None或-FollowSymLinks：<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    Options -FollowSymLinks<br />
九、关闭多重选项<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 如果想关闭所有选项，很简单：<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    Options None<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 如果只想关系一些独立的选项，则通过将Options做如下设置可实现：<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    Options -ExecCGI -FollowSymLinks -Indexes<br />
十、关闭对.htaccess文件的支持<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 在一个目录标签中实现：<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    AllowOverride None<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 如果需要重载，则保证这些文件不能够被下载，或者把文件名改成非.htaccess文件。比如，我们可以改成.httpdoverride文件，然后像下面这样阻止所有以.ht打头的文件：</p>
<pre lang="bash">
    AccessFileName .httpdoverride
    Order allow,deny
    Deny from all
    Satisfy All
</pre>
<p>十一、运行mod_security<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Run mod_security是O’Reilly出版社出版的Apache Security一书的作者，Ivan Ristic所写的一个非常好用的一个Apache模块。可以用它实现以下功能：<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    ·简单过滤<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    ·基于过滤的常规表达式<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    ·URL编码验证<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    ·Unicode编码验证<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    ·审计<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    ·空字节攻击防止<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    ·上载存储限制<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    ·服务器身份隐藏<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    ·内置的Chroot支持<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    ·更多其它功能</p>
<p>十二、关闭任何不必要的模块<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Apache通常会安装几个模块，浏览Apache的module documentation，了解已安装的各个模块是做什么用的。很多情况下，你会发现并不需要激活那些模块。<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 找到httpd.conf中包含LoadModule的代码。要关闭这些模块，只需要在代码行前添加一个#号。要找到正在运行的模块，可以用以下语句：</p>
<pre lang="bash">grep LoadModule httpd.conf</pre>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 以下模块通常被激活而并无大用：mod_imap,mod_include,mod_info,mod_userdir,mod_status,mod_cgi,mod_autoindex。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 网络上学习了解收集到的～当作收藏，这东西实用性因人而异，嗯。</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.yousri.org%2F2009%2F04%2F12%2Fapache%25E6%25BD%259C%25E5%259C%25A8%25E6%25BC%258F%25E6%25B4%259E.html&from=http%3A%2F%2Fblog.yousri.org%2F2009%2F04%2F19%2F%25E5%258A%25A0%25E5%25BC%25BAapache%25E9%2585%258D%25E7%25BD%25AE%25E7%259A%2584%25E5%25AE%2589%25E5%2585%25A8%25E6%2596%25B9%25E6%25B3%2595%25E3%2580%2590%25E8%25BD%25AC%25E3%2580%2591.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Apache潜在漏洞</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.yousri.org%2F2008%2F08%2F28%2Fapache_tomcat_install.html&from=http%3A%2F%2Fblog.yousri.org%2F2009%2F04%2F19%2F%25E5%258A%25A0%25E5%25BC%25BAapache%25E9%2585%258D%25E7%25BD%25AE%25E7%259A%2584%25E5%25AE%2589%25E5%2585%25A8%25E6%2596%25B9%25E6%25B3%2595%25E3%2580%2590%25E8%25BD%25AC%25E3%2580%2591.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Apache与Tomcat整合</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.yousri.org%2F2010%2F02%2F25%2Finstall_apache_and_subversion.html&from=http%3A%2F%2Fblog.yousri.org%2F2009%2F04%2F19%2F%25E5%258A%25A0%25E5%25BC%25BAapache%25E9%2585%258D%25E7%25BD%25AE%25E7%259A%2584%25E5%25AE%2589%25E5%2585%25A8%25E6%2596%25B9%25E6%25B3%2595%25E3%2580%2590%25E8%25BD%25AC%25E3%2580%2591.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Apache编译安装配置并支持Subversion版本控制</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.yousri.org%2F2009%2F05%2F27%2Fdokuwiki%25E9%2587%258D%25E5%2586%2599url%25E9%2585%258D%25E7%25BD%25AE.html&from=http%3A%2F%2Fblog.yousri.org%2F2009%2F04%2F19%2F%25E5%258A%25A0%25E5%25BC%25BAapache%25E9%2585%258D%25E7%25BD%25AE%25E7%259A%2584%25E5%25AE%2589%25E5%2585%25A8%25E6%2596%25B9%25E6%25B3%2595%25E3%2580%2590%25E8%25BD%25AC%25E3%2580%2591.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Dokuwiki重写URL配置</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://blog.yousri.org/2009/04/19/%e5%8a%a0%e5%bc%baapache%e9%85%8d%e7%bd%ae%e7%9a%84%e5%ae%89%e5%85%a8%e6%96%b9%e6%b3%95%e3%80%90%e8%bd%ac%e3%80%91.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Apache潜在漏洞</title>
		<link>http://blog.yousri.org/2009/04/12/apache%e6%bd%9c%e5%9c%a8%e6%bc%8f%e6%b4%9e.html</link>
		<comments>http://blog.yousri.org/2009/04/12/apache%e6%bd%9c%e5%9c%a8%e6%bc%8f%e6%b4%9e.html#comments</comments>
		<pubDate>Sun, 12 Apr 2009 09:04:04 +0000</pubDate>
		<dc:creator>Yousri</dc:creator>
				<category><![CDATA[技术]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[漏洞]]></category>

		<guid isPermaLink="false">http://qingxianyan.cn/?p=321</guid>
		<description><![CDATA[&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;很多多论坛网站，都具备有上传附件的的功能，一般都会开放rar附件上传，并可能会保留原来文件名称，这从而可能导致一个很严重的问题，test.php.rar文件可能会被Apache当作php文件来执行，造成一定程度的安全隐患。 &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;如何测试? 当你将某个php程序文件后缀名修改成 test.php.rar，这时测试一下，还是按照PHP文件解析执行，Apache并不会认为这是一个rar文件，这是为什么呢？ &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;其实，因为每遇到一种后双重后缀名(如test.php.rar)的文件，Apache都会去conf/mime.types文件中检查最后一个后缀，如果最后一个后缀并没有在mime.types文件中定义，则使用前一个后缀来解释，因为在默认情况下,rar并未在mime.types中定义，故 Apache会使用php后缀来解释文件，这就是漏洞的原因所在吧。 &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;由此可知,如果使用test.jsp.aaa.rar则会很可能认为是jsp文件，如果修改成test.shtml.rar，则会识别成shtml文件。 &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;如果没有相应修改设置，不知道有多少网站可能存在这个问题? 如何杜绝这个隐患 ? &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;修改Apache相应的配置文件httpd.conf文件内容： AddType application/rar .rar AddType application/x-compressed .rar AddType application/x-rar .rar AddType application/x-rar-compressed .rar AddType application/x-rar-compressed; application/x-compressed .rar AddType compressed/rar; application/x-rar-compressed .rar &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;然后重新启动Apache服务 &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;针对Web管理员及Web程序开发者，如何更安全 &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;1.只允许上传指定后缀名的文件，当然，要禁止掉rar格式文件上传。(但这条往往行不通,一般的网站都需要上传rar文件) &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;2.对上传后的文件名进行强制重命名，强制使用最后一个扩展名，如原始文件名为test.php.rar，上传后强制重命名为20090412.rar即可避免这个隐患 &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;ps：早期版本的phpcms、discuz等貌似存在这个漏洞<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.yousri.org%2F2008%2F08%2F28%2Fapache_tomcat_install.html&from=http%3A%2F%2Fblog.yousri.org%2F2009%2F04%2F12%2Fapache%25E6%25BD%259C%25E5%259C%25A8%25E6%25BC%258F%25E6%25B4%259E.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Apache与Tomcat整合</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.yousri.org%2F2009%2F04%2F19%2F%25E5%258A%25A0%25E5%25BC%25BAapache%25E9%2585%258D%25E7%25BD%25AE%25E7%259A%2584%25E5%25AE%2589%25E5%2585%25A8%25E6%2596%25B9%25E6%25B3%2595%25E3%2580%2590%25E8%25BD%25AC%25E3%2580%2591.html&from=http%3A%2F%2Fblog.yousri.org%2F2009%2F04%2F12%2Fapache%25E6%25BD%259C%25E5%259C%25A8%25E6%25BC%258F%25E6%25B4%259E.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">加强Apache配置的安全方法</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.yousri.org%2F2010%2F02%2F25%2Finstall_apache_and_subversion.html&from=http%3A%2F%2Fblog.yousri.org%2F2009%2F04%2F12%2Fapache%25E6%25BD%259C%25E5%259C%25A8%25E6%25BC%258F%25E6%25B4%259E.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Apache编译安装配置并支持Subversion版本控制</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.yousri.org%2F2008%2F12%2F12%2Fmicrosoft-ie-xml-leak.html&from=http%3A%2F%2Fblog.yousri.org%2F2009%2F04%2F12%2Fapache%25E6%25BD%259C%25E5%259C%25A8%25E6%25BC%258F%25E6%25B4%259E.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">【记录·分享】IE浏览器0DAY漏洞解决措施</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;很多多论坛网站，都具备有上传附件的的功能，一般都会开放rar附件上传，并可能会保留原来文件名称，这从而可能导致一个很严重的问题，test.php.rar文件可能会被Apache当作php文件来执行，造成一定程度的安全隐患。<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;如何测试? 当你将某个php程序文件后缀名修改成 test.php.rar，这时测试一下，还是按照PHP文件解析执行，Apache并不会认为这是一个rar文件，这是为什么呢？<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;其实，因为每遇到一种后双重后缀名(如test.php.rar)的文件，Apache都会去conf/mime.types文件中检查最后一个后缀，如果最后一个后缀并没有在mime.types文件中定义，则使用前一个后缀来解释，因为在默认情况下,rar并未在mime.types中定义，故 Apache会使用php后缀来解释文件，这就是漏洞的原因所在吧。<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;由此可知,如果使用test.jsp.aaa.rar则会很可能认为是jsp文件，如果修改成test.shtml.rar，则会识别成shtml文件。<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;如果没有相应修改设置，不知道有多少网站可能存在这个问题? 如何杜绝这个隐患 ?<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;修改Apache相应的配置文件httpd.conf文件内容：</p>
<pre lang="bash">
    AddType application/rar .rar
    AddType application/x-compressed .rar
    AddType application/x-rar .rar
    AddType application/x-rar-compressed .rar
    AddType application/x-rar-compressed; application/x-compressed .rar
    AddType compressed/rar; application/x-rar-compressed .rar
</pre>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;然后重新启动Apache服务<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;针对Web管理员及Web程序开发者，如何更安全<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1.只允许上传指定后缀名的文件，当然，要禁止掉rar格式文件上传。(但这条往往行不通,一般的网站都需要上传rar文件)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2.对上传后的文件名进行强制重命名，强制使用最后一个扩展名，如原始文件名为test.php.rar，上传后强制重命名为20090412.rar即可避免这个隐患<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ps：早期版本的phpcms、discuz等貌似存在这个漏洞</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.yousri.org%2F2008%2F08%2F28%2Fapache_tomcat_install.html&from=http%3A%2F%2Fblog.yousri.org%2F2009%2F04%2F12%2Fapache%25E6%25BD%259C%25E5%259C%25A8%25E6%25BC%258F%25E6%25B4%259E.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Apache与Tomcat整合</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.yousri.org%2F2009%2F04%2F19%2F%25E5%258A%25A0%25E5%25BC%25BAapache%25E9%2585%258D%25E7%25BD%25AE%25E7%259A%2584%25E5%25AE%2589%25E5%2585%25A8%25E6%2596%25B9%25E6%25B3%2595%25E3%2580%2590%25E8%25BD%25AC%25E3%2580%2591.html&from=http%3A%2F%2Fblog.yousri.org%2F2009%2F04%2F12%2Fapache%25E6%25BD%259C%25E5%259C%25A8%25E6%25BC%258F%25E6%25B4%259E.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">加强Apache配置的安全方法</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.yousri.org%2F2010%2F02%2F25%2Finstall_apache_and_subversion.html&from=http%3A%2F%2Fblog.yousri.org%2F2009%2F04%2F12%2Fapache%25E6%25BD%259C%25E5%259C%25A8%25E6%25BC%258F%25E6%25B4%259E.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Apache编译安装配置并支持Subversion版本控制</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.yousri.org%2F2008%2F12%2F12%2Fmicrosoft-ie-xml-leak.html&from=http%3A%2F%2Fblog.yousri.org%2F2009%2F04%2F12%2Fapache%25E6%25BD%259C%25E5%259C%25A8%25E6%25BC%258F%25E6%25B4%259E.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">【记录·分享】IE浏览器0DAY漏洞解决措施</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://blog.yousri.org/2009/04/12/apache%e6%bd%9c%e5%9c%a8%e6%bc%8f%e6%b4%9e.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apache与Tomcat整合</title>
		<link>http://blog.yousri.org/2008/08/28/apache_tomcat_install.html</link>
		<comments>http://blog.yousri.org/2008/08/28/apache_tomcat_install.html#comments</comments>
		<pubDate>Thu, 28 Aug 2008 06:07:25 +0000</pubDate>
		<dc:creator>Yousri</dc:creator>
				<category><![CDATA[技术]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[mod_jk]]></category>
		<category><![CDATA[Mod_proxy]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Tomcat]]></category>

		<guid isPermaLink="false">http://xmlinuxers.cn/2008/08/28/apache_tomcat_install/</guid>
		<description><![CDATA[软件版本： Apache_2.2.9-win32-x86-no_ssl-r2.msi Php-5.2.6-Win32.zip Mysql-5.1.26-rc-win32.zip 安装目录： D:/xmlinux/webapp PHP配置： （1）将D:”xmlinuxer”webapp”php5&#8243;目录下的libmysql.dll和php5ts.dll两个文件复制到C:”WINDOWS”system32&#8243;下； （2）将D:”xmlinuxer”webapp”php5&#8243;ext”目录下的php_gb2.dll、php_mysql.dll及 php_mbstring.dll复制到C:”WINDOWS”system32&#8243;下； （3）将D:”xmlinuxer”webapp”php5&#8243;中的php.ini-dest或php.ini-recommended重命名为php.ini复制到C:”WINDOWS”system32&#8243;下； （4）改配置文件php.ini，具体包括： i.extension_dir=”/”改为 extension_dir=”F:/ProgramFiles/PHP5.2/ext”; ii.去掉下面三个表达式前面的“;”,改后如下： extension=php_gd2.dll extension=php_mbstring.dll extension=php_mysql.dll iii.;date.timezone = 修改为 date.timezone = PRC Apache配置httpd.conf文件 加入支持php5和mysql的代码： LoadFile D:/xmlinuxer/webapp/php5/libmysql.dll LoadModule php5_module D:/xmlinuxer/webapp/php5/php5apache2_2.dll PHPIniDir “D:/xmlinuxer/webapp/php5&#8243; AddType application/x-httpd-php .php 整合Apache 与 Tomcat 方案一：mod_jk模块实现 适用于较低版本，在Apache2.2.*以后的的版本上无法成功实现Apache与Tomcat的整合，即使编译模块通过了的话（网上很多文档都是用这种方法的资料，而且都大同小异，我试过了。。。可以模块可以编译通过，但是其实根本实现不了，因为现在mod_jk模块最高版本只支持到Httpd-2.2.4版本的而已，所以对于Apache版本高一点就的话就根本没有mod_jk与之对应的模块实现）所以对此方案测试并不能成功实现。 方案二：mod_proxy代理模块实现 Apache2.2.*以上版本本身已经支持Tomcat了，所以这里用mod_proxy来整合Tomcat打开httpd.conf文件，把 LoadModule proxy_module modules/mod_proxy.so LoadModule proxy_ajp_module modules/mod_proxy_ajp.so 前面的#去掉， 并在文件最后添加 ProxyPass / ajp://127.0.0.1:8009/ ProxyPassReverse <a href='http://blog.yousri.org/2008/08/28/apache_tomcat_install.html'>[...]</a><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.yousri.org%2F2010%2F02%2F25%2Finstall_apache_and_subversion.html&from=http%3A%2F%2Fblog.yousri.org%2F2008%2F08%2F28%2Fapache_tomcat_install.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Apache编译安装配置并支持Subversion版本控制</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.yousri.org%2F2009%2F04%2F12%2Fapache%25E6%25BD%259C%25E5%259C%25A8%25E6%25BC%258F%25E6%25B4%259E.html&from=http%3A%2F%2Fblog.yousri.org%2F2008%2F08%2F28%2Fapache_tomcat_install.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Apache潜在漏洞</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.yousri.org%2F2009%2F04%2F19%2F%25E5%258A%25A0%25E5%25BC%25BAapache%25E9%2585%258D%25E7%25BD%25AE%25E7%259A%2584%25E5%25AE%2589%25E5%2585%25A8%25E6%2596%25B9%25E6%25B3%2595%25E3%2580%2590%25E8%25BD%25AC%25E3%2580%2591.html&from=http%3A%2F%2Fblog.yousri.org%2F2008%2F08%2F28%2Fapache_tomcat_install.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">加强Apache配置的安全方法</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.yousri.org%2F2008%2F08%2F06%2Flamp.html&from=http%3A%2F%2Fblog.yousri.org%2F2008%2F08%2F28%2Fapache_tomcat_install.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Ubuntu 8.04里LAMP手动编译安装架构纪录</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p><span>软件版本：</span></p>
<p><span>Apache_2.2.9-win32-x86-no_ssl-r2.msi</span></p>
<p><span>Php-5.2.6-Win32.zip</span></p>
<p><span>Mysql-5.1.26-rc-win32.zip</span></p>
<p><span>安装目录：</span></p>
<p><span>D:/xmlinux/webapp</span></p>
<p><span>PHP</span><span>配置：</span></p>
<p><span>（</span><span>1</span><span>）将</span><span>D:”xmlinuxer”webapp”php5&#8243;</span><span>目录下的</span><span>libmysql.dll</span><span>和</span><span>php5ts.dll</span><span>两个文件复制到</span><span>C:”WINDOWS”system32&#8243;</span><span>下；</span></p>
<p><span>（</span><span>2</span><span>）将</span><span>D:”xmlinuxer”webapp”php5&#8243;ext”</span><span>目录下的</span><span>php_gb2.dll</span><span>、</span><span>php_mysql.dll</span><span>及</span><span> php_mbstring.dll</span><span>复制到</span><span>C:”WINDOWS”system32&#8243;</span><span>下；</span></p>
<p><span>（</span><span>3</span><span>）将</span><span>D:”xmlinuxer”webapp”php5&#8243;</span><span>中的</span><span>php.ini-dest</span><span>或</span><span>php.ini-recommended</span><span>重命名为</span><span>php.ini</span><span>复制到</span><span>C:”WINDOWS”system32&#8243;</span><span>下；</span></p>
<p><span>（</span><span>4</span><span>）改配置文件</span><span>php.ini</span><span>，具体包括：</span></p>
<p><span>i.extension_dir=”/”</span><span>改为</span><span> extension_dir=”F:/ProgramFiles/PHP5.2/ext”;</span></p>
<p><span>ii.</span><span>去掉下面三个表达式前面的</span><span>“;”,</span><span>改后如下：</span></p>
<p style="margin-left: 21pt"><span>extension=php_gd2.dll</span></p>
<p style="margin-left: 21pt"><span>extension=php_mbstring.dll</span></p>
<p style="margin-left: 21pt"><span>extension=php_mysql.dll</span></p>
<p><span>iii.;date.timezone = </span><span>修改为</span><span> date.timezone = PRC</span></p>
<p><span>Apache</span><span>配置</span><span>httpd.conf</span><span>文件</span></p>
<p><span>加入支持</span><span>php5</span><span>和</span><span>mysql</span><span>的代码：</span></p>
<p><span>LoadFile D:/xmlinuxer/webapp/php5/libmysql.dll</span></p>
<p style="margin-left: 21pt"><span>LoadModule php5_module D:/xmlinuxer/webapp/php5/php5apache2_2.dll</span></p>
<p><span>PHPIniDir “D:/xmlinuxer/webapp/php5&#8243;</span></p>
<p><span>AddType application/x-httpd-php .php</span></p>
<p><span>整合</span><span>Apache </span><span>与</span><span> Tomcat</span></p>
<p><span>方案一：</span><span>mod_jk</span><span>模块实现</span></p>
<p><span>适用于较低版本，在</span><span>Apache2.2.*</span><span>以后的的版本上无法成功实现</span><span>Apache</span><span>与</span><span>Tomcat</span><span>的整合，即使编译模块通过了的话（网上很多文档都是用这种方法的资料，而且都大同小异，我试过了。。。可以模块可以编译通过，但是其实根本实现不了，因为现在</span><span>mod_jk</span><span>模块最高版本只支持到</span><span>Httpd-2.2.4</span><span>版本的而已，所以对于</span><span>Apache</span><span>版本高一点就的话就根本没有</span><span>mod_jk</span><span>与之对应的模块实现）所以对此方案测试并不能成功实现。</span></p>
<p><span>方案二：</span><span>mod_proxy</span><span>代理模块实现</span></p>
<p><span>Apache2.2.*</span><span>以上版本本身已经支持</span><span>Tomcat</span><span>了，所以这里用</span><span>mod_proxy</span><span>来整合</span><span>Tomcat</span><span>打开</span><span>httpd.conf</span><span>文件，把</span></p>
<p><span>LoadModule proxy_module modules/mod_proxy.so</span></p>
<p><span>LoadModule proxy_ajp_module modules/mod_proxy_ajp.so</span></p>
<p><span>前面的</span><span>#</span><span>去掉，</span><span> </span><span>并在文件最后添加</span></p>
<p style="margin-left: 21pt"><span>ProxyPass / ajp://127.0.0.1:8009/</span></p>
<p><span>ProxyPassReverse / ajp://127.0.0.1:8009/</span></p>
<p><span>这样做的话就相当于</span><span>Apache</span><span>把所有</span><span>80</span><span>端口的请求都转发给了</span><span>Tomcat</span><span>的</span><span>8009</span><span>（</span><span>ProxyPass /  ajp://127.0.0.1:8009/ </span><span>；</span><span>ProxyPassReverse  /  ajp://127.0.0.1:8009/</span><span>），都由</span><span>Tomcat</span><span>处理请求，这时的</span><span>Apache</span><span>只相当于一个转发器的作用，由</span><span>Tomcat</span><span>解析。此时要是关闭</span><span>Tomcat</span><span>服务，再访问还会出现</span><span>503 Service Temporarily Unavailable </span><span>错误！</span></p>
<p><span>Service Temporarily Unavailable</span></p>
<p><span>The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.</span></p>
<p><span> 但是我们想实现的是将请求中静态的页面交给</span><span>Apache</span><span>处理，动态请求交给</span><span>Aomcat</span><span>处理。因为他们在各自的处理效率上比较高，这才是整合</span><span>Apache</span><span>和</span><span>Tomcat</span><span>的真正目的作用。</span></p>
<p><span>这里要实现将</span><span>html</span><span>交给</span><span>Apache</span><span>处理，而把</span><span>jsp</span><span>转发给</span><span>Tomcat</span><span>处理。还需要多刚刚修改的</span><span>httpd.conf</span><span>进行完善，排除掉</span><span>Tomcat</span><span>对静态文件的解析过滤。</span></p>
<p><span>即在刚刚的</span><span> ProxyPass /  ajp://127.0.0.1:8009 </span><span>前面加入一行</span></p>
<p style="margin-left: 84pt"><span>ProxyPass /web/ !</span></p>
<p><span>插入这行配置的意思是表示</span><span>/web/</span><span>下的文件的请求不转发到</span><span>Tomcat</span><span>进行解析直接由</span><span>Apache</span><span>解析。此时只要把不想转发到</span><span>Tomcat</span><span>处理的放在</span><span>Apache</span><span>安装目录下</span><span>\htdoc\ </span><span>下名为</span><span>web</span><span>文件夹里即可。</span></p>
<p><span>附录：</span></p>
<p><span>Mod-proxy</span><span>的缺点是，当其中一台</span><span>tomcat</span><span>停止运行的时候，</span><span>apache</span><span>仍然会转发请求过去，导致</span><span>502</span><span>网关错误。但是只要服务器再启动就不存在这个问题。如果前置</span><span>Apache</span><span>代理服务器停止运行，所有集群服务将无法对外提供。</span><span> </span></p>
<p><span>Mod-proxy</span><span>优点是</span><span>.</span><span>可以只将</span><span>Apache</span><span>置于公网，节省公网</span><span>IP</span><span>地址资源。可以通过设置来实现</span><span>Apache</span><span>专门负责处理静态网页，让</span><span>Tomcat</span><span>专门负责处理</span><span>JSP</span><span>和</span><span>servlet</span><span>等动态请求。</span></p>
<p><span>参考资料：<a href="http://www.ibm.com/developerworks/cn/opensource/os-lo-apache-tomcat/index.html" target="_blank"><span>IBM Developer Works</span><span><span>中关于</span></span><span>Apache HTTP Server </span><span><span>与</span></span><span> Tomcat </span><span><span>的三种连接方式介绍的描述</span></span></a></span></p>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.yousri.org%2F2010%2F02%2F25%2Finstall_apache_and_subversion.html&from=http%3A%2F%2Fblog.yousri.org%2F2008%2F08%2F28%2Fapache_tomcat_install.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Apache编译安装配置并支持Subversion版本控制</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.yousri.org%2F2009%2F04%2F12%2Fapache%25E6%25BD%259C%25E5%259C%25A8%25E6%25BC%258F%25E6%25B4%259E.html&from=http%3A%2F%2Fblog.yousri.org%2F2008%2F08%2F28%2Fapache_tomcat_install.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Apache潜在漏洞</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.yousri.org%2F2009%2F04%2F19%2F%25E5%258A%25A0%25E5%25BC%25BAapache%25E9%2585%258D%25E7%25BD%25AE%25E7%259A%2584%25E5%25AE%2589%25E5%2585%25A8%25E6%2596%25B9%25E6%25B3%2595%25E3%2580%2590%25E8%25BD%25AC%25E3%2580%2591.html&from=http%3A%2F%2Fblog.yousri.org%2F2008%2F08%2F28%2Fapache_tomcat_install.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">加强Apache配置的安全方法</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.yousri.org%2F2008%2F08%2F06%2Flamp.html&from=http%3A%2F%2Fblog.yousri.org%2F2008%2F08%2F28%2Fapache_tomcat_install.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Ubuntu 8.04里LAMP手动编译安装架构纪录</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://blog.yousri.org/2008/08/28/apache_tomcat_install.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu 8.04里LAMP手动编译安装架构纪录</title>
		<link>http://blog.yousri.org/2008/08/06/lamp.html</link>
		<comments>http://blog.yousri.org/2008/08/06/lamp.html#comments</comments>
		<pubDate>Tue, 05 Aug 2008 20:11:14 +0000</pubDate>
		<dc:creator>Yousri</dc:creator>
				<category><![CDATA[技术]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[LAMP]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://xmlinuxers.cn/2008/08/06/lamp/</guid>
		<description><![CDATA[之前在ubuntu8.04架构LAMP环境的时候都是用包装好的直接新立得进行一步安装搞定。就只有最初刚接触Linux的时候在RedHat下尝试使 用源码手动编译配置安装，但是当初编译了一个晚上最终还是以失败告终就是，对于里头提示缺少类库等问题很是陌生，虽然网上资料很多，但是操作起来每个人有 每个人不同的问题会出现，个人觉得有时问题还是更重要需要自己去一个个的处理掉，这样印象更深刻些，也是唯一措施可以处理好自己所遇到的问题的。 步入正题： 一、mysql安装配置 root@xmlinuxer-server:/media/WinF/LAMP#groupadd mysql root@xmlinuxer-server:/media/WinF/LAMP#useradd -g mysql mysql root@xmlinuxer-server:/media/WinF/LAMP#tar -zxvf mysql-5.0.33.tar.gz root@xmlinuxer-server:/media/WinF/LAMP#cd mysql-5.0.33 root@xmlinuxer-server:/media/WinF/LAMP/mysql-5.0.33#./configure --prefix=/opt/app/mysql5 --without-debug --without-bench --with-charset=utf8 --with-extra-charsets=all --with-plugins=fthightman --enable-thread-safe-client 如果出现了以下错误： checking for tgetent in -ltermcap... no checking for termcap functions library&#8230; configure: error: No curses/termcap library found 说明 curses/termcap 库没有安装 apt-cache search curses &#124; grep lib 安装 libncurses5-dev ，然后重新运行配置 apt-get <a href='http://blog.yousri.org/2008/08/06/lamp.html'>[...]</a><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.yousri.org%2F2008%2F05%2F21%2Fwordpress_install_on_ubuntu_by_lamp.html&from=http%3A%2F%2Fblog.yousri.org%2F2008%2F08%2F06%2Flamp.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Ubuntu7.10 LAMP+WordPress完全安装攻略</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.yousri.org%2F2010%2F02%2F25%2Finstall_apache_and_subversion.html&from=http%3A%2F%2Fblog.yousri.org%2F2008%2F08%2F06%2Flamp.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Apache编译安装配置并支持Subversion版本控制</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.yousri.org%2F2008%2F07%2F08%2Fphp-setting.html&from=http%3A%2F%2Fblog.yousri.org%2F2008%2F08%2F06%2Flamp.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">PHP环境配置过程详解</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.yousri.org%2F2008%2F08%2F03%2Fsoftware_install_in_ubuntu.html&from=http%3A%2F%2Fblog.yousri.org%2F2008%2F08%2F06%2Flamp.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">关于Ubuntu系统软件安装方式</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>之前在ubuntu8.04架构LAMP环境的时候都是用包装好的直接新立得进行一步安装搞定。就只有最初刚接触Linux的时候在RedHat下尝试使 用源码手动编译配置安装，但是当初编译了一个晚上最终还是以失败告终就是，对于里头提示缺少类库等问题很是陌生，虽然网上资料很多，但是操作起来每个人有 每个人不同的问题会出现，个人觉得有时问题还是更重要需要自己去一个个的处理掉，这样印象更深刻些，也是唯一措施可以处理好自己所遇到的问题的。</p>
<p>步入正题：</p>
<p>一、mysql安装配置</p>
<p><code>root@xmlinuxer-server:/media/WinF/LAMP#groupadd mysql<br />
root@xmlinuxer-server:/media/WinF/LAMP#useradd -g mysql mysql<br />
root@xmlinuxer-server:/media/WinF/LAMP#tar -zxvf mysql-5.0.33.tar.gz<br />
root@xmlinuxer-server:/media/WinF/LAMP#cd mysql-5.0.33<br />
root@xmlinuxer-server:/media/WinF/LAMP/mysql-5.0.33#./configure --prefix=/opt/app/mysql5 --without-debug --without-bench --with-charset=utf8 --with-extra-charsets=all --with-plugins=fthightman --enable-thread-safe-client</code></p>
<p>如果出现了以下错误：</p>
<p><code>checking for tgetent in -ltermcap... no</code></p>
<p>checking for termcap functions library&#8230; configure: error: No curses/termcap library found</p>
<p>说明 curses/termcap 库没有安装<br />
apt-cache search curses | grep lib<br />
安装 libncurses5-dev ，然后重新运行配置<br />
apt-get install libncurses5-dev</p>
<p>或者方法二</p>
<p>去下载一个ncurses-5.6.tar.gz，<br />
<code>wget http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.6.tar.gz<br />
tar zxvf ncurses-5.6.tar.gz<br />
cd ncurses-5.6<br />
./configure –prefix=/usr –with-shared –without-debug<br />
make<br />
make install clean</code><br />
然后再重新编译Mysql进行安装。</p>
<p><code>root@xmlinuxer-server:/media/WinF/LAMP/mysql-5.0.33#make<br />
root@xmlinuxer-server:/media/WinF/LAMP/mysql-5.0.33#make install<br />
root@xmlinuxer-server:/media/WinF/LAMP/mysql-5.0.33#cp support-files/my-medium.cnf /etc/my.cnf //复制数据库mysql的配置文件<br />
root@xmlinuxer-server:/media/WinF/LAMP/mysql-5.0.33#cp support-files/mysql.server /etc/init.d/mysql</code></p>
<p>Ubuntu 系统下貌似没有/etc/rc.d这目录 嗯 其他的Linux系统可能是/etc/rc.d/init.d/mysql</p>
<p><code>root@xmlinuxer-server:/media/WinF/LAMP/mysql-5.0.33#cd /opt/app/mysql5<br />
root@xmlinuxer-server:/opt/app/mysql5#bin/mysql_install_db --user=mysql<br />
root@xmlinuxer-server:/opt/app/mysql5#chown -R root . //不要少了后面那个“.”咯<br />
root@xmlinuxer-server:/opt/app/mysql5#chown -R mysql var<br />
root@xmlinuxer-server:/opt/app/mysql5#chgrp -R mysql .</code></p>
<p>root@xmlinuxer-server:/opt/app/mysql5/share/mysql# service mysql start<br />
程序 ’service’ 已包含在以下软件包中：<br />
* debian-helper-scripts<br />
* sysvconfig<br />
试试：apt-get install<br />
bash: service：找不到命令</p>
<p>解决措施：安装下这两个软件包就ok啦 #apt-get install sysvconfig debian-helper-scripts</p>
<p><code>root@xmlinuxer-server:/opt/app/mysql5#bin/mysqld_safe --user=mysql &amp; 或者 service mysql start 启动数据库<br />
root@xmlinuxer-server#/opt/app/mysql5/share/mysql/mysql.server stop 或者 service mysql stop 停止数据库</code></p>
<p>二、安装apache完整配置</p>
<p><code>root@xmlinuxer-server:/media/WinF/LAMP#tar -zxvf httpd-2.2.4.tar.gz //解压包<br />
root@xmlinuxer-server:/media/WinF/LAMP#cd httpd-2.2.4<br />
root@xmlinuxer-server:/media/WinF/LAMP/httpd-2.2.4#./configure --prefix=/opt/app/apache2 --enable-so --with-mysql=/opt/app/mysql5 --enable-cgi --with-config-file-path=/opt/app/apache2/conf --enable-track-vars --enable-mods-shared=all --enable-cache --enable-disk-cache --enable-mem-cache --enable-rewrite --with-mpm=worker --with-z-dir=/opt/app/zlib //配置编译参数</code></p>
<p>这里涉及到关于zlib的安装，下载zlib-1.2.3.tar.gz包编译安装下zlib于/opt/app/zlib下<br />
具体如下：<br />
<code>root@xmlinuxer-server:/media/WinF/LAMP#tar -zxvf zlib-1.2.3.tar.gz<br />
root@xmlinuxer-server:/media/WinF/LAMP#cd zlib-1.2.3<br />
root@xmlinuxer-server:/media/WinF/LAMP/zlib-1.2.3#./configure --prefix=/opt/app/zlib<br />
root@xmlinuxer-server:/media/WinF/LAMP/zlib-1.2.3#make<br />
root@xmlinuxer-server:/media/WinF/LAMP/zlib-1.2.3#make install</code></p>
<p>然后继续编译安装apache环境</p>
<p><code>root@xmlinuxer-server:/media/WinF/LAMP/httpd-2.2.4#make<br />
root@xmlinuxer-server:/media/WinF/LAMP/httpd-2.2.4#make install<br />
root@xmlinuxer-server:/opt/app/apache2# bin/apachectl start<br />
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName</code><br />
因为在httpd的配置文件里面没有制定主机名，所以才会出现这个提示<br />
用浏览器访问一下本地试试（http://127.0.0.1），屏幕上正常就会显示：It works !</p>
<p>三、安装php前GD库的安装：</p>
<p>1.安装 jpeg6<br />
需要自己建立目录<br />
<code>root@xmlinuxer-server:/media/WinF/LAMP/httpd-2.2.4# mkdir /opt/app/jpeg6<br />
root@xmlinuxer-server:/media/WinF/LAMP/httpd-2.2.4# mkdir /opt/app/jpeg6/bin<br />
root@xmlinuxer-server:/media/WinF/LAMP/httpd-2.2.4# mkdir /opt/app/jpeg6/lib<br />
root@xmlinuxer-server:/media/WinF/LAMP/httpd-2.2.4# mkdir /opt/app/jpeg6/include<br />
root@xmlinuxer-server:/media/WinF/LAMP/httpd-2.2.4# mkdir /opt/app/jpeg6/man<br />
root@xmlinuxer-server:/media/WinF/LAMP/httpd-2.2.4# mkdir /opt/app/jpeg6/man/man1<br />
root@xmlinuxer-server:/media/WinF/LAMP/httpd-2.2.4# cd..<br />
root@xmlinuxer-server:/media/WinF/LAMP# tar -zxvf jpegsrc.v6b.tar.gz<br />
root@xmlinuxer-server:/media/WinF/LAMP# cd jpegsrc.v6b<br />
root@xmlinuxer-server:/media/WinF/LAMP/jpegsrc.v6b#./configure --prefix=/opt/app/jpeg6/ --enable-shared --enable-static<br />
root@xmlinuxer-server:/media/WinF/LAMP/jpegsrc.v6b# make; make install</code></p>
<p>2.安装 libpng<br />
<code>root@xmlinuxer-server:/media/WinF/LAMP/jpegsrc.v6b# cd ..<br />
root@xmlinuxer-server:/media/WinF/LAMP# tar -jxvf libpng-1.2.8.tar.bz2<br />
root@xmlinuxer-server:/media/WinF/LAMP# cd libpng-1.2.8<br />
root@xmlinuxer-server:/media/WinF/LAMP/libpng-1.2.8# cp scripts/makefile.std /media/WinF/LAMP/libpng-1.2.8/makefile<br />
root@xmlinuxer-server:/media/WinF/LAMP/libpng-1.2.8# make; make install</code></p>
<p>3.安装 freetype<br />
<code>root@xmlinuxer-server:/media/WinF/LAMP/libpng-1.2.8# cd ..<br />
root@xmlinuxer-server:/media/WinF/LAMP# tar -zxvf freetype-2.3.2.tar.gz<br />
root@xmlinuxer-server:/media/WinF/LAMP# cd freetype-2.3.2<br />
root@xmlinuxer-server:/media/WinF/LAMP/freetype-2.3.2# ./configure --prefix=/opt/app/freetype<br />
root@xmlinuxer-server:/media/WinF/LAMP/freetype-2.3.2# make;make install</code></p>
<p>4.安装libXML2<br />
<code>root@xmlinuxer-server:/media/WinF/LAMP/freetype-2.3.2# cd ..<br />
root@xmlinuxer-server:/media/WinF/LAMP# tar -jxvf libxml2-2.6.24.tar.bz2<br />
root@xmlinuxer-server:/media/WinF/LAMP# cd libxml2-2.6.24<br />
root@xmlinuxer-server:/media/WinF/LAMP/libxml2-2.6.24# ./configure --prefix=/opt/app/libxml<br />
root@xmlinuxer-server:/media/WinF/LAMP/libxml2-2.6.24# make<br />
root@xmlinuxer-server:/media/WinF/LAMP/libxml2-2.6.24# make install</code></p>
<p>5.安装 GD2<br />
<code>root@xmlinuxer-server:/media/WinF/LAMP/libxml2-2.6.24# cd ..<br />
root@xmlinuxer-server:/media/WinF/LAMP# tar -zxvf gd-2.0.34.tar.gz<br />
root@xmlinuxer-server:/media/WinF/LAMP# cd gd-2.0.34<br />
root@xmlinuxer-server:/media/WinF/LAMP/gd-2.0.34#./configure --prefix=/opt/app/gd --with-jpeg=/opt/app/jpeg6 --with-png=/usr/local/lib --with-zlib=/opt/app/zlib --with-freetype=/opt/app/freetype<br />
root@xmlinuxer-server:/media/WinF/LAMP/gd-2.0.34# make<br />
root@xmlinuxer-server:/media/WinF/LAMP/gd-2.0.34# make install</code></p>
<p>＃安装PHP完整配置</p>
<p><code>root@xmlinuxer-server:/media/WinF/LAMP#tar -zxvf php-5.2.0.tar.gz<br />
root@xmlinuxer-server:/media/WinF/LAMP#cd php-5.2.0<br />
root@xmlinuxer-server:/media/WinF/LAMP/php-5.2.0#./configure --prefix=/opt/app/php5 --with-libxml-dir=/opt/app/libxml --with-gd=/opt/app/gd --with-jpeg-dir=/opt/app/jpeg6 --with-zlib-dir=/opt/app/zlib --with-libpng-dir=/usr/local/lib --with-freetype-dir=/opt/app/freetype --enable-mbstring --with-apxs2=/opt/app/apache2/bin/apxs --with-mysql=/opt/app/mysql5 --with-config-file-path=/opt/app/php5/etc</code></p>
<p>可能会有提示错误，编译安装下flex包：#apt-get install flex 再重新编译下就OK啦</p>
<p><code>root@xmlinuxer-server:/media/WinF/LAMP/php-5.2.0#cp php.ini-dist /opt/app/php5/etc/php.ini<br />
root@xmlinuxer-server:/media/WinF/LAMP/php-5.2.0#make<br />
root@xmlinuxer-server:/media/WinF/LAMP/php-5.2.0#make install</code></p>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.yousri.org%2F2008%2F05%2F21%2Fwordpress_install_on_ubuntu_by_lamp.html&from=http%3A%2F%2Fblog.yousri.org%2F2008%2F08%2F06%2Flamp.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Ubuntu7.10 LAMP+WordPress完全安装攻略</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.yousri.org%2F2010%2F02%2F25%2Finstall_apache_and_subversion.html&from=http%3A%2F%2Fblog.yousri.org%2F2008%2F08%2F06%2Flamp.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Apache编译安装配置并支持Subversion版本控制</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.yousri.org%2F2008%2F07%2F08%2Fphp-setting.html&from=http%3A%2F%2Fblog.yousri.org%2F2008%2F08%2F06%2Flamp.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">PHP环境配置过程详解</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.yousri.org%2F2008%2F08%2F03%2Fsoftware_install_in_ubuntu.html&from=http%3A%2F%2Fblog.yousri.org%2F2008%2F08%2F06%2Flamp.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">关于Ubuntu系统软件安装方式</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://blog.yousri.org/2008/08/06/lamp.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

