1201.html

来自「著名的linux英雄站点的文档打包」· HTML 代码 · 共 590 行 · 第 1/3 页

HTML
590
字号
#比如:需要在~/username/下调试php可以将<br>
LoadModule userdir_module libexec/mod_userdir.so<br>
#比如:需要将以前的URL进行转向或者需要使用CGI script-alias<br>
LoadModule alias_module libexec/mod_alias.so<br>
<br>
常用的模块:<br>
最常用的可能就是php和JAVA WEB应用的wrapper,此外,从性能上讲:mod_gzip可以减少40%左右的流量,从而减少机器用于传输的负载,而mod_expires可以减少10%左右的重复请求,让重复的用户请求CACHE在本地,根本不向服务器发出请求。<br>
<br>
建议将所有MODULE的配置都放到<br>
<br>
PHP的安装:<br>
/path/to/php_src/configure --with-apxs=/path/to/apache/bin/apxs --with-other-modules-you-need<br>
需要修改的配置:<br>
AddType application/x-httpd-php .php .php3 .any_file_in_php<br>
<br>
resin的安装设置:<br>
/path/to/resin/src/configure --with-apxs=/path/to/apache/bin/apxs <br>
<br>
一般将具体的resin设置放在另外一个文件中:<br>
&lt;IfModule mod_caucho.c&gt;<br>
CauchoConfigFile /path/to/apache/conf/resin.conf<br>
&lt;/IfModule&gt;<br>
<br>
mod_expires的安装配置:<br>
&lt;IfModule mod_expires.c&gt; <br>
ExpiresActive on<br>
#所有的.gif文件1个月以后过期<br>
ExpiresByType image/gif "access plus 1 month"<br>
#所有的文件缺省1天以后过期<br>
ExpiresDefault "now plus 1 day"<br>
&lt;/IfModule&gt;<br>
<br>
mod_gzip的安装:<br>
/path/to/apache/bin/apxs -i -a -c mod_gzip.c<br>
<br>
mod_gzip和PHP在一起的配置<br>
&lt;IfModule mod_gzip.c&gt;<br>
mod_gzip_on Yes<br>
mod_gzip_minimum_file_size 1000<br>
mod_gzip_maximum_file_size 300000 <br>
mod_gzip_item_include file .htm$<br>
mod_gzip_item_include file .html$<br>
mod_gzip_item_include file .php$<br>
mod_gzip_item_include file .php3$<br>
mod_gzip_item_include mime text/.*<br>
mod_gzip_item_include mime httpd/unix-directory <br>
#不要让mod_gzip和php的session使用同一个临时目录:php_session需要通过php.ini设置session.save_path = /tmp/php_sess<br>
mod_gzip_temp_dir /tmp/mod_gzip<br>
mod_gzip_dechunk Yes<br>
mod_gzip_keep_workfiles No<br>
&lt;/IfModule&gt;<br>
mod_gzip和mod_php的配合:不要让mod_gzip和mod_php使用同一个临时目录;<br>
<br>
mod_gzip和RESIN配合:要让mod_gzip在mod_caucho后LOAD,否则mod_gzip不起作用<br>
...othr modules<br>
AddModule mod_so.c<br>
AddModule mod_caucho.c<br>
#notice: mod_gzip must load after mod_caucho<br>
AddModule mod_gzip.c<br>
AddModule mod_expires.c<br>
...<br>
<br>
&lt;IFModule mod_gzip.c&gt;<br>
mod_gzip_on Yes<br>
mod_gzip_dechunk yes<br>
mod_gzip_keep_workfiles No<br>
mod_gzip_minimum_file_size 3000<br>
mod_gzip_maximum_file_size 300000 <br>
mod_gzip_item_include file .html$<br>
mod_gzip_item_include mime text/.*<br>
mod_gzip_item_include mime httpd/unix-directory<br>
mod_gzip_item_include handler 'caucho-request'<br>
&lt;/IFModule&gt;<br>
<br>
日志轮循工具cronolog的安装和设置:cronolog可以非常整齐的将日志按天轮循存储<br>
缺省编译安装到/usr/local/bin/下,只需要将配置改成:<br>
<br>
CustomLog "|/usr/local/sbin/cronolog /path/to/apache/logs/%w/access_log" combined<br>
<br>
日志将按天截断并存放在以weekday为目录名的目录下:比如:log/1是周一,log/5是周五, log/0是周日<br>
<br>
升级维护:<br>
<br>
由于使用标准化的DSO模式安装APACHE,APACHE的HTTPD核心服务和应用模块以及应用模块之间都变的非常灵活,建议将所有独立模块的配置都放在<br>
&lt;IfModule mod_name&gt;<br>
CONFIGURATIONS..<br>
&lt;/IfModule&gt;<br>
里,这样配置非常容易通过屏蔽某个模块来进行功能调整:比如:<br>
#AddModule mod_gzip.c<br>
就屏蔽了mod_gzip,其他模块不首任何影响。<br>
<br>
安装和维护过程:<br>
<br>
    * 系统安装:系统管理员的职责就是安装系统和一个按照DSO模式安装的APACHE,然后COLON。<br>
    * 应用安装:由应用管理员负责具体应用所需要的模块并设置HTTPD。<br>
    * 系统升级:系统管理员:升级系统/升级APACHE<br>
    * 应用升级:应用管理员:升级应用模块:PHP CAUCHO等<br>
    * 系统备份/恢复:如果APACHE不在缺省的系统盘上,只需要将APACHE目录备份就可以了,遇到系统分区的硬件问题直接使用预先准备好的系统COLON,直接将APACHE所在物理盘恢复就行了。<br>
<br>
系统管理员:APACHE的最简化安装 OS + APACHE(httpd core only)<br>
应用管理员:应用模块定制   +so<br>
+php<br>
+so<br>
+caucho<br>
+ssl<br>
应用: 纯静态页面服务:<br>
image.example.com<br>
www.example.com bbs.example.com mall.example.com<br>
<br>
例子:APACHE和PHP模块的独立升级。<br>
<br>
如果APACHE是按照以下方式安装:<br>
./configure --prefix=/home/apache --enable-shared=max --enable-module=most <br>
PHP是按照以下方式安装:<br>
./configure --with-apxs=/home/apache/bin/apxs --enable-track-vars --with-mysql<br>
<br>
以后单独升级APACHE的时候,仍然是:<br>
./configure --prefix=/home/apache --enable-shared=max --enable-module=most <br>
make<br>
su<br>
#/home/apache/bin/apachectl stop<br>
#make install<br>
<br>
单独升级php时,仍然是:<br>
./configure --with-apxs=/home/apache/bin/apxs --enable-track-vars --with-mysql<br>
make<br>
su<br>
#/home/apache/bin/apachectl stop<br>
#make install<br>
<br>
参考文档:<br>
<br>
Apache<br>
http://httpd.apache.org<br>
<br>
php<br>
http://www.php.net<br>
<br>
Resin<br>
http://www.caucho.com<br>
<br>
mod_gzip<br>
http://www.remotecommunications.com/apache/mod_gzip/<br>
<br>
Cronolog<br>
http://www.cronolog.org<br>
<br>
mod_expires<br>
http://httpd.apache.org/docs/mod/mod_expires.html<br>
<br>
&lt;&lt;返回<br>
</FONT><br>
                                      </TD>
                                    </TR>
                                <TR>
                                <TD colSpan=2><FONT 
                                class=middlefont></FONT><BR>
                                        <FONT 
                                class=normalfont>全文结束</FONT> </TD>
                                    </TR>
                                <TR>
                                <TD background="images/dot.gif" tppabs="http://www.linuxhero.com/docs/images/dot.gif" colSpan=2 
                                height=10></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></DIV></TD>
                        <TD vAlign=top width="20%" 
                      background="images/line.gif" tppabs="http://www.linuxhero.com/docs/images/line.gif" rowSpan=2> 
                          <DIV align=center> 
                            <table class=tableoutline cellspacing=1 cellpadding=4 
                        width="100%" align=center border=0>
                              <tr class=firstalt> 
                                <td noWrap background="images/bgline.gif" tppabs="http://www.linuxhero.com/docs/images/bgline.gif" colspan=2 height=21>
                                <font class=normalfont><b>所有分类</b></font></td>
                              </tr>
<tr class=secondalt> <td noWrap width=27%> <font class=normalfont>1:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type1.html" tppabs="http://www.linuxhero.com/docs/type1.html">非技术类</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>2:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type2.html" tppabs="http://www.linuxhero.com/docs/type2.html">基础知识</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>3:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type3.html" tppabs="http://www.linuxhero.com/docs/type3.html">指令大全</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>4:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type4.html" tppabs="http://www.linuxhero.com/docs/type4.html">shell</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>5:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type5.html" tppabs="http://www.linuxhero.com/docs/type5.html">安装启动</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>6:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type6.html" tppabs="http://www.linuxhero.com/docs/type6.html">xwindow</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>7:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type7.html" tppabs="http://www.linuxhero.com/docs/type7.html">kde</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>8:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type8.html" tppabs="http://www.linuxhero.com/docs/type8.html">gnome</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>9:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type9.html" tppabs="http://www.linuxhero.com/docs/type9.html">输入法类</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>10:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type10.html" tppabs="http://www.linuxhero.com/docs/type10.html">美化汉化</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>11:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type11.html" tppabs="http://www.linuxhero.com/docs/type11.html">网络配置</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>12:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type12.html" tppabs="http://www.linuxhero.com/docs/type12.html">存储备份</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>13:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type13.html" tppabs="http://www.linuxhero.com/docs/type13.html">杂项工具</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>14:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type14.html" tppabs="http://www.linuxhero.com/docs/type14.html">编程技术</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>15:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type15.html" tppabs="http://www.linuxhero.com/docs/type15.html">网络安全</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>16:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type16.html" tppabs="http://www.linuxhero.com/docs/type16.html">内核技术</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>17:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type17.html" tppabs="http://www.linuxhero.com/docs/type17.html">速度优化</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>18:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type18.html" tppabs="http://www.linuxhero.com/docs/type18.html">apache</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>19:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type19.html" tppabs="http://www.linuxhero.com/docs/type19.html">email</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>20:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type20.html" tppabs="http://www.linuxhero.com/docs/type20.html">ftp服务</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>21:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type21.html" tppabs="http://www.linuxhero.com/docs/type21.html">cvs服务</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>22:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type22.html" tppabs="http://www.linuxhero.com/docs/type22.html">代理服务</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>23:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type23.html" tppabs="http://www.linuxhero.com/docs/type23.html">samba</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>24:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type24.html" tppabs="http://www.linuxhero.com/docs/type24.html">域名服务</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>25:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type25.html" tppabs="http://www.linuxhero.com/docs/type25.html">网络过滤</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>26:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type26.html" tppabs="http://www.linuxhero.com/docs/type26.html">其他服务</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>27:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type27.html" tppabs="http://www.linuxhero.com/docs/type27.html">nfs</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>28:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type28.html" tppabs="http://www.linuxhero.com/docs/type28.html">oracle</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>29:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type29.html" tppabs="http://www.linuxhero.com/docs/type29.html">dhcp</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>30:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type30.html" tppabs="http://www.linuxhero.com/docs/type30.html">mysql</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>31:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type31.html" tppabs="http://www.linuxhero.com/docs/type31.html">php</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>32:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type32.html" tppabs="http://www.linuxhero.com/docs/type32.html">ldap</a></font></td>    </tr>  </table></td></tr>                            </table>
                          </DIV></TD></TR>
                    <TR vAlign=top>
                        <TD width="80%"> 
                          <DIV align=center><BR>
                          </DIV>
                        </TD></TR></TBODY></TABLE></TD></TR>
                </TABLE></TD></TR>
          </TABLE>
      <TABLE cellSpacing=0 cellPadding=4 width="100%" bgColor=#eeeeee 
        border=0><TBODY>
        <TR>
          <TD width="50%">
              <P><FONT class=middlefont>版权所有 &copy; 2004 <A 
            href="mailto:bjchenxu@sina.com">linux知识宝库</A><BR>
                违者必究. </FONT></P>
            </TD>
          <TD width="50%">
              <DIV align=right><FONT class=middlefont>Powered by: <A 
            href="mailto:bjchenxu@sina.com">Linux知识宝库</A> Version 0.9.0 </FONT></DIV>
            </TD></TR></TBODY></TABLE>
      <CENTER></CENTER></TD></TR>
    </TABLE></CENTER></BODY></HTML>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?