??xml version="1.0" encoding="utf-8" standalone="yes"?>国产亚洲高清在线精品不卡,午夜亚洲www湿好大,久久久无码精品亚洲日韩京东传媒http://m.tkk7.com/zhyiwww/category/9157.html用^实的W,记录~程路上的点Ҏ滴……?/description>zh-cnWed, 19 Feb 2014 05:47:30 GMTWed, 19 Feb 2014 05:47:30 GMT60Windows下的SC命o参?/title><link>http://m.tkk7.com/zhyiwww/archive/2014/02/18/410001.html</link><dc:creator>zhyiwww</dc:creator><author>zhyiwww</author><pubDate>Tue, 18 Feb 2014 12:46:00 GMT</pubDate><guid>http://m.tkk7.com/zhyiwww/archive/2014/02/18/410001.html</guid><wfw:comment>http://m.tkk7.com/zhyiwww/comments/410001.html</wfw:comment><comments>http://m.tkk7.com/zhyiwww/archive/2014/02/18/410001.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/zhyiwww/comments/commentRss/410001.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/zhyiwww/services/trackbacks/410001.html</trackback:ping><description><![CDATA[<div></div><div>C:\tmp>sc /?</div><div></div><div>错误:  未知命o</div><div></div><div>描述:</div><div>        SC 是用于与服务控制理器和服务q行通信的命令行E序?/div><div>用法:</div><div>        sc <server> [command] [service name] <option1> <option2>...</div><div></div><div></div><div>        选项 <server> 的格式ؓ "\\ServerName"</div><div>        键入 "sc [command]" 可以获得有关命o的进一步帮?/div><div>        命o:</div><div>          query-----------查询服务的状态,</div><div>                          或枚举服务类型的状态?/div><div>          queryex---------查询服务的扩展状态,</div><div>                          或枚举服务类型的状态?/div><div>          start-----------启动服务?/div><div>          pause-----------向服务发?PAUSE 控制h?/div><div>          interrogate-----向服务发?INTERROGATE 控制h?/div><div>          continue--------向服务发?CONTINUE 控制h?/div><div>          stop------------向服务发?STOP h?/div><div>          config----------更改服务的配|?怹)?/div><div>          description-----更改服务的描q?/div><div>          failure---------更改服务p|时执行的操作?/div><div>          failureflag-----更改服务的失败操作标志?/div><div>          sidtype---------更改服务的服?SID cd?/div><div>          privs-----------更改服务的所需权限?/div><div>          qc--------------查询服务的配|信息?/div><div>          qdescription----查询服务的描q?/div><div>          qfailure--------查询p|时服务执行的操作?/div><div>          qfailureflag----查询服务的失败操作标志?/div><div>          qsidtype--------查询服务的服?SID cd?/div><div>          qprivs----------查询服务的所需权限?/div><div>          qtriggerinfo----查询服务的触发器参数?/div><div>          qpreferrednode--查询首选的服务 NUMA 节点?/div><div>          delete----------(从注册表)删除服务?/div><div>          create----------创徏服务(其d到注册表)?/div><div>          control---------向服务发送控制?/div><div>          sdshow----------昄服务的安全描q符?/div><div>          sdset-----------讄服务的安全描q符?/div><div>          showsid---------昄相应于假定名U的 SID 字符丌Ӏ?/div><div>          triggerinfo-----配置服务的触发器参数?/div><div>          preferrednode---讄首选的服务 NUMA 节点?/div><div>          GetDisplayName--获取服务?DisplayName</div><div>          GetKeyName------获取服务?ServiceKeyName?/div><div>          EnumDepend------枚D服务的依存关pR?/div><div></div><div>        下列命o不要求服务名U?</div><div>        sc <server> <command> <option></div><div>          boot------------(ok | bad) 指示是否上一ơ启动保存ؓ</div><div>                          最q一ơ已知的正确启动配置</div><div>          Lock------------锁定服务数据?/div><div>          QueryLock-------查询 SCManager 数据库的 LockStatus</div><div>CZ:</div><div>        sc start MyService</div><div></div><div>是否惛_?QUERY ?QUERYEX 命o的帮? [ y | n ]:</div><div>y</div><div></div><div>QUERY ?QUERYEX 选项:</div><div>        如果查询命o带服务名Uͼ返?/div><div>        该服务的状态。其他选项不适合q种</div><div>        情况。如果查询命令不带参数或</div><div>        带下列选项之一Q将枚D此服务?/div><div>    type=    要枚丄服务的类?driver, service, all)</div><div>             默认 = service)</div><div>    state=   要枚丄服务的状?(inactive, all)</div><div>             (默认 = active)</div><div>    bufsize= 枚D~冲区的大小(以字节计)</div><div>             (默认 = 4096)</div><div>    ri=      开始枚丄恢复索引?/div><div>             (默认 = 0)</div><div>    group=   要枚丄服务l?/div><div>             (默认 = all groups)</div><div></div><div>语法CZ</div><div>sc query                - 枚Dzd服务和驱动程序的状?/div><div>sc query eventlog       - 昄 eventlog 服务的状?/div><div>sc queryex eventlog     - 昄 eventlog 服务的扩展状?/div><div>sc query type= driver   - 仅枚举活动驱动程?/div><div>sc query type= service  - 仅枚?Win32 服务</div><div>sc query state= all     - 枚D所有服务和驱动E序</div><div>sc query bufsize= 50    - 枚D~冲Zؓ 50 字节</div><div>sc query ri= 14         - 枚D时恢复烦?= 14</div><div>sc queryex group= ""    - 枚D不在l内的活动服?/div><div>sc query type= interact - 枚D所有不zd服务</div><div>sc query type= driver group= NDIS     - 枚D所?NDIS 驱动E序</div><div></div><div></div><div>C:\tmp><br /><br />如果需要查看全部的服务Q?br />可以使用  sc query state= all <br /><br />如果我想完成一个自动启动和关闭的oracle 脚本Q可以通过如下步骤实现Q?br />1)sc query state= all > sl.txt<br />2)findstr "DISPLAY_NAME" sl.txt > asl.txt<br />如下Q?br /><div></div><div>C:\tmp>findstr "DISPLAY_NAME"  sl.txt</div><div>DISPLAY_NAME: Adobe Acrobat Update Service</div><div>DISPLAY_NAME: Application Experience</div><div>DISPLAY_NAME: Application Layer Gateway Service</div><div>DISPLAY_NAME: AMD External Events Utility</div><div>DISPLAY_NAME: Avira Scheduler</div><div>DISPLAY_NAME: Avira Real-Time Protection</div><div>DISPLAY_NAME: Application Identity</div><div>DISPLAY_NAME: Application Information</div><div>DISPLAY_NAME: Application Management</div><div>DISPLAY_NAME: Windows Audio Endpoint Builder</div><div>DISPLAY_NAME: Windows Audio</div>。。?br />3)findstr /i "oracle"  asl.txt > osl.txt<br />内容:<div>C:\tmp>findstr /i "oracle" asl.txt</div><div>DISPLAY_NAME: OracleDBConsoleorcl</div><div>DISPLAY_NAME: OracleJobSchedulerORCL</div><div>DISPLAY_NAME: OracleMTSRecoveryService</div><div>DISPLAY_NAME: OracleOraDb11g_home1ClrAgent</div><div>DISPLAY_NAME: OracleOraDb11g_home1TNSListener</div><div>DISPLAY_NAME: OracleServiceORCL</div><div>DISPLAY_NAME: Oracle ORCL VSS Writer Service<br />4)在vim中,把DISPLAY_NAME:替换?net stop 或者net start可以了Q?br /><div><div><br />C:\tmp>gvim osl.txt</div><div></div><div>C:\tmp>type  osl.txt</div><div>net stop  OracleDBConsoleorcl</div><div>net stop  OracleJobSchedulerORCL</div><div>net stop  OracleMTSRecoveryService</div><div>net stop  OracleOraDb11g_home1ClrAgent</div><div>net stop  OracleOraDb11g_home1TNSListener</div><div>net stop  OracleServiceORCL</div><div>net stop  Oracle ORCL VSS Writer Service</div><div></div><div>net start  OracleDBConsoleorcl</div><div>net start  OracleJobSchedulerORCL</div><div>net start  OracleMTSRecoveryService</div><div>net start  OracleOraDb11g_home1ClrAgent</div><div>net start  OracleOraDb11g_home1TNSListener</div><div>net start  OracleServiceORCL</div><div>net start  Oracle ORCL VSS Writer Service</div><div></div></div></div></div><img src ="http://m.tkk7.com/zhyiwww/aggbug/410001.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/zhyiwww/" target="_blank">zhyiwww</a> 2014-02-18 20:46 <a href="http://m.tkk7.com/zhyiwww/archive/2014/02/18/410001.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>myeclipse10svn插g的安?/title><link>http://m.tkk7.com/zhyiwww/archive/2013/07/18/401696.html</link><dc:creator>zhyiwww</dc:creator><author>zhyiwww</author><pubDate>Thu, 18 Jul 2013 05:04:00 GMT</pubDate><guid>http://m.tkk7.com/zhyiwww/archive/2013/07/18/401696.html</guid><wfw:comment>http://m.tkk7.com/zhyiwww/comments/401696.html</wfw:comment><comments>http://m.tkk7.com/zhyiwww/archive/2013/07/18/401696.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/zhyiwww/comments/commentRss/401696.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/zhyiwww/services/trackbacks/401696.html</trackback:ping><description><![CDATA[下蝲svn插gQ下载地址Qhttp://subclipse.tigris.org/servlets/ProjectDocumentList?folderID=2240,可以下蝲site-1.8.22.zip.<br /><br />下蝲后,把site-1.8.22.zip复制到myeclipse的dropins目录Q如我的目录为:<div>D:\MyEclipse\MyEclipse 10\dropins</div><br />解压site-1.8.22.zip到site-1.8.22目录Q然后把site-1.8.22目录重命名ؓsvn,即目录:<div>D:\MyEclipse\MyEclipse 10\dropins\svn<br /><br />重启myeclipse可以用SVN了?br /><br />注:<br />    在myeclipse 8.5 的时候,我曾l这么用q,gSVN不能用,很郁闗没有想到这ơ就可以用了。大家也可以试一下?/div><div></div><br /><div></div><img src ="http://m.tkk7.com/zhyiwww/aggbug/401696.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/zhyiwww/" target="_blank">zhyiwww</a> 2013-07-18 13:04 <a href="http://m.tkk7.com/zhyiwww/archive/2013/07/18/401696.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>在word中表格分|C?/title><link>http://m.tkk7.com/zhyiwww/archive/2012/12/12/392877.html</link><dc:creator>zhyiwww</dc:creator><author>zhyiwww</author><pubDate>Wed, 12 Dec 2012 07:52:00 GMT</pubDate><guid>http://m.tkk7.com/zhyiwww/archive/2012/12/12/392877.html</guid><wfw:comment>http://m.tkk7.com/zhyiwww/comments/392877.html</wfw:comment><comments>http://m.tkk7.com/zhyiwww/archive/2012/12/12/392877.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/zhyiwww/comments/commentRss/392877.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/zhyiwww/services/trackbacks/392877.html</trackback:ping><description><![CDATA[<div><h2><span id="q-title"><span ml-5"="">word中表g|CZ完在下一|C的表格自动d表头</span> </span> </h2><div mb-10"="" id="recommend-answer-1029042674"><div answer"="" id="answer-1029042674">操作步骤Q?br />只需一?个步?br /><div content"=""><ol><li><pre id="recommend-content-1029042674" mb-10"="">选中表头<br /></pre></li><li>右键属?/li><li><pre id="recommend-content-1029042674" mb-10"="">选择行标{,N?“在各顶端已标题行出?#8221;</pre></li></ol></div></div></div></div><img src ="http://m.tkk7.com/zhyiwww/aggbug/392877.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/zhyiwww/" target="_blank">zhyiwww</a> 2012-12-12 15:52 <a href="http://m.tkk7.com/zhyiwww/archive/2012/12/12/392877.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>?4位ubutu上安?2位adobe flash playerhttp://m.tkk7.com/zhyiwww/archive/2011/05/10/349920.htmlzhyiwwwzhyiwwwTue, 10 May 2011 07:06:00 GMThttp://m.tkk7.com/zhyiwww/archive/2011/05/10/349920.htmlhttp://m.tkk7.com/zhyiwww/comments/349920.htmlhttp://m.tkk7.com/zhyiwww/archive/2011/05/10/349920.html#Feedback0http://m.tkk7.com/zhyiwww/comments/commentRss/349920.htmlhttp://m.tkk7.com/zhyiwww/services/trackbacks/349920.html http://download.macromedia.com/pub/labs/flashplayer10/flashplayer10_2_p3_64bit_linux_111710.tar.gz

[2]复制文g到插件目?br /> sudo  cp /tmp/libflashplayer.so /usr/lib/firefox-addons/plugins/
 
[3]重启firefox




zhyiwww 2011-05-10 15:06 发表评论
]]>
outlook2007导出邮g为eml文g的方?/title><link>http://m.tkk7.com/zhyiwww/archive/2011/05/03/349423.html</link><dc:creator>zhyiwww</dc:creator><author>zhyiwww</author><pubDate>Tue, 03 May 2011 06:10:00 GMT</pubDate><guid>http://m.tkk7.com/zhyiwww/archive/2011/05/03/349423.html</guid><wfw:comment>http://m.tkk7.com/zhyiwww/comments/349423.html</wfw:comment><comments>http://m.tkk7.com/zhyiwww/archive/2011/05/03/349423.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/zhyiwww/comments/commentRss/349423.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/zhyiwww/services/trackbacks/349423.html</trackback:ping><description><![CDATA[两步Q?br /> ?】用windows outlook express导入outlook 2007邮g?br /> ?】在windows outlook express中,把选中的邮件拖拽到一个文件目录,存成了.eml文g了?br /> <br /> <br /> <img src ="http://m.tkk7.com/zhyiwww/aggbug/349423.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/zhyiwww/" target="_blank">zhyiwww</a> 2011-05-03 14:10 <a href="http://m.tkk7.com/zhyiwww/archive/2011/05/03/349423.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>在Firefox和IE上用del.icio.us插ghttp://m.tkk7.com/zhyiwww/archive/2010/08/19/329303.htmlzhyiwwwzhyiwwwThu, 19 Aug 2010 01:31:00 GMThttp://m.tkk7.com/zhyiwww/archive/2010/08/19/329303.htmlhttp://m.tkk7.com/zhyiwww/comments/329303.htmlhttp://m.tkk7.com/zhyiwww/archive/2010/08/19/329303.html#Feedback0http://m.tkk7.com/zhyiwww/comments/commentRss/329303.htmlhttp://m.tkk7.com/zhyiwww/services/trackbacks/329303.html 一直很喜欢使用del.icio.us插gQ最q不能用了?br /> 也一样从www.mozilla.com上安装插Ӟ是不能用,在插仉|里面只有创建新用户的按钮,没有用户d的按钮?br /> 后来扑֮方资料,扑ֈ了有效的解决Ҏ?br /> 误?a title="http://www.delicious.com/help/installff" >http://www.delicious.com/help/installff
点击选择自己所用的览器,然后安装插g可以?br />
可喜的是Q现在del.icio.us插g支持IE和Chrome了?br /> 以后可以在常用L览器下实现书签的共享了?br />


zhyiwww 2010-08-19 09:31 发表评论
]]>
修复MBRhttp://m.tkk7.com/zhyiwww/archive/2009/08/17/291448.htmlzhyiwwwzhyiwwwMon, 17 Aug 2009 03:40:00 GMThttp://m.tkk7.com/zhyiwww/archive/2009/08/17/291448.htmlhttp://m.tkk7.com/zhyiwww/comments/291448.htmlhttp://m.tkk7.com/zhyiwww/archive/2009/08/17/291448.html#Feedback0http://m.tkk7.com/zhyiwww/comments/commentRss/291448.htmlhttp://m.tkk7.com/zhyiwww/services/trackbacks/291448.html解决办法只能想办法恢复MBR?br />可以用mbrifcq个工具来实现?br />可以到http://www.sysint.no/nedlasting/mbrfix.htm下蝲Q然后解压?br />

Usage:

    MbrFix /drive <num> {/partition <part>} <command> { /yes } { /byte }


执行 MbrFix /drive 0 fixmbr /yes
然后重启Q你pq入XPpȝ了?br />















zhyiwww 2009-08-17 11:40 发表评论
]]>
unix2dos dos2unixhttp://m.tkk7.com/zhyiwww/archive/2009/06/18/283056.htmlzhyiwwwzhyiwwwThu, 18 Jun 2009 07:11:00 GMThttp://m.tkk7.com/zhyiwww/archive/2009/06/18/283056.htmlhttp://m.tkk7.com/zhyiwww/comments/283056.htmlhttp://m.tkk7.com/zhyiwww/archive/2009/06/18/283056.html#Feedback0http://m.tkk7.com/zhyiwww/comments/commentRss/283056.htmlhttp://m.tkk7.com/zhyiwww/services/trackbacks/283056.html可以先安?br />aptitude install tofrodos -y
然后可以用了

q两个工P可是实现在dos格式和unix文g格式之间的互相{换?br />
比如Q?br />北京市东城区东交民؜2号北京新侨诺富特饭店^M
北京市东城区东内大街201号^M
北京市东城区东华门柏树胡?3号^M
北京市东城区东单三条9号^M
北京市东城区东单北大街^M
北京市东城区东单北大?号国旅大?楼王府井饭店旁边^M
北京市东城区东单北大?5号^M
北京市东城区东单北大?3号^M
北京市东城区东单北大?3号^M

上面的是windows下文件格?br />
$ dos2unix aa.txt
转换后,格式如下Q?br />
北京市东城区东交民؜2号北京新侨诺富特饭店
北京市东城区东内大街201?br />北京市东城区东华门柏树胡?3?br />北京市东城区东单三条9?br />北京市东城区东单北大?br />北京市东城区东单北大?号国旅大?楼王府井饭店旁边
北京市东城区东单北大?5?br />北京市东城区东单北大?3?br />



zhyiwww 2009-06-18 15:11 发表评论
]]>
JVM terminated. Exit code=127http://m.tkk7.com/zhyiwww/archive/2009/06/18/282993.htmlzhyiwwwzhyiwwwThu, 18 Jun 2009 02:43:00 GMThttp://m.tkk7.com/zhyiwww/archive/2009/06/18/282993.htmlhttp://m.tkk7.com/zhyiwww/comments/282993.htmlhttp://m.tkk7.com/zhyiwww/archive/2009/06/18/282993.html#Feedback0http://m.tkk7.com/zhyiwww/comments/commentRss/282993.htmlhttp://m.tkk7.com/zhyiwww/services/trackbacks/282993.html
JVM terminated. Exit code=127
/zy/green/JBuilder2007/./jre/bin/java
-Xms80M
-Xmx512M
-XX:MaxPermSize=128M
-jar /zy/green/JBuilder2007/./startup.jar
-os linux
-ws gtk
-arch x86
-launcher /zy/green/JBuilder2007/JBuilder.bin
-name JBuilder.bin
-showsplash 600
-exitdata 9000c
-configuration /zy/green/JBuilder2007/configuration_JBuilder
-vm /zy/green/JBuilder2007/jre/bin/java
-vmargs
-Xms80M
-Xmx1024M
-XX:MaxPermSize=128M
-jar /zy/green/JBuilder2007/startup.jar
~                                                                                                                                                                                   

错误输出如下Q?br />
zhangyi@debian:/zy/green/JBuilder2007$ ./JBuilder.bin
[INFO] HibernatePlugin - HibernatePlugin Started
/zy/green/JBuilder2007/./jre/bin/java: symbol lookup error: /zy/green/JBuilder2007/configuration_JBuilder/org.eclipse.osgi/bundles/766/1/.cp/libswt-mozilla-gtk-3236.so: undefined symbol: _ZN4nsID5ParseEPKc

(JBuilder.bin:5743): Gdk-CRITICAL **: gdk_x11_atom_to_xatom_for_display: assertion `atom != GDK_NONE' failed
zhangyi@debian:/zy/green/JBuilder2007$


从网上找了不的资料Q解x案如下:

aptitude install xulrunner-dev -y

安装完毕Q再重新启动Q就可以?br />





zhyiwww 2009-06-18 10:43 发表评论
]]>
如何在debian上用QQhttp://m.tkk7.com/zhyiwww/archive/2009/03/24/261723.htmlzhyiwwwzhyiwwwTue, 24 Mar 2009 08:25:00 GMThttp://m.tkk7.com/zhyiwww/archive/2009/03/24/261723.htmlhttp://m.tkk7.com/zhyiwww/comments/261723.htmlhttp://m.tkk7.com/zhyiwww/archive/2009/03/24/261723.html#Feedback0http://m.tkk7.com/zhyiwww/comments/commentRss/261723.htmlhttp://m.tkk7.com/zhyiwww/services/trackbacks/261723.html环境 debian
用pidgedQQ
[1]安装或者更新最新的pidge
    aptitude install pidge
[2]配置pidge中的QQd服务?br />pidge_qq_config.png

里面的服务器一定要配置寏V?br />关于 QQ服务器,请参?a target="_blank" >http://zhidao.baidu.com/question/73573422.html


zhyiwww 2009-03-24 16:25 发表评论
]]>
vim目录树插件NERD tree的安装方?/title><link>http://m.tkk7.com/zhyiwww/archive/2009/03/18/260408.html</link><dc:creator>zhyiwww</dc:creator><author>zhyiwww</author><pubDate>Wed, 18 Mar 2009 03:37:00 GMT</pubDate><guid>http://m.tkk7.com/zhyiwww/archive/2009/03/18/260408.html</guid><wfw:comment>http://m.tkk7.com/zhyiwww/comments/260408.html</wfw:comment><comments>http://m.tkk7.com/zhyiwww/archive/2009/03/18/260408.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://m.tkk7.com/zhyiwww/comments/commentRss/260408.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/zhyiwww/services/trackbacks/260408.html</trackback:ping><description><![CDATA[pȝ Debian 4.0<br />[1]下蝲NERD tree<br />wget http://www.vim.org/scripts/download_script.php?src_id=9870 -O NERDTree.zip<br /><br />[2]d.vim配置<br />查看~/.vim目录Q如果不存在Q创建此目录<br /><br />[3]copy NERDTree.zip to ~/.vim<br /><br />[4]unzip NERDTree.zip<br /><br />ok .<br /><br />使用Ҏ和效果如图:<br /><img src="http://m.tkk7.com/images/blogjava_net/zhyiwww/linux/nerd_tree.png" alt="nerd_tree.png" border="0" height="584" width="727" /><br /><img src ="http://m.tkk7.com/zhyiwww/aggbug/260408.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/zhyiwww/" target="_blank">zhyiwww</a> 2009-03-18 11:37 <a href="http://m.tkk7.com/zhyiwww/archive/2009/03/18/260408.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Keyboard shortcuts for firefox(转蝲)http://m.tkk7.com/zhyiwww/archive/2008/12/25/248249.htmlzhyiwwwzhyiwwwThu, 25 Dec 2008 05:38:00 GMThttp://m.tkk7.com/zhyiwww/archive/2008/12/25/248249.htmlhttp://m.tkk7.com/zhyiwww/comments/248249.htmlhttp://m.tkk7.com/zhyiwww/archive/2008/12/25/248249.html#Feedback0http://m.tkk7.com/zhyiwww/comments/commentRss/248249.htmlhttp://m.tkk7.com/zhyiwww/services/trackbacks/248249.html阅读全文

zhyiwww 2008-12-25 13:38 发表评论
]]>
foxmail不能发送邮?/title><link>http://m.tkk7.com/zhyiwww/archive/2008/12/02/243980.html</link><dc:creator>zhyiwww</dc:creator><author>zhyiwww</author><pubDate>Tue, 02 Dec 2008 09:44:00 GMT</pubDate><guid>http://m.tkk7.com/zhyiwww/archive/2008/12/02/243980.html</guid><wfw:comment>http://m.tkk7.com/zhyiwww/comments/243980.html</wfw:comment><comments>http://m.tkk7.com/zhyiwww/archive/2008/12/02/243980.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/zhyiwww/comments/commentRss/243980.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/zhyiwww/services/trackbacks/243980.html</trackback:ping><description><![CDATA[ <span id="0ay4ism" class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Arial; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 22px; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">我的foxmail能收邮g但是不能发送邮Ӟ问题解决Q?br />Network Associates 是q个软g的问题!<span id="o4qy064" class="Apple-converted-space"> </span><br />打开控制収ͼ选择讉K保护Q里面有?5端口Q就是禁止发邮g的设|,把勾LOK了!<br /><br /></span> <img src ="http://m.tkk7.com/zhyiwww/aggbug/243980.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/zhyiwww/" target="_blank">zhyiwww</a> 2008-12-02 17:44 <a href="http://m.tkk7.com/zhyiwww/archive/2008/12/02/243980.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>用forfiles或者where实现文g查找http://m.tkk7.com/zhyiwww/archive/2008/12/02/243936.htmlzhyiwwwzhyiwwwTue, 02 Dec 2008 07:11:00 GMThttp://m.tkk7.com/zhyiwww/archive/2008/12/02/243936.htmlhttp://m.tkk7.com/zhyiwww/comments/243936.htmlhttp://m.tkk7.com/zhyiwww/archive/2008/12/02/243936.html#Feedback0http://m.tkk7.com/zhyiwww/comments/commentRss/243936.htmlhttp://m.tkk7.com/zhyiwww/services/trackbacks/243936.html forfiles 也可以用来查找文?br /> forfiles /p . /s  /m  *.html /c  "cmd /c echo @path"

q样可以昄你找到的文g的全路径?br /> 相当?br /> where /R .  *.html


如果?br /> dir /s . | grep *.html
只能看到文件的名称Q不能看到文件的全\径?br />
两个命o的不同:
用forfiles查找到文件后Q可以用/c参数实现Ҏ件的操作Q比如重命名、移动、删除等操作
用where实现查找׃能实现此功能Q仅能告诉我们要查找的文件存不存在?br />
两个命o的相同点Q?br />都可以查找文Ӟq且可以看到文g的全路径?br />
用dir + grep ׃能看到查到文件的全\径?br />
在linux下面Q用find也可以实现文件查找,功能cM于forfiles


zhyiwww 2008-12-02 15:11 发表评论
]]>
让你的vim在启动的时候默认显C?/title><link>http://m.tkk7.com/zhyiwww/archive/2008/11/20/241546.html</link><dc:creator>zhyiwww</dc:creator><author>zhyiwww</author><pubDate>Thu, 20 Nov 2008 01:30:00 GMT</pubDate><guid>http://m.tkk7.com/zhyiwww/archive/2008/11/20/241546.html</guid><wfw:comment>http://m.tkk7.com/zhyiwww/comments/241546.html</wfw:comment><comments>http://m.tkk7.com/zhyiwww/archive/2008/11/20/241546.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/zhyiwww/comments/commentRss/241546.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/zhyiwww/services/trackbacks/241546.html</trackback:ping><description><![CDATA[如果你用vimQ那么默认的情况下是不显CLQ如果需要显CL话,可以通过下面的命令来昄行号<br />set nu<br />但是Q每一ơ你都需要执行此命o才能昄行号?br />所以,如果你想默认的在启动vim的时候就昄行号Q你可以~辑VIM安装目录下面的_vimrc文g<br />在开头添?<br />set nu<br />可以了。以后每ơ在启动vim的时候,׃自动地显C受?br /><img src ="http://m.tkk7.com/zhyiwww/aggbug/241546.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/zhyiwww/" target="_blank">zhyiwww</a> 2008-11-20 09:30 <a href="http://m.tkk7.com/zhyiwww/archive/2008/11/20/241546.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>利用Eclipse和Tomcatq行q程调试http://m.tkk7.com/zhyiwww/archive/2008/10/21/235744.htmlzhyiwwwzhyiwwwTue, 21 Oct 2008 10:34:00 GMThttp://m.tkk7.com/zhyiwww/archive/2008/10/21/235744.htmlhttp://m.tkk7.com/zhyiwww/comments/235744.htmlhttp://m.tkk7.com/zhyiwww/archive/2008/10/21/235744.html#Feedback0http://m.tkk7.com/zhyiwww/comments/commentRss/235744.htmlhttp://m.tkk7.com/zhyiwww/services/trackbacks/235744.html
rem ===========================================================================
rem this is  added for remoting debug
SET JPDA_ADDRESS=8000Q注意,此端口一定不能和你的tomcat监听端口一P比如Q你的tomcat如果?080Q此端口Q就不能?080Q?br />SET JPDA_TRANSPORT=dt_socket
rem ===========================================================================

2 在eclipse中添加远E调?br />打开调试配置H口Q添加一个Remote Java Application
配置例子如下Q?img src="http://m.tkk7.com/images/blogjava_net/zhyiwww/Eclipse/eclipse_remote_debug.PNG" alt="eclipse_remote_debug.PNG" border="0" width="901" height="631" />

注意Q配|Port的时候一定和你刚才添加的端口一致?br />
3 启动tomcatQ命令如下:catalina jpda start
4 启动remote debug,也就是你刚才配置好的要调试的q程E序。就可以看到q程调试的结果了。如下图Q?br />eclipse_remote_debug_1.PNG


补充Q?br />q种ҎQ在启动tomcat的时候,需要用catalina.bat jpda start 来实现?br />如果不想每一ơ都q样Q可以修改startup.bat文gQ以后启动,和你通常启动tomcat的方法一栗?br />
:setArgs
if ""%1""=="""" goto doneSetArgs
set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1
shift
goto setArgs
:doneSetArgs

call "%EXECUTABLE%" jpda start %CMD_LINE_ARGS%

:en

看到那个U色字体的部分,是你需要添加的。之后,你就可以直接startup.bat,默认已l启动了q程调试了?br />


zhyiwww 2008-10-21 18:34 发表评论
]]>
The Concrete Architecture of the Apache Web Server(zhuan zai)http://m.tkk7.com/zhyiwww/archive/2008/05/09/199548.htmlzhyiwwwzhyiwwwFri, 09 May 2008 08:39:00 GMThttp://m.tkk7.com/zhyiwww/archive/2008/05/09/199548.htmlhttp://m.tkk7.com/zhyiwww/comments/199548.htmlhttp://m.tkk7.com/zhyiwww/archive/2008/05/09/199548.html#Feedback0http://m.tkk7.com/zhyiwww/comments/commentRss/199548.htmlhttp://m.tkk7.com/zhyiwww/services/trackbacks/199548.html阅读全文

zhyiwww 2008-05-09 16:39 发表评论
]]>
The Conceptual Architecture of the Apache Web Server(zhuan zai)http://m.tkk7.com/zhyiwww/archive/2008/05/09/199541.htmlzhyiwwwzhyiwwwFri, 09 May 2008 08:30:00 GMThttp://m.tkk7.com/zhyiwww/archive/2008/05/09/199541.htmlhttp://m.tkk7.com/zhyiwww/comments/199541.htmlhttp://m.tkk7.com/zhyiwww/archive/2008/05/09/199541.html#Feedback0http://m.tkk7.com/zhyiwww/comments/commentRss/199541.htmlhttp://m.tkk7.com/zhyiwww/services/trackbacks/199541.html The Conceptual Architecture of the Apache Web Server

Octavian Andrei Dragoi ,
Department of Computer Science,
University of Waterloo,
mailto:oadragoi@neumann.uwaterloo.ca

Assignment 1
for CS746G
January 26, 1999
 

Abstract:

This report presents the conceptual (abstract) architecture of the Apache web server. It tries to emphasize the overall structure of the system, without going into implementation details, or requiring such details to be previously known by the reader. The main purpose is to make the architecture "intellectually tractable" ([Monroe97]).
The conceptual architecture has been inferred from a number of Apache related documents and from the way source files are grouped and named.
At a high level the Apache server architecture is composed of a core that implements the most basic functionality of a web server and a set of standard modules that actually service the phases of handling an HTTP request.
The server core accepts a HTTP request and implicitly invokes the appropriate handlers, sequentially, in the appropriate order, to service the request.
The report shows that the most similar architectural style (in the sense of ([Garlan94])) that can characterize the Apache architecture is "implicit invocation" , although the notion of event does not exist in the architecture.
The architecture offers great opportunities for extending or changing the Apache functionality, by the means of adding or replacing modules.
Keywords:
Apache, conceptual architecture, abstract architecture, web server
Available online at:
http://www.grad.math.uwaterloo.ca/~oadragoi/CS746G/a1/apache_conceptual_arch.html
 

1. Introduction

The goal of this report is to present the conceptual (abstract) architecture of the Apache web server. Therefore it leaves aside implementation details and tries to be simple. As stated in [Monroe97] a good architectural description make the architecture "intellectually tractable". The paper might, sometimes, simplify the actual architecture order to achieved the previously stated desiderata.

The report assumes no previous familiarity with the architecture of the Apache web server. So it can serve as an introductory reading on the architecture of the server.

It should be noted that the architecture described here might not be entirely accurate. It has been inferred based on several sources, including the overall structure of files and files name. It does not start from a previously existing complete design document.

1.1. About Apache

The Apache web server is currently the most popular web server, according to a NetCraft Survey. It has maintained (and improved) its status since mid 1996. Originally, the project was based on NCSA httpd 1.3, were from the name ("A PAtCHy Server"). Since then the code base was completely rewritten, and evolved into a completely independent project.
One of the major reasons for the Apache success is the fact that is an "open source" project (any one can have access to Apache code source, and any one can write its on modules to suits one needs). (source Apache FAQ).

May be here is the place to mention that Apache is written to be drop-in compatible with the NCSA server. This has design consequences due related to some configuration commands promoted by NCSA server, which cannot be naturally implemented in Apache. These commands are supported in a way that, somehow, is not in the general "philosophy" of the system.([Thau96]). (more details in the configuration section).

1.2. Overview

The report is organized as follows: Section 2. offers a high level view on the conceptual architecture of the Apache, outlining the main building bricks: the apache core and the apache modules. Next section (3.) gives details on the conceptual architecture of the apache core and shows what the high level anatomy of a module. It also outlines the phases of handling an HTTP request as divided by the Apache architecture. It ends with a short description of the most representative standard modules. Section 4. gives the conceptual architecture of the Apache server and analyze the concurrency in the system. Section 5. present some additional issues related to the architecture of the system, mainly how configuration fit into the hole picture, how is data passed between core and modules and how resources are allocated and managed managed. Next section (6.) comments on the architectural styles (in the sense of [Garlan94], [Shaw96]) applicable to the Apache architecture, while the Section 7. elaborates on extensibility issues. Conclusions and a dictionary of terms end the report.

2. High level Conceptual Architecture

The function of a web server is to service requests made through HTTP protocol. Typically the server receive a request asking for a specific resource and returns the resource as a response. A client might reference in its request a file, and then that file is returned or, for example, a directory and then the content of that directory (codified in some suitable form) is returned. A client might also request a program, and it is the web server task to launch that program (CGI script) and to return the output of that program to the client. Various other resources might be referenced in client's request.
To summarize: the web server take a request, decode it, obtains the resource and hands it to the client.

Additional concerns related to controlling access authorization and clients authorizations are also in the responsibility of the web server. As has been said the web server might execute programs as response to clients requests. It must ensure that this is not a threat for the host system (were the web server runs). In addition, the web server must be capable, not only to respond to a high rate of requests, but also to satisfy a request as quickly as possible.

2.1. Description

As opposed to a monolithic server architecture in which all the activities are done by a single unit (in which different parts of handling a request are poorly delimited), Apache takes a modular approach. Figure 1 illustrates the high level conceptual architecture. There is a core part of the server that is responsible for defining and following the steps in servicing a request and several modules that actually implement the different phases of handling the request.
As shall be seen later Figure 1 does not capture an important characteristic of the architecture, namely, the predefined order in which modules are called, based on their advertised characteristics.

Figure 1.High level Conceptual Architecture
The idea is to keep the basic server code clean while allowing third-parties to override or extend even basic characteristics.

3. The core and the modules

This section presents in more detail the components of the Apache server architecture. It presents the conceptual parts of the Apache core and how a request is decomposed in a set of phases. It also describe the anatomy of an Apache module (at a conceptual level).

3.1. The core

The core implements the basic functionality of the server. In addition it implements a number of utility functions. A worth mentioning utility, is the one that provides resources allocation on a per request pool. This facility is offered not only to the server core but also to modules.

The following are the components of the core:

  • http_protocol.c: contains routines that directly communicates with the client (through the socket connection), following the HTTP protocol. All data transfers to the client are done using this component.
  • http_main.c: the component that startup the server and contains the main server loop that waits for and accepts connections. It is also in charge of managing timeouts.
  • http_request.c the component that handles the flow of the request processing, dispatching control to the modules in the appropriate order. It is also in charge with error handling.
  • http_core.c: the component implementing the most basic functionality, which is described in a comment from a source file as being "just 'barely' functional enough to serve documents, though not terribly well". Another interesting quote from a source file comment illustrates very well the function of this component:"this file could almost be mod_core.c". Meaning that the component behaves like a module but has to access some globals directly (which is not characteristic for a module).
  • the component that take care of allocating resource pools, and keeping track of them. (alloc.c)
  • other utilities, including reading configuration files and managing the information gathered from those files (http_config.c), as well as support for virtual hosts. An important function of http_config is that form the list of modules that will be called to service different phases of the requests.
In the above list the term component has been used in order to avoid the term module which will be used only to refers to Apache modules
Figure 2. Architecture for Apache core
Figure 2. depicts the interaction between different components of the core. As all components use the different utilities functions, connectors to UTILITIES and ALLOC have not been pictured. Interaction is used in a broader sense, meaning from calling a component service function to "conceptually" relinquish control to that component.

It is interesting to observed that although the components of the core have rather distinct functionality, there is not a simple way to depict the interactions between them. Most of the architectural information being in the names of the modules rather than in the connectors between them.

This is due to the considerably effort done by the designers to move everything that can be expressed as a separate entity into the modules part of the Apache server. What is left in the core are components too interconnected to be written as separate modules.

3.2. Request Phases

A module implements only portion of the functionality for servicing a client request. More than one module are necessary to completely respond to a request. However module does not know one about the other. The control is transfered back and forth between the core and different modules. This is handled by dividing the handling of the request into a set of distinct phases.

The following are the phases of handling a request for the Apache server:

  • URI to filename translation;
  • Check access based on host address, and other available information;
  • Get an user id from the HTTP request and validate it;
  • Authorize the user;
  • Determine the MIME type of the requested object (the content type, the encoding and the language);
  • Fix-ups (for example replace aliases by the actual path);
  • Send the actual data back to the client;
  • Log the request;
The phases are "controlled" by the http_request component of the core as has been already stated (see Figure 2.).

3.3. Modules

As has been said the role of the modules is to implement/override/extend the functionality of the Apache web server. All modules has the same interface to the core of the server. Module does not interact directly one with another. If they interact it is always through the Apache core.(implicit invocation as shall be seen).

Figure 3. Architecture of an Apache Module
Apache (1.3) permits loading of modules when they are needed (they are dynamically linked with the server) and therefore the initialization and configuration methods might be called when the module is loaded as opposed to when the server is initialized.

3.4. Handlers

A handler is for Apache the action that must be performed in some phase of servicing a request. For example when the requested object is a file, the handler that returns the the file must open the file, read the content of the file and hand the content of the file to the client (through apache core).

Handlers are defined by modules, and a module might specify handlers for one, many or none of the phases of a request. Handlers are the part of the module that is called when the processing of the request enters the phase for which the handler is defined.

The rationale behind having modules defining handlers for more than one phase is that a module might save internally data on the request being processed, and when its handlers for a subsequent phase of the request are called they might make use of those the data. In theory the module might even save data between different request (e.g. it might cash some file content for future use).

It should be noted that there are additional functions exported by modules, related with configuration, and initialization, They are called in the startup phase of the server.

3.5. Standard Modules

Apache comes with a set of standard modules for providing the complete functionality of a web server. The most representative/relevant among the standard modules are listed below. They also illustrate what kind of manipulation can be done at each phase.
  • For URI to file name translation phase:
    • mod_userdir: translate the user home directories into actual paths mod_rewrite Apache 1.2 and up
    • mod_rewrite: rewrites URLs based on regular expressions, it has additional handlers for fix-ups and for determining the mime type
  • For authentication / authorization phases:
    • mod_auth, mod_auth_anon,mod_auth_db, mod_auth_dbm : User authentication using text files, anonymous in FTP-style, using Berkeley DB files, using DBM files.
    • mod_access: host based access control.
  • For determining the MIME type of the requested object (the content type, the encoding and the language):
    • mod_mime: determines document types using file extensions.
    • mod_mime_magic: determines document types using "magic numbers" (e.g. all gif files start with a certain code)
  • For fix-ups phase:
    • mod_alias: replace aliases by the actual path
    • mod_env: fix-up the environment (based on information in configuration files)
    • mod_speling: automatically correct minor typos in URLs
  • For sending actual data back to the client: to chose the appropriate module for this phase the mime type or the pseudo mime type (e.g. for a CGI-script) is used.
    • mod_actions: file type/method-based script execution
    • mod_asis: send the file as it is
    • mod_autoindex: send an automatic generated representation of a directory listing
    • mod_cgi: invokes CGI scripts and returns the result
    • mod_include: handles server side includes (documents parse by server which includes certain additional data before handing the document to the client)
    • mod_dir: basic directory handling.
    • mod_imap: handles image-map file
  • For logging the request phase:
    • mod_log_*: various types of logging modules

4. Conceptual Architecture

Figure 1 has shown which are the main components of the Apache web server and how they interact. However it does not illustrate the fact that handlers in modules are called in a fixed, predefined order, which is the order of the phases of servicing a request. Figure 3 tries to add the flow information mention above.

For some phases only one module (handler in a module) can be called. Such phases are the authorization, the authentication, the return of the actual object to the client, and sometimes the URI to filename translation.
Other phases of servicing a request can have more that one handler called. For example there can be more than one module called to implement the logging part of the request.

In some phases of processing a request all the handlers (in the registered modules) might be called until one returns a special code meaning that subsequent registered handlers for the current phase should not be called. An example is the URI to filename, translation phase.
Further more there might be the case that a handler returns an error code. In that case the processing of the request should stop and an error should be returned to the client (i.e. no other handlers are called, from this phase or subsequent phases).

Figure 4. Conceptual Architecture of Apache Server

4.1. Concurrency in Apache

Some web sites are heavily loaded (many requests per minute or even per second). Traditionally TCP/IP servers fork a new child to handle new incoming request from clients. However in the situation of a busy web site the overhead of fork-ing a huge number of children will simply suffocate the machine.

As a consequence, Apache uses a different technique, namely persistent server processes. It forks a fixed number of children, right from the beginning. The children service incoming requests independently (different address spaces). Concurrency in Apache server is pictured in Figure 5.
Alternatively, when Apache compiles on MS Windows (as opposed to UNIX), a fixed number of threads is started from the beginning to service the incoming request (due probably to specific characteristic of this operating system).

Figure 5. Concurrency on Apache(UNIX)
It is interesting that Apache server can dynamically control the number of children it forks (i.e. increasing or decreasing it), based on current load.

From another point of view one might raise the question if a module is a separated process or can be implemented as a separated process. In Apache module is not a separated process. However some modules might fork new children in order to do their job. A readily example is the mod_cgi module, which handles the cgi script. It must fork a new child to execute the actual CGI script (after proper redirection of the standard input and output for the child process), and wait for it to finish. But this is a characteristic of the mod_cgi, many other modules need not to fork children.

A different kind of module is the one that although it is not a separate process and does not for children it communicate through IPC mechanisms or sockets in with a different process (which might, for instance, be located on a different machine). An example of such module would be an authorization module which communicate with a server that manages users and passwords information. Even the CGI module might be implemented in this way (i.e. the actual script running as a completely different process not a child) which will result in improved security, but will have the communication overhead as a penalty.

5. Additional issues

Some additional issues has been left aside from the description of the conceptual architecture and are treated in the next sections.

5.1. Configuration of Apache Components

One of the declared purposes of the Apache server architecture is to make it highly customizable.
Configuration files permit to customize not only the behavior of the server but the one of the modules too. Each module can advertise the custom commands it recognize from configuration files and will be called when such commands are found. Those commands might be completely new commands (not known in by the server core).
Apache permits even per directory customization via a file call .htaccess. This file also might contain commands understand only by modules.

An interesting concept implemented by Apache is the one of Virtual Hosts. The server can respond to more than one name (i.e. www.example and www2.example), each assigned to one of the multiple IP addresses of the machine. The multiple IP addresses can be addresses associated with physical network interfaces or can be addresses associated with virtual network interfaces (simulated via logical devices by the operating system). Apache is able to "tell" under which name the host has been referenced and use different configuration options (e.g. allowing more access rights to users accessing the host through an interface networked in the local network, as opposed to users accessing the web server via an interface networked in the outside-the-company network). Modules also have accessed to this information.

To summarize, the Apache "philosophy" related to configuration is: each component takes care of its own configuration, and configuration commands. The server core parse the configuration files and dispatches configuration commands to the appropriate modules to be interpreted (executed), or interprets (executes) the command itself if in particular was meant for it (i.e. is a configuration command for the core not for a module).

5.2. Compatibility with NCSA server - impact on Architecture

Starting from the code base of the NCSA server Apache was always design to be a drop-in replacement for this server. That means that Apache must understand and follow the configuration commands, and recognize the configuration files of the NCSA server. However this is not an easy task because some of the commands must affect behavior that appear in more than one module. Therefore one of the main principle of the Apache configuration machinery, namely each module takes care of its own configuration must be broken .

To "fix" this the problem commands of NCSA server (e.g. Options) are interpreted by the Apache core, even when they affect modules. The core make the configuration available to modules in the same way it make available the general configuration information.

5.3. Data Flow / Data Structures

Data is exchanged with various handlers in modules via a special structure called request record which includes information about the resource requested (e.g. filename), information about the configuration data related to the server, the virtual host, and the directory context in which the request is processed.

Another key structure is the one the Apache core uses keep track of various modules. It is a linked list of module records, each holding all the information related to that module (e.g. handlers, configuration data per module). The module record is the mean by which the core calls the module.

5.4.Resource Allocation - Resource Pool

An interesting characteristic of the Apache server it the concept of resource pool. All resources related to a request (memory, file handlers) are allocated and handled through a dedicated resource pool. Further more, modules can define their own sub-resource pools if they want to manage private resources in a similar manner with general resources.

What is characteristic for the resource pool, is that all resources are freed at once, when the resource pool is freed, preventing resource leakage. This is particularly important due to use of persistent processes.

6. Architectural Style

The conceptual architecture described above, roughly approximate the style of "implicit invocation". It should be noted however that the architecture is not exactly an Event based architecture, as specified in [Garlan94]. It is usually the case with software architecture that cannot be clearly classified in a predefined style ("Real systems hybridize and amalgamate the pure style" - [Shaw96]).
To be more specific there is no such concept as many events that are announced (broadcast). Instead the only event is a request from a HTTP client, which starts a sequence of predictable implicit invocations.
The core has a fixed order in which will call the different handlers and will decide based on configuration information which is the order in which the handlers for the same phase are called.

There is, however, something that might be compared with announcing an event, namely is the issuing of a sub-request by a module in order to "force" the core to perform some of the steps for a request on the sub-request (i.e. calling sequentially handlers for each servicing phase). However this is not (conceptually) a proper event, because the issuing module does not announce something to other (unknown to it) modules. It just a mean of "forcing" an implicit invocation.

There are other characteristics of event systems (as summarized in [Shaw96]) that does not "fit" the description of the core-modules architecture of Apache. For example there is no control asynchrony, in the sense that the module issuing a the sub-request waits for the sub-request to be completed.
Also two phases of the request cannot be handled in parallel (one uses the outcome of the precedent one). More over the module is not a separate process, although it can fork children for some phases - like running a CGI script.

So although the connectors between modules are implicit invocations and data flow is a tree - with some restrictions (e.g some phases cannot have more than one module to handle them, one phase is after the other) the architecture does not have other characteristics of the event systems.

It can be argued however that as different instances of Apache (sub-processes) can handle in the same time request from different HTTP clients there is asynchrony. However the different instances are independent and do not shared information related to the requests processed.

The way a request is serviced, with phases handled one after the other and the outcome of a request is used (most of the time) by the next phase, has some similarities with the general style of "pipe line" (as in [Shaw96])). There is no upstream control (i.e. when the core invokes the handlers for one phase there is no data or control upstream). However, again, there is no asynchrony and more important the core regain control after each phase (i.e. after the handler has been invoked, and its job is done).

Further more, some phases does not provide any change in the conceptual data-flow. And more significant, some handlers might be implemented by the same module and those handler might exchange information via private data of the module, bypassing the main data-flow. For example authorization and authentication does not change the request, they can only deny the execution of it. To conclude the pipeline is rather poorly reflected by the module structures, although conceptually the idea exists, therefore the implicit invocation seems more appropriate to characterize the general conceptual architectural style.

7. Extensibility of Apache

As it probably became obvious by now, Apache server architecture easily permits changes of the existing functionality or adding new functionality.
The modular approach and the effort made by the designers to move as much as possible from the web server functionality into separate modules make the task easier. For example if the way URI are translated into file names have to be extended, it is not necessary to change the module that does this task. It is sufficient to write a different module which will be called before or after the standard module has been called.

Further more the ability of dynamically loading modules present in Apache 1.3 release (no static linking with the server code), make the task of customizing the server even easier as there is no need to recompile the entire server. It is necessarily only to change some configuration files.
Another feature worth re-mentioning here is the capability of modules to define their own configuration commands, for which they are implicitly called to execute.

An important part of the Apache web server that cannot be changed only by changing / adding a module is the one that implements the HTTP protocol. On the good, side the protocol is implemented as a separate piece of code (http_protocol.c), and all communication with the client is done through it, so only that part must be changed in order to implement a future version of HTTP. However there is no well defined API, as is the case for modules.

8. Conclusions

Apache web server has a modular architecture with a core component that defines the most basic functionality of a web server (including the HTTP protocol and the reading of configuration files) and a number of modules which implements the steps of processing a HTTP request, offering handlers for one or more of the phases.

The core is the one that accepts and manages HTTP connections and calls the handlers in modules in the appropriate order to service the current request.

The architectural style can be characterized implicit invocation made by the server core on handlers implemented by the modules. Concurrency exists only between a number of persistent identical processes that service incoming HTTP requests on the same port. Modules are not implemented as separate process although it is possible to fork children or to cooperate with other independent process to handle a phase of processing a request.

The functionality of Apache can be easily changed by writing new modules which complements or replace the existing one. The server is also highly configurable, at different levels (virtual host, directory, module) and modules can define their own configuration commands.

9. Dictionary of terms

API
Application Programming Interface
component
term used throughout this report in order to avoid the term module which has been used in connection to (referring) an Apache module. This distinction is not a standard terminology, and has the only purpose to avoid confusion.
core (Apache core)
part of the Apache server that defines and manages the steps in answering the request and implements the HTTP protocol.
CGI (CGI script)
Common Gateway Interface, an interface describing how a web server passes parameters and receive results form another process on the same machine called CGI-script (executed by the web server when it receive a request referencing the script).
handler
a function of a module that will be implicitly invoked by the core to handle the phase of processing the HTTP request for which the handler was designed.
HTTP
Hypertext Transport Protocol, the protocol that coordinate how the hypertext files are transfered over the Internet. However any files can be transfered via HTTP.
httpd
the usual name for the web server (stands for HTTP daemon).
IPC (IPC mechanisms)
inter process communication mechanisms (e.g. queues, semaphores, shared memory)
MIME type
MIME stands for Multipurpose Internet Mail Extension. MIME types are the types (e.g. gif, html) of the entities defined in MIME request for comments
module (Apache module)
part of Apache server that provides some functionality in one or more phases of servicing an HTTP request. Its functions (handler) are implicitly invoked by the Apache core. It is interfaced with the Apache core by a special API.
NCSA web server (NCSA httpd)
the web server provided and maintained by the Development Group of the National Center for Super-computing Applications, at the University of Illinois at Urbana - Champaign
request (HTTP client request)
a message from the client containing information about the resource requested and how it is wanted to be delivered.
resource (an HTTP resource)
a network data object or service which can be identified by a URI
response (HTTP server response)
the response from the web server to an HTTP request, contains a header and usually the actual resource. The header contains status information and information on the resource (e.g. type, length of the binary representation).
resource pool
A large data structure allocated in one step by the Apache core, which holds the resources (memory blocks, open files) associated with a given request. When the resource pool is no longer needed it is deallocated in one step (memory is freed and files ore closed).
URI
Universal Resource Identifiers, are formated (fixed syntax) string which identify objects via location, and other characteristics.
URL
Uniform Resource Locators, a subclass of URI that locates resources based on their location and the protocol used to fetch them (e.g. http://www.uwaterloo.ca/index.html identifies the home page file of University of Waterloo)
virtual host
a single physical host might have more than one network interface, each with a different IP address and a different host name. For clients it acts as being a number of virtual hosts, one for each name.

10. References

[Thau96]
Design considerations for the Apache Server API, Robert Thau, Fifth International World Wide Web Conference, 1996, Paris.
[APINotes]
Apache API notes , Robert S. Thau.
[ApacheDocs]
Apache server documentation
[Garlan94]
An Introduction to Software Architecture, D. Garlan, M.Shaw, Advances in Software Engineering and Knowledge Engineering, Vol. I, World Scientific Publishing Company, 1993.
[Monroe97]
Architectural Styles, Design Patterns, and Objects, R. Monroe, D. Kompanek, R. Melton, D. Garlan, IEEE Software, January 1997, pp 43-52.
[Shaw96]
A Field Guide to Boxology, M. Shaw, P. Clementes, 1996


zhyiwww 2008-05-09 16:30 发表评论
]]>
Eclipse插ghttp://m.tkk7.com/zhyiwww/archive/2008/02/15/180092.htmlzhyiwwwzhyiwwwFri, 15 Feb 2008 07:58:00 GMThttp://m.tkk7.com/zhyiwww/archive/2008/02/15/180092.htmlhttp://m.tkk7.com/zhyiwww/comments/180092.htmlhttp://m.tkk7.com/zhyiwww/archive/2008/02/15/180092.html#Feedback0http://m.tkk7.com/zhyiwww/comments/commentRss/180092.htmlhttp://m.tkk7.com/zhyiwww/services/trackbacks/180092.html AmaterasUML_1.3.1
主页Q?a target="_blank">http://unimod.sourceforge.net/index.html (@sourceforge)
在线更新地址Q?a target="_blank">http://unimod.sf.net/update
截图Q?a target="_blank">http://unimod.sourceforge.net/screen-shots.html

To install JSEclipse follow the steps below:

  1. Open the Eclipse workbench.
  2. To install new software with the Update manager, in the main Eclipse menu, go to Help > Software Updates ->Find and Install.
  3. In the user interface that opens, select the Search for new features to install.
  4. In the next step you choose what locations will be searched. If this is the first time installing JSEclipse, you have to add a New remote site. If you already have it defined, skip to step 7.
  5. To define a new site to be searched for available plugins, in the user interface click the New Remote Site button.
  6. The New Update Site dialog box opens. It contains two fields that must be completed:
  7. Check the newly added entry's checkbox. This will set it as active for the software search. You can disable or enable sites on which the software search is performed by checking, respectively un-checking them in the user interface
  8. Click Finish to start searching for software. A new window will appear showing the search progress.
  9. Once the search completes, a list of the features available on the remote site will be displayed, with their respective version, using an hierarchical display
  10. Select the feature to install by checking its checkbox. Click Next to continue.
  11. The license agreement for each selected feature is displayed next. You must accept the licence agreement in order to continue with the install process. Click the I accept the terms in the license agreement radio button, then Next to move on.
  12. Next select where to install the plugin. By default, it is the current folder. Use the default and click Finish to install.
  13. If your configuration is set to check plugins for a digital signature, a confirmation window is displayed, warning if the plugin is not digitally signed. Simply click Install to close the window and install the plugin
  14. After the installation is completed, and all features have been copied to the desired location, a dialog box will ask for a restart of the workbench. Although some features can be enabled without restarting the workbench, a restart is recommended. Select Yes.
  15. JSEclipse has been installed.

PropertiesEditor Plugin Install

   1. Please choose from the screen of Eclipse with "Help" ->"Software Updates" -> "Update Manager". An 'Update Manager' opens.

   2. In the "Feature Updates" view at the lower left of an 'Update Manager', please carry out the right click of the "Sites to Visit", and create a site bookmark by "New" -> "Site Bookmark...".
      - The bookmark to create should input the following "URL" and should push an "Finish" button.
      Name: Arbitrary input
      URL : http://propedit.sourceforge.jp/eclipse/updates/
      Bookmark type: Eclipse update site

   3. If a site bookmark is created, the bookmark created at the bottom of "Feature Updates" will appear.
      A click of "jp.gr.java_conf.ussiy.app.propedit.eclipse.feature.PropertiesEditorFeature x.x.x" displays a preview on a right window. Since the button "Install Now" is in around the lower right, please click.

   4. Since an installation wizard starts, please click a "Next" button rapidly.

   5. "You will need to restart the workbench for the changes to take effect. Would you like to restart now?" is displayed. Please reboot Eclipse according to a dialog.

Implementors feature

Alternatively, use the Eclipse update site at: http://eclipse-tools.sourceforge.net/updates/

Quantum

To install Quantum, start Eclipse, go to Help->Software Updates->Find and Install...->Search for New Features to Install. There create a new site clicking on the "New Remote Site" button. In "Name" In "Name" write "Quantum DB Update Site". In "URL" type " http://quantum.sourceforge.net/update-site". Then click on "Finish". You'll have to get something like this screen, only without the error message (that's if you still haven't installed GEF, and without the marks in the selection boxes. You have to select the features you want (select them all if in doubt) and click on "Finish"


eclipseW一个struts2插g

官方地址Qhttp://mvcwebproject.sourceforge.net

一Q安?br />            启动eclipse3.3 在help---->software updates----->find and install---->install new features---->New remote site----->输入 http://mvcwebproject.sourceforge.net

安装教程地址Q?a >http://mvcwebproject.sourceforge.net/install.html

二:使用
              使用手把手教E地址Qhttp://mvcwebproject.sourceforge.net/tutorial.html

三:使用教程手把手地址中的helloword例子源码Q?br />              下蝲地址Qhttp://mvcwebproject.sourceforge.net/tutorials/HelloWorld2.zip


SubVersion plugin
   http://subclipse.tigris.org/install.html



zhyiwww 2008-02-15 15:58 发表评论
]]>
我常使用的Y件收?/title><link>http://m.tkk7.com/zhyiwww/archive/2007/08/13/136320.html</link><dc:creator>zhyiwww</dc:creator><author>zhyiwww</author><pubDate>Mon, 13 Aug 2007 03:00:00 GMT</pubDate><guid>http://m.tkk7.com/zhyiwww/archive/2007/08/13/136320.html</guid><wfw:comment>http://m.tkk7.com/zhyiwww/comments/136320.html</wfw:comment><comments>http://m.tkk7.com/zhyiwww/archive/2007/08/13/136320.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://m.tkk7.com/zhyiwww/comments/commentRss/136320.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/zhyiwww/services/trackbacks/136320.html</trackback:ping><description><![CDATA[Eclipse<br />    Java开发工?br />Jbuilder<br />    Java开发工?br />MindManager<br />    思维导图软g<br />Firefox<br />    览?br />Daemon<br />    一个好用的虚拟光驱<br />EditPlus<br />    文本~辑?支持正则表达?br />UltraEditor<br />    文本~辑?支持正则表达?br />RegexRubby<br />    正则表达式的搜烦和测试工?br />EditPad<br />    文本~辑器,支持正则表达?br />PowerGrep<br />    正则表达式的搜烦和测试工?img src ="http://m.tkk7.com/zhyiwww/aggbug/136320.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/zhyiwww/" target="_blank">zhyiwww</a> 2007-08-13 11:00 <a href="http://m.tkk7.com/zhyiwww/archive/2007/08/13/136320.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>如何解决在linux上启动elcipse和myeclipse时出现的问题http://m.tkk7.com/zhyiwww/archive/2006/11/24/83249.htmlzhyiwwwzhyiwwwFri, 24 Nov 2006 06:36:00 GMThttp://m.tkk7.com/zhyiwww/archive/2006/11/24/83249.htmlhttp://m.tkk7.com/zhyiwww/comments/83249.htmlhttp://m.tkk7.com/zhyiwww/archive/2006/11/24/83249.html#Feedback0http://m.tkk7.com/zhyiwww/comments/commentRss/83249.htmlhttp://m.tkk7.com/zhyiwww/services/trackbacks/83249.html如何解决q个问题呢?在网上有的朋友也说过q样的问题:自己写一个脚本,然后执行可以了?br />其实也可以用下面的办法Q?br />其实Q出现异常的原因是Ҏ件的讉K权限的问题?br />所以我们只需要修改eclipse的文件权限就可以了?br />Ҏ如下Q执行如下命令:
chmod 777 -R /program/eclipse Q这个命令的意思是要修改eclipse下的每一个目录和文g的属性)
/program/eclipse是我的eclipse的安装目录.
现在Q你在启动用eclipse׃会有问题了.
{你装完了myeclipse,在用就也没有问题了Q?br />如果你没有执行上面的命o的话Q那么你在用Myeclipse也会出现和eclipse一L异常Q?img src ="http://m.tkk7.com/zhyiwww/aggbug/83249.html" width = "1" height = "1" />

zhyiwww 2006-11-24 14:36 发表评论
]]>
MyEclipse的heap大小的设|?/title><link>http://m.tkk7.com/zhyiwww/archive/2006/11/23/83055.html</link><dc:creator>zhyiwww</dc:creator><author>zhyiwww</author><pubDate>Thu, 23 Nov 2006 07:36:00 GMT</pubDate><guid>http://m.tkk7.com/zhyiwww/archive/2006/11/23/83055.html</guid><wfw:comment>http://m.tkk7.com/zhyiwww/comments/83055.html</wfw:comment><comments>http://m.tkk7.com/zhyiwww/archive/2006/11/23/83055.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/zhyiwww/comments/commentRss/83055.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/zhyiwww/services/trackbacks/83055.html</trackback:ping><description><![CDATA[在用MyEclipse~译E序的时?提示heapI间不,所以我们就需要自p定其使用的heap的空间大。默认情况下,Eclipse的用的heapI间大小?4M?br />出现的问题提C常常是Q如图:<br /><img height="654" alt="heap.JPG" src="http://m.tkk7.com/images/blogjava_net/zhyiwww/Eclipse/heap.JPG" width="958" border="0" /><br /><br />解决ҎQ?br />在eclipse的安装目录下面,新徏一个文件eclipse.ini,内容如下Q?br />-vmargs<br />-Xms128m<br />-Xmx512m<br /><font color="#000080" size="4">-XX:PermSize=256M</font><br />-XX:MaxPermSize=512M<br /><br />蓝色字体的部分是最主要的配|参敎ͼ<br />然后重启eclipse,一切okQ?img src ="http://m.tkk7.com/zhyiwww/aggbug/83055.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/zhyiwww/" target="_blank">zhyiwww</a> 2006-11-23 15:36 <a href="http://m.tkk7.com/zhyiwww/archive/2006/11/23/83055.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Eclipse的启动参?/title><link>http://m.tkk7.com/zhyiwww/archive/2006/11/23/83039.html</link><dc:creator>zhyiwww</dc:creator><author>zhyiwww</author><pubDate>Thu, 23 Nov 2006 06:48:00 GMT</pubDate><guid>http://m.tkk7.com/zhyiwww/archive/2006/11/23/83039.html</guid><wfw:comment>http://m.tkk7.com/zhyiwww/comments/83039.html</wfw:comment><comments>http://m.tkk7.com/zhyiwww/archive/2006/11/23/83039.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/zhyiwww/comments/commentRss/83039.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/zhyiwww/services/trackbacks/83039.html</trackback:ping><description><![CDATA[ <strong> <span id="ascmga4" class="tpc_title">调整Eclipse的启?转蝲)</span> <br /> </strong> <span id="emaqe6c" class="tpc_content"> <font size="2"> <br /> <br />如果你觉得你的Eclipse在启动的时候很慢(比如说超q?0U钟Q,也许你要调整一下你的Eclipse启动参数了,以下是一些``脓?':<br /><br />1. 查启动Eclipse的JVM讄?在Help\About Eclipse SDK\Configuration Detail里面Q你可以看到启动Eclipse的JVM?q个JVM和你在Eclipse中设|的Installed JDK是两回事情?如果启动Eclipse的JVMq是JDK 1.4的话Q那最好改为JDK 5Q因为JDK 5的性能?.4更好?br /><br />C:\eclipse\eclipse.exe -vm "C:\Program Files\Java\jdk1.5.0_08\ bin\javaw.exe"<br /><br />2. 查Eclipse所使用的heap的大?在C:\eclipse目录下有一个配|文件eclipse.iniQ其中配|了Eclipse启动的默认heap大小<br /><br />-vmargs<br />-Xms40M<br />-Xmx256M<br /><br />所以你可以把默认值改?<br /><br />-vmargs<br />-Xms256M<br />-Xmx512M<br /><br />当然Q也可以q样做,把堆的大改?56 - 512?br /><br />C:\eclipse\eclipse.exe -vm "C:\Program Files\Java\jdk1.5.0_08\ bin\javaw.exe" -vmargs -Xms256M -Xmx512M<br /><br />3. 其他的启动参数?如果你有一个双核的CPUQ也许可以尝试这个参?<br /><br />-XX:+UseParallelGC<br /><br />让GC可以更快的执行。(只是JDK 5里对GC新增加的参数Q?/font> </span> <img src ="http://m.tkk7.com/zhyiwww/aggbug/83039.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/zhyiwww/" target="_blank">zhyiwww</a> 2006-11-23 14:48 <a href="http://m.tkk7.com/zhyiwww/archive/2006/11/23/83039.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>如何在Eclipse中显C?/title><link>http://m.tkk7.com/zhyiwww/archive/2006/10/27/77622.html</link><dc:creator>zhyiwww</dc:creator><author>zhyiwww</author><pubDate>Fri, 27 Oct 2006 06:35:00 GMT</pubDate><guid>http://m.tkk7.com/zhyiwww/archive/2006/10/27/77622.html</guid><wfw:comment>http://m.tkk7.com/zhyiwww/comments/77622.html</wfw:comment><comments>http://m.tkk7.com/zhyiwww/archive/2006/10/27/77622.html#Feedback</comments><slash:comments>53</slash:comments><wfw:commentRss>http://m.tkk7.com/zhyiwww/comments/commentRss/77622.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/zhyiwww/services/trackbacks/77622.html</trackback:ping><description><![CDATA[ <h1 style="MARGIN: 17pt 0cm 16.5pt; TEXT-ALIGN: center" align="center"> <span style="COLOR: green; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">如何?/span> <span lang="EN-US" style="COLOR: green">Eclipse</span> <span style="COLOR: green; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中显C?/span> <span lang="EN-US" style="COLOR: green"> <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /?> <o:p> </o:p> </span> </h1> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt"> <b style="mso-bidi-font-weight: normal"> <span style="FONT-SIZE: 12pt; FONT-FAMILY: 楷体_GB2312">q个问题Q困C我好长时_今天l于扑ֈ了。其实很单,l过以下几步Q就一切搞定了Q?span lang="EN-US"><o:p></o:p></span></span> </b> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 21pt; TEXT-INDENT: -21pt; mso-list: l0 level1 lfo1; tab-stops: list 21.0pt"> <b style="mso-bidi-font-weight: normal"> <span lang="EN-US" style="FONT-SIZE: 12pt; FONT-FAMILY: 楷体_GB2312; mso-bidi-font-family: 楷体_GB2312"> <span style="mso-list: Ignore">1)<span style="FONT: 7pt 'Times New Roman'">     </span></span> </span> </b> <b style="mso-bidi-font-weight: normal"> <span style="FONT-SIZE: 12pt; FONT-FAMILY: 楷体_GB2312">先打开一个类Q如下图Q?span style="COLOR: green; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"><img style="WIDTH: 585px; HEIGHT: 391px" height="526" alt="class.JPG" src="http://m.tkk7.com/images/blogjava_net/zhyiwww/Eclipse/class.JPG" width="774" border="0" /></span><br /><br /><span lang="EN-US"><o:p></o:p></span></span> </b> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt -44.95pt; TEXT-ALIGN: center; mso-para-margin-left: -4.28gd" align="center"> <b style="mso-bidi-font-weight: normal"> <span lang="EN-US" style="FONT-SIZE: 12pt; FONT-FAMILY: 楷体_GB2312"> <?xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" /?> <v:shapetype id="_x0000_t75" stroked="f" filled="f" path="m@4@5l@4@11@9@11@9@5xe" o:preferrelative="t" o:spt="75" coordsize="21600,21600"> <v:stroke joinstyle="miter"> </v:stroke> <v:formulas> <v:f eqn="if lineDrawn pixelLineWidth 0"> </v:f> <v:f eqn="sum @0 1 0"> </v:f> <v:f eqn="sum 0 0 @1"> </v:f> <v:f eqn="prod @2 1 2"> </v:f> <v:f eqn="prod @3 21600 pixelWidth"> </v:f> <v:f eqn="prod @3 21600 pixelHeight"> </v:f> <v:f eqn="sum @0 0 1"> </v:f> <v:f eqn="prod @6 1 2"> </v:f> <v:f eqn="prod @7 21600 pixelWidth"> </v:f> <v:f eqn="sum @8 21600 0"> </v:f> <v:f eqn="prod @7 21600 pixelHeight"> </v:f> <v:f eqn="sum @10 21600 0"> </v:f> </v:formulas> <v:path o:connecttype="rect" gradientshapeok="t" o:extrusionok="f"> </v:path> <o:lock aspectratio="t" v:ext="edit"> </o:lock> </v:shapetype> <o:p> </o:p> </span> </b> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 21pt; TEXT-INDENT: -21pt; mso-list: l0 level1 lfo1; tab-stops: list 21.0pt"> <b style="mso-bidi-font-weight: normal"> <span lang="EN-US" style="FONT-SIZE: 12pt; FONT-FAMILY: 楷体_GB2312; mso-bidi-font-family: 楷体_GB2312"> <span style="mso-list: Ignore">2)<span style="FONT: 7pt 'Times New Roman'">     </span></span> </span> </b> <b style="mso-bidi-font-weight: normal"> <span style="FONT-SIZE: 12pt; FONT-FAMILY: 楷体_GB2312">然后打开视图Q如何打开呢?最能解决问题的也就在此了:<span lang="EN-US"><o:p></o:p></span></span> </b> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 21pt"> <b style="mso-bidi-font-weight: normal"> <span style="FONT-SIZE: 12pt; FONT-FAMILY: 楷体_GB2312">?span lang="EN-US">Ctrl+F10,</span>效果如下图:<br /><img style="WIDTH: 586px; HEIGHT: 354px" height="460" alt="view.JPG" src="http://m.tkk7.com/images/blogjava_net/zhyiwww/Eclipse/view.JPG" width="777" border="0" /><br /><span lang="EN-US"><o:p></o:p></span></span> </b> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt -45pt"> <b style="mso-bidi-font-weight: normal"> <span lang="EN-US" style="FONT-SIZE: 12pt; FONT-FAMILY: 楷体_GB2312"> <o:p> </o:p> </span> </b> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 21pt; TEXT-INDENT: -21pt; mso-list: l0 level1 lfo1; tab-stops: list 21.0pt"> <b style="mso-bidi-font-weight: normal"> <span lang="EN-US" style="FONT-SIZE: 12pt; FONT-FAMILY: 楷体_GB2312; mso-bidi-font-family: 楷体_GB2312"> <span style="mso-list: Ignore">3)<span style="FONT: 7pt 'Times New Roman'">     </span></span> </span> </b> <b style="mso-bidi-font-weight: normal"> <span style="FONT-SIZE: 12pt; FONT-FAMILY: 楷体_GB2312">然后选择<span lang="EN-US">Show Line Numbers<br /><img style="WIDTH: 585px; HEIGHT: 320px" height="423" alt="select.JPG" src="http://m.tkk7.com/images/blogjava_net/zhyiwww/Eclipse/select.JPG" width="773" border="0" /><br /><o:p></o:p></span></span> </b> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt -45.05pt; mso-para-margin-left: -4.29gd"> <b style="mso-bidi-font-weight: normal"> <span lang="EN-US" style="FONT-SIZE: 12pt; FONT-FAMILY: 楷体_GB2312"> <o:p> </o:p> </span> </b> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 21pt; TEXT-INDENT: -21pt; mso-list: l0 level1 lfo1; tab-stops: list 21.0pt"> <b style="mso-bidi-font-weight: normal"> <span lang="EN-US" style="FONT-SIZE: 12pt; FONT-FAMILY: 楷体_GB2312; mso-bidi-font-family: 楷体_GB2312"> <span style="mso-list: Ignore">4)<span style="FONT: 7pt 'Times New Roman'">     </span></span> </span> </b> <b style="mso-bidi-font-weight: normal"> <span style="FONT-SIZE: 12pt; FONT-FAMILY: 楷体_GB2312">最后的效果如图Q?br /><img style="WIDTH: 578px; HEIGHT: 267px" height="401" alt="Line result.JPG" src="http://m.tkk7.com/images/blogjava_net/zhyiwww/Eclipse/Line%20result.JPG" width="773" border="0" /><br /><span lang="EN-US"><o:p></o:p></span></span> </b> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt -44.95pt; mso-para-margin-left: -4.28gd"> <b style="mso-bidi-font-weight: normal"> <span lang="EN-US" style="FONT-SIZE: 12pt; FONT-FAMILY: 楷体_GB2312"> <o:p> </o:p> </span> </b> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 21pt; TEXT-INDENT: -21pt; mso-list: l0 level1 lfo1; tab-stops: list 21.0pt"> <b style="mso-bidi-font-weight: normal"> <span lang="EN-US" style="FONT-SIZE: 12pt; FONT-FAMILY: 楷体_GB2312; mso-bidi-font-family: 楷体_GB2312"> <span style="mso-list: Ignore">5)<span style="FONT: 7pt 'Times New Roman'">     </span></span> </span> </b> <b style="mso-bidi-font-weight: normal"> <span lang="EN-US" style="FONT-SIZE: 12pt; FONT-FAMILY: 楷体_GB2312"> <span style="mso-spacerun: yes"> </span> </span> </b> <b style="mso-bidi-font-weight: normal"> <span style="FONT-SIZE: 12pt; FONT-FAMILY: 楷体_GB2312">pL单,你就可以在编辑器中看C的代码的行号了?b style="mso-bidi-font-weight: normal"><span style="FONT-SIZE: 12pt; FONT-FAMILY: 楷体_GB2312">其实最重要的是知道<span lang="EN-US">Ctrl+F10</span>能打开视图菜单׃切搞定了?span lang="EN-US"><o:p></o:p></span></span></b></span> </b> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt"> <span lang="EN-US"> <o:p> </o:p> </span> </p> <img src ="http://m.tkk7.com/zhyiwww/aggbug/77622.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/zhyiwww/" target="_blank">zhyiwww</a> 2006-10-27 14:35 <a href="http://m.tkk7.com/zhyiwww/archive/2006/10/27/77622.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Apache配置(转蝲)http://m.tkk7.com/zhyiwww/archive/2006/10/25/77234.htmlzhyiwwwzhyiwwwWed, 25 Oct 2006 08:59:00 GMThttp://m.tkk7.com/zhyiwww/archive/2006/10/25/77234.htmlhttp://m.tkk7.com/zhyiwww/comments/77234.htmlhttp://m.tkk7.com/zhyiwww/archive/2006/10/25/77234.html#Feedback0http://m.tkk7.com/zhyiwww/comments/commentRss/77234.htmlhttp://m.tkk7.com/zhyiwww/services/trackbacks/77234.html  

Apache配置

   http://grid.tsinghua.edu.cn/home/liulk/publish/computer/ApacheConfig.html

  Linux Apache Web 服务器终极教E作者:佚名 文章来源Qinternet 

  Ҏ著名的WWW服务器调查公司所作的调查Q世界上癑ֈ之五十以上的WWW服务
  器都在用ApacheQ是世界排名W一的WEB服务器。Apache的诞生极富有戏剧性?
  当NCSA WWW服务器项目停后Q那些用NCSA WWW服务器的Z开始交换他?
  用于该服务器的补丁程序,他们也很快认识到成立理q些补丁E序的论坛是
  必要的。就q样Q诞生了Apache GroupQ后来这个团体在NCSA的基上创Z
  Apache?

    Apache的主要特征是Q?

  .  可以q行上所有计机q_Q?

  .  支持最新的HTTP 1.1协议Q?

  .  单而强有力的基于文件的配置Q?

  .  支持通用|关接口CGIQ?

  .  支持虚拟LQ?

  .  支持HTTP认证Q?

  .  集成Perl脚本~程语言Q?

  .  集成的代理服务器Q?

  .  h可定制的服务器日志;

  .  支持服务器端包含命oQSSIQ?

  .  支持安全Socket层(SSLQ?

  .  用户会话q程的跟t能力;

  .  支持FastCGIQ?

  .  支持Java Servlets?


  安装Apache


    下面我们开始O漫征服Apache之旅Q通过循序渐进的需求实例,一步步
  地学习用ApacheQ从入门到精通?



  pȝ需?

    q行Apache不需要太多的计算资源。它在有6-10MB盘I间?MB RAM?
  Linuxpȝ上运行得很好。然而,只运行Apache可能不是你想做的事情。更可能
  的是Q你惌行Apache来提供WWW服务、启动CGIq程以及充分利用所有WWW能够
  提供的o人惊奇的功能。在q种情况下,你需要提供反映负载要求的额外的磁
  盘空间和内存I间。也是_如果仅仅是启动WWW服务q不需要太多的pȝ?
  源,但是惌能ؓ大量的客h供服务就需要更多的pȝ资源?

  获取软g

    你可以在http://www.apache.org中获得Apache的最新版。而几乎所有的
  Linux发行版中均包含有Apache软g包,你也可以直接使用它?

  需要注意的是,Apache软g包有两种Q一U是源代码,下蝲后需要自己重新编
  译;另一U是可执行文Ӟ下蝲后只需解压可以用?



  安装软g

    你可以通过以下三种Ҏ安装Apache服务器?


    1Q如果你安装的Linux版本中带用Apache的话Q就在选择所要安装的服务
  器的时候,httpdq个服务选上QLinux安装E序自动完成Apache的安装工
  作,q做好基本的配置?

    2Q用可执行文g软g包,q比较适合那些对编译工作不是太熟悉的初U?
  用户Q因为它相对比较单?

    下蝲软g包apache_1.2.4.e.tar.gz

    tar xvzf apache_1.2.4.e.tar.gz

    q就完成了安装工作,单吧Q?

    如果你用的是RedHat Linux的话Q你也可以下载apache_1.2.4.rpm软g
  安装包,然后使用rpm -ivh   apache_1.2.4.rpm命o安装?

    3Q如果你xApache服务器充分利用v来的话,׃定要自己~译
  Apache定制其功能?

  下蝲包含Apache源代码的软g包apache_1.2.4.tar.gzQ?然后用tar命o它?
  开Q?当前目录改变ؓApache源代码发行版的src目录Q?配|样本文?
  QConfiguration.tmplQ复制ؓConfiguration文gQ?

  ~辑Configuration文g中的配置选项Q?

  Makefile配置选项Q一些编译选项Q?

  . "CC="一行指定用什么编译Y件编译,一般ؓ"CC=gcc"Q?

  . 如果需要将额外的标志(参数Q指定给C~译软gQ可以用:

  EXTRA_CFLAGS=

  EXTRA_LFLAGS=

  . 如果pȝ需要特D的库和包含文gQ可以在q里指定它们Q?

  EXTRA_LIBS=

  EXTRA_INCLUDES=

  . 如果你要改变代码优化讄的话Q你d下面一句去掉注释,?

  后改成你所需要的|

  #OPTIM=-O2

  Rule配置选项Q用来决定需要什么功能,一般情况下无需改变?

  模块配置Q模块是Apache的组成部分,它ؓApache内核增加新功能。通过使用
  模块配置Q可以自定义在Apache服务器中需要什么功能,q个部分也是Apache
  灉|性的表现。模块配|行如下所C:

  AddModule modules/standard/mod_env.o

  如果你需要Apache服务器具备什么功能,将那个模块用AddModule语句加到?
  |文件Configuration中去?

  下表列出了Apache的模块功能:

  模块?功能 ~省

  mod_access 提供ZL的访问控制命?y

  mod_actions 能够q行ZMIMEcd的CGI脚本或HTTPhҎ y

  mod_alias 能执行URL重定向服?y

  mod_asis 使文档能在没有HTTP头标的情况下被发送到客户?y

  mod_auth 支持使用存储在文本文件中的用户名、口令实现认?y

  mod_auth_dbm 支持使用DBM文g存储基本HTTP认证 n

  mod_auth_mysql 支持使用MySQL数据库实现基本HTTP认证 n

  mod_auth_anon 允许以匿名方式访问需要认证的区域 y

  mod_auth_external支持使用W三方认?n

  mod_autoindex 当缺烦引文件时Q自动生成动态目录列?y

  mod_cern_meta 提供对元信息的支?n

  mod_cgi 支持CGI y

  mod_dir 能够重定向Q何对不包括尾部斜杠字W命令的h y

  mod_env 使你能够环境变量传递给CGI或SSI脚本 n

  mod_expires 让你定Apache在服务器响应h时如何处理Expires y

  mod_headers 能够操作HTTP应答头标 y

  mod_imap 提供囑Ş映射支持 n

  mod_include 使支持SSI n

  mod_info Ҏ务器配置提供了全面的描述 y

  mod_log_agent 允许在单独的日志文g中存储用户代理的信息 n

  mod_log_config 支持记录日志 y

  mod_log_referer 提供了将h中的Referer头标写入日志的功?n

  mod_mime 用来向客L提供有关文档的元信息 y

  mod_negotiation 提供了对内容协商的支?y

  mod_setenvif 使你能够创徏定制环境变量 y

  mod_speling 使你能够处理含有拼写错误或大写错误的URLh n

  mod_status 允许理员通过WEB理Apache y

  mod_unique_id 为每个请求提供在非常Ҏ的条件下保证是唯一的标?n


  在src目录下执行:". /configure"Q?

  ~译ApacheQ执行命?make"Q?

  Ҏ机器性能的不同,l历一D?-30分钟的编译,大功告成了?

  编译好的可执行文ghttpd复制?etc/httpd/bin目录下;

  Apache发行版的配置文gQaccess.conf、httpd.conf、mime.types?
  srm.conf文g复制?etc/httpd/conf目录下。到此ؓ止,安装完成?


  一些说?

  在Red Hat Linux 6.0中,Apache自q所有配|文件和日志文g攑֜?
  "/etc/httpd"目录下,其中"/etc/httpd/conf"下ؓ配置?
  Ӟ"/etc/httpd/log"下ؓ日志文g?

  同时Q它徏?/home/httpd"目录Qƈ在其下徏立三个子目录Q?html/"Q在
  q个目录下存放HTMLQ主)文gQ?cgi-bin/"Q在q个目录下可以存放一?
  CGIE序Q?icons/"Q在q个目录下是服务器自带的一些图标?

  配置Apache基础,让WWW服务器跑h

  Apache 服务器Y件的配置文g主要有:"access.conf"Q用于设|系l中的存
  取方式和环境Q?httpd.conf"Q用于设|服务器启动的基本环境;
  "srm.conf"Q主要用于做文g资源上的讑֮Q?mime.type"Q记录Apache服务?
  所能识别的MIME格式?

  在具体讲解之前,我们必须告诉大家QApache已经在安装时采用了一pd?
  ~省|已经让WWW服务器跑h了。你只需要将装上Linux+Apache的主?
  InternetQ然后将主页存放?/home/httpd"目录下即可?

  下面介绍一些最主要的配|选项的含义,以便大家用最的_֊、最的配置
  准备好服务器?


  httpd.conf

  tpd.conf是主配置文g。它告诉服务器将如何q行?

  一、最重要的配|选项ServerType standalone | inetd

    q个配置选项指定如何q行WEB服务器。Apache可以使用两种Ҏ来运行服
  务器Qstandalone(独立?和inetd(由inetdq行?。standalone参数表示
  WEB服务q程以一个单独的守候进E的方式在后C听是否有客户端的hQ如
  果有q成一个子q程来ؓ其服务?inetd参数表示WEB服务不是以一个单独的
  守候进E的形式支持。而是由Inetdq个服务器守候进E进行代劻I当它?
  C个客L的WEB服务h的时候,再启动一个WEB服务q程为其服务。从?
  能的角度看,q两U方法几乎是相同的。但它们之间实际有很大区别,区别?
  于服务器的性能。一个由 intedq行的服务器q程在它l束对请求服务的同时
  立刻退出。而在standalone模式下,子WWW服务器进E在退Z前要挂v一D|
  _q就l它们提供了ZQ可以重新用来服务新的请求?

  在standalone模式下,不存在对每个h启动新进E的开销Q所以它的效率更
  高;而inetd模式被认为比standalone模式更具安全性?

  standalone模式Q?

  此种模式下,WWW服务器侦听特定端口的q接h。当客户机发出到特定端口?
  址的连接请求时Q主服务器进E启动子WWW服务q程来服务该h。另外还需?
  告诉L务器q程侦听的特定端口地址Q用命令:

  Port [number] Q缺省gؓ80Q?

  inetd模式

  inetd 是侦听有于1024的端口连接请求的Internet守护q程(一个服务器q?
  E?。与前面的方法不同,当客Ll发出到WWW服务器的q接hӞ inetd
  启动一个WWW服务器进E,由此q程服务此请求,完成服务后即退出。如果选择
  通过inetd服务器来q行ApacheQ需要编?/etc/inetd.conf文g为Apached
  一条新的记录:

  httpd stream tcp nowait httpd /etc/httpd/bin/httpd -f
  /etc/httpd/conf/httpd.conf

  修改?etc/inetd.conf文g后,需要修?etc/services中添加一?

  httpd 80/tcp httpd

  做完以上修改后,需要重新启动inetdq程。首先,使用以下命o取得inetd?
  q程IDQ?

  ps auxw |grep inetd

  然后执行命oQkill -HUP <inetd的进EID>

  在RedHat Linux中,默认是采用inetd服务器来q行ApacheQ所以只要你在安?
  旉择了httpdQ以上工作在安装时就已经代你完成了?


  二、其它配|选项

    Server Admin命oQ用来设|WEB理员的E-Mail地址。这个地址会出现在
  pȝq接出错的时候,以便讉K者能够将情况及时地告知WEB理员?

  命o格式: Server Admin [you E-Mail address]

  例:Server Admin admin@xxx.com

  ErrorLog命oQ用来指定错误记录文件名U和路径?

  命o格式: ErrorLog [log filename]

  例:ErrorLog /var/httpd/error.log

  Timeout命oQ只要客L过q里讑֮的秒数还没有完成一个请求的话,服务
  端将l止q次h服务。如果网l速度较慢的话Q徏议在此设|较大的数倹{?
  以给客户端更多机会?

  命o格式: Timeout [second]

  例:Timeout 120

  ServerRoot命oQ它指定在何处保存服务器的配|、错误及日志文g?

  命o格式: ServerRoot [fully qualified path name]

  例:ServerRoot /etc/httpd

  ServerName命oQ它配置服务器的InternetL?

  命o格式: ServerName [host name]

  例:ServerName www.xxx.com


  srm.conf

  srm.conf是资源配|文Ӟ用它来告诉服务器你想在WWW站点上提供什么资源以
  及在哪里和如何提供们?

  DocumentRoot命oQ用来指定主文档的地址?

  命o格式: DocumentRoot [Path]

  例:DocumentRoot /home/httpd/html

  UserDir 命oQ用来指定个Z늚位置。如果你有一个用户testQ那么它?
  目录?/home/test"Q当客户端输?http: //yourdomain/~test";;Q系l就
  会到对应的目?/home/test/UserDir/"中去L。其?UserDir"是?
  UserDir命o中设|的指定目录?

  命o格式: UserDir [Path]

  例: UserDir Public_html

  DirectoryIndex 命oQ用来声明首|件名U。一般地Q我们?
  "index.html"?index.htm"作ؓ首页的文件名。如果这栯|后Q那么客L
  发出 WEB服务hӞ首先调入的主页是在指定目录下文?quot;index.html"?
  "index.htm"?

  命o格式: DirecotryIndex [filename]

  例:DirecotryIndex index.html index.htm

  ScriptAlias命oQؓ脚本E序目录起个别名Q具体可?.7节?

  命o格式: ScriptAlias [/alias/] [fullly qualified path for script
  directory]

  例: ScriptAlias /cgi-bin/ /home/httpd/cgi-bin


  access.conf的配|?

  access.conf文g用来讄WWW站点上诸如文件、目录和脚本目的访问权限?
  该文件的W一D非注释部分如下Q?

  <Directory /home/httpd/html>

  Option Indexes Includes ExecCGI FollowSymLink

  AllowOverride None

  Order allow , deny

  allow from all

  </Directory>

  大家应该注意刎ͼq一个部分是?lt;Directory /home/httpd/html>开始,?
  </Directory>l束的。这表示在其中间的部分都是针Ҏ定目?
  &#0;&#0;"/home/httpd/html"而言的?

  1QOption命o有很多的参数Q各个参数的意义如下所C:

  All 准许以下所有功能(MultiViews除外Q;

  MultiViews 准许内容协商的MultiviewsQ?

  Indexes 若该目录下无index文gQ则准许昄该目录下的文件以供选择Q?

  IncludesNOEXEC 准许SSI(Server-side Includes)Q但不可使用#exec?
  #include功能Q?

  Includes 准许SSIQ?

  FollowSymLinks 准许W号链接到其他目录;

  ExecCGI 准许该目录下可以使用CGI?

  2Q而AllowOverride命o则是用来军_是否准许?access.conf"文g中设定的
  权限是否可以被在文g".htaccess"中设定的权限覆盖。它有两个参敎ͼ

  All 准许覆盖Q?

  None 不准许覆盖?

  3QOrder命oQ用来设定谁能从q个服务器取得控制。它也有两个参数Q?


  allow 可以取得控制Q?

  deny 止取得控制?

  现在我们一h看看关于目录"/home/httpd/html"的设|的含义Q它使得q个
  目录Q如果不存在index.htm文gӞ列出目录信息以供选择Q准许SSIQ允?
  执行CGIE序Q开启了动态连接。它不允许再使用在文?.htaccess"中设定来
  覆盖q里所讄的权限。所有的人都可以取得控制?

  该文件的W二D非注释部分如下Q?

  <Directory /home/httpd/cgi-bin>

  Option ExecCGI

  AllowOverride None

  </Directory>

  q个表示目录"/home/httpd/cgi"的设|ؓQ当前目录下可以执行CGIE序。不
  允许再用在文g".htaccess"中设定来覆盖q里所讄的权限?

  需要说明的是,不同的LINUXpȝ中,可以在这个文件中看到的信息不完全?
  同,但是Ҏq里l出的信息,大家可以参照命o的解释自行理解文件中的设
  |,以及Ҏ自己的需要进行相应的修改?

  4.4 使新的配|生?

  在上面,我们可能已经Ҏ新的需求更改了相应的配|选项Q如果我们要使得
  q个新的配置立即生效。我们就必须重新启动WEB服务q程。在LINUX中,我们
  可以十分方便C用命令行来得WEB服务q程重启?

  /etc/rc.d/init.d/httpd restart

  五、ؓ用户开辟个Z늩?


  如果我们利用了LINUXpȝ架设了一台WEB服务器,我们不仅可以存放公司的主
  ,而且q可以ؓ公司的每一个员工提供一块个Z늚I间?

  首先Qؓ需要个Z늩间的员工在LINUX上开设一个帐受这P它就拥有?
  一个用户主目录"/home/用户帐号??

  addusr 用户帐号?

  passwd 用户帐号?

  在用户主目录下徏立一个目?public_html"Q然后ؓ其设|相应的权限?

  cd ~用户帐号?

  mkdir public_html

  chmod 755 public_html

  认在srm.conf文g中的UserDir命o讄的是public_html目录。让员工自
  q个h主页上传到自q户主目录下的public_html目录中?

  现在可以?http://www.company.com/~用户帐号?来访问员工的个h?
  了?

  用Apache实现虚拟L服务


    什么是虚拟L服务

    所谓的虚拟L服务是指将一台机器虚拟成多台WEB服务器。D个例子来
  _一家公司想从事提供L代管服务Q它为其它企业提供WEB服务。那么它?
  定不是ؓ每一家企业都各准备一台物理上的服务器Q而是用一台功能较强大?
  大型服务器,然后用虚拟主机的形式Q提供多个企业的WEB服务Q虽然所有的
  WEB服务是q台服务器提供的Q但是让讉K者看h却是在不同的服务器上?
  得WEB服务一栗?


    具体地说Q就是,我们可以利用虚拟L服务两个不?
  www.company1.comwww.company2.com的主内定w存放在同一CZ。而访
  问者只需输入公司的域名就可以讉K到它惛_到的主页内容?用Apache讄?
  拟主机服务通常可以采用两种ҎQ基于IP地址的虚拟主机和Z名字的虚?
  LQ下面我们分别介l一下它们的实现Ҏ。以便大家在具体的应用中能够
  选择最合适的实现Ҏ?


  讄实现ZIP地址的虚拟主机服务实现前?

    q种方式需要在机器上设|IP别名Q也是在一台机器的|卡上绑定多?
  IP地址Mؓ多个虚拟L服务。而且要用这功能还要确定在你的LINUX内核
  中必L持IP别名的设|,否则你还必须重新~译内核?

    下面举一个拥有两个虚拟主机的服务讄Q以供参考?

  2Q配|步?

  假设Q我们用来实现虚拟主机服务的机器Q首先已lؓ自己提供了WEB服务Q现
  在将为新的一家www.company1.com提供虚拟L服务?

  规划IP地址Qؓ虚拟L甌新的IP地址。(假设本机IP地址?02.101.2.1Q?

  www.company1.com 202.101.2.2

  2) 让ISP作好相应的域名解析工作?

  3) 为网卡设|IP别名Q?

  /sbin/ifconfig eth0:0 202.101.2.2 netmask 255.255.255.0

  4) 重新讄"/etc/httpd/conf/httpd.conf",在文件中加入Q?

  <VirtualHost 202.101.2.2>

  ServerAdmin webmaster@yourdomain.com

  DocumentRoot /home/httpd/www.company1.com

  ServerName www.company1.com

  ErrorLog /var/log/httpd/www.company1.com/error.log

  </VirtualHost>

  5Q徏立相应的目录?

  mkdir /home/httpd/www.company1.com

  mkdir /var/log/httpd/www.company1.com/error.log

  6)相应的主页内容存放在相应的目录中即可?

  3Q不利因?

  q种虚拟L的实现方法有一个严重的不Q那是Q每增加一个虚拟主机,
  必d加一个IP地址。而由于IP地址I间已经十分紧张Q所以通常情况下是
  无法取得q么多的IP地址的。而且从某U意义上_q也是一UIP地址费?
  讄实现Z名字的虚拟主机服务而基于名字的虚拟L服务Q是比较适合?
  用的一U方案。因为它不需要更多的IP地址Q而且配置单,无须什么特D的
  软硬件支持。现代的览器大都支持这U虚拟主机的实现Ҏ。当Ӟq也?
  是指一些早期的客户端浏览器也许不支持这U虚拟主机的实现Ҏ?

    正是以上原因Q我们没有理׃使用Z名字的虚拟主机服务而用基?
  IP地址的虚拟主机服务。配|基于名字的虚拟L服务需要修攚w|文
  ?quot;/etc/httpd/conf/httpd.conf"Q在q个配置文g中增加以下内宏V?

  NameVirtualHost 202.101.2.1

  <VirtualHost 202.101.2.1>

  ServerAdmin webmaster@yourdomain.com

  DocumentRoot /home/httpd/www.company1.com

  ServerName www.company1.com

  ErrorLog /var/log/httpd/www.company1.com/error.log

  </VirtualHost>

  <VirtualHost 202.101.2.1>

  ServerAdmin webmaster@yourdomain.com

  DocumentRoot /home/httpd/www.company2.com

  ServerName www.company2.com

  ErrorLog /var/log/httpd/www.company2.com/error.log

  </VirtualHost>

    也就是在ZIP地址的配|基上增加一句:NameVirtualHost
  202.101.2.1而已。在本例中,Z体现只需要增加一ơ,所以特别地讄了两
  个虚拟主机服务?

  最后也是徏立相应的目录Q将主页内容攑ֈ相应的目录中d可以了?


  配置CGI

  1. 什么是CGI

  CGI是独立于语言的网x口规范,它实际上可以用Q何广泛流行的应用E序开
  发语a来实玎ͼ包括C、C++、Perl、Shell脚本甚至Java?

  WEB服务器从客户端得到某个URLQ它告诉WEB服务器,必须q行一个CGI外部?
  用程序。那么WEB服务器启动这一应用E序Q等待它完成q返回输出结果。最
  后,它将此应用程序的输出l果传输l另一端的WEB客户?

  2. 为CGI配置Apache

  那么如何使Apache能处理CGIh呢?我们必须通过相应的配|过E告?
  Apache在哪里存储CGIE序Q指明CGIE序的扩展等Q以下我们逐一介绍一下设
  |的内容与步骤?

  创徏存储CGIE序的目?

  创徏集中的CGIE序目录只是建立CGI环境的开始。如果要考虑提高安全

  性的话,应将集中的CGIE序目录保存在DocumnetRoot目录外,使得讉K者不?
  直接讉KCGIE序?W一步:在DocumentRoot目录外创Z个目录,然后所
  有的CGIE序都集中存攑֜q个目录下。例如,你可创徏一?
  /home/httpd/public/apps的目录作为CGIE序的大本营?

  W二步:为CGIE序目录创徏别名Q也是~辑配置文ghttpd.confQ加入:

  ScriptAlias /cgi-bin/ /home/httpd/public/apps

  q样做后Q当客户www.xxx.com/cgi-bin/li.cgiӞWEB服务器就会自动执?
  WEB服务器上?home/httpd/public/apps/li.cgi文g?

  W三步:为CGI目录讄合适的权限Q一般是只允许Apache有读取和执行的权?
  但没有写的权限?

  允许用户讉Kcgi-bin

  我们已经?.5节中介l了如何l用户开辟个Z늩_但如果你?

  用户需要他的主页更具有活力,往往会向你申请cgi-bin讉K服务。下面我?
  ׃l一个Apache服务器ؓ用户提供的两Ucgi-bin讉KҎ?

  1Q用Directory或DirectoryMatch容器

  当在配置文gsrm.conf中用UserDir命o被赋gؓ目录名称ӞApache?

  把它作ؓ用户WWW站点的顶层目录。例如:

  UserDir Public_html

  当Apachewww.xxx.com/~user的请求,到/home/user/Public_html取出主页?
  送给客户?

  如果要ؓ每个用户dCGI支持在Apache的配|文件access.conf中添加下?
  配置Q?

  <DirectoryMatch "/home/[a-z]+/public_html/cgi-bin">

  Options ExecCGI

  AddHandler cgi-script .cgi .pl

  </DirectoryMatch>

  注:DirectoryMatch换成Directory亦可

  在这U方法中QApache服务www.xxx.com/~user/cgi-binh译成ؓ?
  /home/user/Public_html/cgi-bin/Qƈ允许执行M带有正确扩展?.cgi
  ?pl)的CGIE序?

  使用ScriptAliasMatch命o

  通过使用ScriptAliasMatch命oQ也可以为每个用h加CGI支持。例如:

  ScriptAliasMatch ~([a-z]+)/cgi-bin/(.*)
  /home/$1/public_html/cgi-bin/$2

  q个命o用户名?1相匹配,其中$1与~([a-z]+)相等。将/cgi-bin/后面?
  M内容?2相匹配,其中$2?.*)相等?

  q个讄也就实现www.xxx.com/~user/cgi-bin/xxx.cgih解释为:

  /home/user/Public_html/cgi-bin/xxx.cgi

  那么大家想一惻I如果你想这个请求解释ؓQ?

  /home/httpd/public/apps/xxx.cgi

  该如何设|呢Q对Q应该是Q?

  ScriptAliasMatch ~([a-z]+)/cgi-bin/(.*) /home/httpd/public /apps/$2

  3. Apache为CGI提供的环境变?

  Apache服务器提供了许多环境变量可以用于CGIE序的编写,了解它们也一定有
  助于写出充分利用Apache的CGIE序Q所以在此也Ҏ作一单介l?


  服务器变?

  服务器变量由Apache讄用来通知CGIE序有关Apache的情c通过?

  用这些变量,CGIE序能确定有x务器的不同信息:Apache的版本,理员的
  E-Mail地址{?


  SERVER_SOFTWARE

  q个变量是WWW服务器Apache的版本号Q它的值Ş如:Apache/VersionQ如
  Apache/1.3Q?


  GATEWAY_INTERFACE

  q个变量的值是当前CGI规范的版本号Q其值Ş如:CGI/1.1Q?

  SERVER_ADMIN

  如果在httpd.conf文g中有讄站点理员的e-mail地址的话Q这个变量就?
  存放着q个e-mail地址Q?


  DOCUMENT_ROOT

  q个变量存放在是被访问的WWW站点的DocumentRoot命o指定的倹{?

  客户h变量

  Apache提供的有兛_戯求方的环境变量有许多Q以下只是有选择性地介绍一
  些最常见的?


  SERVER_NAME

  此变量可以告诉CGIE序它访问的是哪一个主机。这个值可以是IP地址也可以是
  完整的主机名Q?


  HTTP_ACCEPT

  此变量被赋gؓ客户所能接受的MIMEcd的列表,如:HTTP_ACCEPT=image/gifQ?


  HTTP_ACCEPT_CHARSET

  此变量被赋gؓ客户所能接受的字符集,如:


  HTTP_ACCEPT_CHARASET=iso-8859-1.,*,utf-8Q?


  HTTP_ACCEPT_LANGUAGE

  此变量被赋gؓ客户所能接受的语言Q如QHTTP_ACCEPT_LANGUAGE=enQ?


  HTTP_ACCEPT_AGENT

  q个变量指定发出h的系l正在运行的览器类型和操作pȝQ?

   HTTP_PORTQ服务端口;

  REMOTE_HOSTQ客L的IP地址或IP名称信息Q?


  REMOTE_PORTQ客L的端口号Q?

  4. 一ҎC?

  若干q来Q通过|关接口QCGIQ已成ؓ服务器端应用E序开发的事实标准。但
  随着旉的推U,发现在沉重的CGI负担下许多WWW服务器系l的表现不尽人意?
  q是因ؓCGI规范存在瓉问题Q每当客Ll请求CGI应用E序ӞWWW服务?
  必d动新的CGIq程Q直到完成Q务后l束q程。这在负载不高时Q会工作
  正常。但是,在高负蝲ӞJ多的进E将成ؓ性能的瓶颈问题?


  所以现在开始出现新的标准来弥补q一不Q其中FastCGI是很有前途的一U新
  的开攑ּ标准?


  你可以在Apache中通过dmod_fastcgi.c模块来支持FastCGI?


  解读Apache日志


    当你一步步地看到这里的时候,怿你的WWW站点已经建好Qƈ且已l在
  Internet上展现出来了。这时你可能׃兛_谁造访q你的站点,或者想知道
  你的Apache服务器现在的q行状态与性能如何。下面我们一起通过解读Apache
  的日志来实现q个伟大的愿望?

  一、盯着Apache服务?

  Apache允许通过WWW监视服务器的配置信息与运行状态?


  Q.观看配置信息


  如果你的Apache象缺省配|一样加入了mod_info模块的话Q你可以通过讉K
  http://localhost/server-info查看服务器信息?

  2.使用状态页

  如果你的Apache象缺省配|一样加入了mod_status模块的话Q你可?

  通过讉Khttp://localhost/apache-status查看服务器的q行状态信息,其中
  包括Q?

  t 服务器系l的当前旉Q?

  t 服务器最q一ơ重启时_

  t 服务器启动后的运行时_

  t 到目前ؓ止服务的讉KLQ?

  t 到目前ؓ止传输的字节LQ?

  t 服务h的子q程敎ͼ

  t I闲子进E数Q?

  t 每个q程状态、子q程服务的请求数以及该子q程传输的字节LQ?

  t 每秒q_h数、每U传输的字节数、每ơ请求^均传输字节数Q?

  t 目前每个子进ECPU占用及Apache的ȝCPU占用率;

  t 当前L及处理的h?


  二、什么是日志文g


  日志文g是Apache工作的记录,Apache包括了mod_log_config模块Q它用来?
  录日志。在~省情况下,它用通用日志格式CLF规范来写。CLF日志文g内对?
  个请求均有一个单独行QŞ如:host ident anthuser date request status
  bytes

  其含义如下:

  t host&#0;&#0;客户端主机的全称域名或IP地址Q?

  t ident&#0;&#0;存放客户端报告的识别信息Q?

  t authuser&#0;&#0;如果是基于用户名认证的话Qgؓ用户名;

  t date&#0;&#0;h的日期与旉Q?

  t request&#0;&#0;客户端的h行;

  t status&#0;&#0;q回到客L的三们数字的HTTP状态码Q?

  t bytes&#0;&#0;除去HTTP头标外,q回l客L的字节数?


  三、分析日志文?


  有了日志文g后,我们可以利用UNIX的一些工具和一此专门的日志分析工具?
  日志文gq行分析?


  实例一Q列问过本网站的L名或IPQ?

  对于q个需求,我们可以通过一个Unix的一个脚本语句来完成Q?

  cat /var/log/httpd/access_log | awk '{print $1}'

  用上面的Ҏ虽然可以得到讉Kq本|站的主机名或IPQ但是由于有些是多次
  讉K的,我们希望在上面得到的l果的基上做一些优化,使得列出的表中,
  每个L只出Cơ。我们可以用:

  cat /var/log/httpd/access_log | awk '{print $1}' | wc -l

  3. 当然Q我们可以根据需要选择W三Ҏ供日志分析工L臌己开发一些日
  3. 志分析工h满我们的需求。常见的W三Ҏ志分析工hQWebTrends?
  3. Wusage、wwwstat、http-analyze、pwebstats、WebStat Explorer?
  3. AccessWatch?


  四、一些提C?

  日志一斚w是我们分析网站的W一手资料,一斚w却是吞噬大量盘I间的罪
  祸首。所以别忘了定期转储或删除一些老的日志文g?

  Apache与代理服务器

    代理服务器是位于客户和客戯讉K的服务器之间的系l。当客户Z?
  URLh讉Kq程资源Ӟ代理服务器接受该hq取得该资源以满_h?
  h。在通常情况下,代理服务器是客户机的服务器,同时也是q程服务器的
  客户?

    代理服务器可以在自己的缓冲区中存储被h的内容,当这些信息再ơ被
  h的时候,代理服务器就无需再从q程服务器上取了Q这样代理服务器减
  M|络的瓶颈问题?

  Apache可以配置成ؓ代理服务器?


  一、前向代理服务器和逆向代理服务?

  1Q前向代理服务器

  前向代理服务器通常位于用户L和要讉K的远E网l之间。它从远E服务器
  取得所要求的资源,然后q回l用P同时存在盘上,以供下次使用?

  在这U情况下Q客L的主机知道它们正在用代理服务器Q因为每个主机都
  必须配置Z用代理服务器?

  例如Q必d诉WWW览器用代理服务器Q它才能使用代理服务器。所有的q?
  E请求都通过代理服务器传输?

  q类代理服务器也UCؓ~冲代理服务器。逆向服务器也可以~冲数据Q但它的
  作用愉好与前向服务器相反?

  2Q逆向代理服务?

  逆向代理服务器位于互联网资源前面Q逆向服务器从原始服务器找到被h?
  资源Qƈ反它q回l用户主机?

  与前向代理服务器不同的是Q逆向代理服务器的用户q不知道它们q接的是?
  理服务器而不是资源服务器本n。其l构如下图所C:

  二、配|代理服务器


    Z允许Apache作ؓ代理服务器,需要将ProxyRequests设ؓOnQ然后根?
  你希望代理服务器做什么而增加什么附加配|。无Z希望做什么,你所选的
  代理配置都应该放入一个特D?lt;Directory>容器中?


  <Directory proxy:*>

  ?

  </Directory>

  实例一Q将U有IP|连C联网

  假设U有|上只有一台计机被分配了互联|上合法的IP地址Q这台计?

  行Apache代理服务器,ProxyRequest讄为OnQƈ且不需要附加其他配
  |,所有请求均可由q台代理服务器代理服务?

  实例二:让Apache允当q程WWW站点的缓?

  W一步:ProxyRequest讄为On

  W二步:创徏配置如下Q?

  <Directory proxy:*>

  CacheRoot /www/cache

  CacheSize 1024

  CacheMaxExpire 24

  </Directory>

  q里的意思是讄Cache目录?www/cacheQ大ؓ1024KBQ即1MBQ缓冲中?
  内容?4时后失效?

  实例三:建立镜像站点Q其实这也就是所谓的逆向代理服务器)

  W一步:ProxyRequest讄为On

  W二步:创徏配置如下Q?

  <Directory proxy:*>

  ProxyPass / www.mot.com /

  CacheRoot /www/cache

  CacheDefaultExpire 24

  </Directory>

  10.3 一些提C?

  代理服务器,我们会在后面的章节中详l介l,q里只是针对Apache的功?
  介绍的。用Apache作代理服务器的性能q不高,效果q不好。不使用?

  安裝 Apache+PHP+MySQL+imap+GD+Ldap+opens

  注意事项Q?

  1.如果x?Redhat based ?Linux 的话Q请执行 ntsysv ?httpd ?
  1.Mysql 不要执行

  2.?DOWNLOAD 的档案放到相同的目录Q再?tar zxvf xxxxxxxx.tar.gz ?
  2.解压~,请依照要安装的Y件进入适当的目录?

  3.可以?http://linuxnews.idv.tw/download/ 来下载所需的程序?

  MySQL:

  ---------------------------------------------------------------

  ./configure --prefix=/usr/local/mysql --with-charset=big5

  make

  make install

  cd scripts

  ./mysql_install_db

  cd /usr/local/mysql/share/mysql/

  chmod 611 mysql.server

  ./mysql.server start

  #~辑 /etc/rc.d/rc.local 加入底下q行以便开机时自动执行 mysql

  /usr/local/mysql/share/mysql/mysql.server start

  imap:

  ---------------------------------------------------------------

  make slx

  cp ipopd/ipop*.* /usr/sbin

  cp imapd/imapd /usr/sbin

  cp c-client/c-client.a /usr/local/lib

  #L定你?/usr/local/include q个目录

  cp c-client/rfc822.h /usr/local/include

  cp c-client/mail.h /usr/local/include

  cp c-client/linkage.h /usr/local/include

  GD:

  ---------------------------------------------------------------

  make

  make install

  Ldap:

  ---------------------------------------------------------------

  ./configure --prefix=/usr/local/ldap

  make

  make depend

  cd tests

  make

  cd ..

  make install

  Apache:

  ---------------------------------------------------------------

  ./configure --prefix=/usr/local/apache

  openssl:

  ---------------------------------------------------------------

  ./config

  make

  make test

  make install

  mod_ssl:

  ---------------------------------------------------------------

  ./configure --with-apache=../apache_1.3.19
  --with-ssl=../openssl-0.9.6 --prefix=../apache_1.3.19

  php:

  ---------------------------------------------------------------

  ./configure --with-mysql=/usr/local/mysql
  --with-apache=../apache_1.3.19 --enable-track-vars
  --with-gd=../gd-1.8.4 --with-imap=../imap-4.7c --enable-ftp
  --with-ldap=/usr/local/ldap

  make

  make install

  Apache:

  ---------------------------------------------------------------

  ./configure --prefix=/usr/local/apache
  --activate-module=src/modules/php4/libphp4.a --enable-module=ssl

  make

  make certificate

  #q时会问你一些问题,是有关于加密的问题Q最后要要求输入启动的密码,
  如果输入密码的话以后启动 httpd 的时候会询问密码Q若不输

  #入密码的话启动就不会问了

  #PS.启动http

  #要加密:apachectl startssl

  #不加密:apachectl start

  make install

  修改 /etc/rc.d/rc.local 加入 /usr/local/apache/bin/apachectl start ?
  开机时自动启动 Apache

  再来是修改 /usr/local/apache/conf/httpd.conf 的设定档Q将 php 的支
  持加?

  建立Apache站点的基本安全机?

  对于WWW服务来说Q在WWW服务器和WWW览器之间ƈ不始l维持对话过E。办?
  WWW服务器完成对一个URLh的服务,q接断开了?

  在这U情况下Q在WWW上保证可以用的唯一认证机制是由HTTP本n提供 的?
  在标准的Apache服务器实Cq样的认证,它能控制哪些L可能讉K特定?
  站点或特点的站点的一部分?

  q种认证可以分ؓ两种Q一U是ZL的的认证Q另一U是Z用户?口o
  的认证。由于互联网上的军_多数用户的IP地址是动态获得的Q所以基于主?
  的认证方式ƈ不总适用。所以在大多数情况下Q传l的Z用户?口o的认?
  方式更ؓ现实。下面我们就对这两种认证的实现做一要的介绍?

  1. ZL的认证方?

  在种认证模式֐思义Q访问是用主机名或主机IP地址来控制的。支持这U认
  证方式的是Apache的mod_access模块Q这个模块缺省状态下是被安装了的。该
  模块用以下几UApache命o来提供访问控制功能?

  allow命o

  语法Qallow from host1 host2 host3 ...

  q个命o定义了允许访问站Ҏ目录的主机清单。主机清单可以用以下?

  UŞ式表C:

  ALLQ代表所有主机;

  L的全域名Qwww.mot.comQ?

  L的部分域名,如:.mot.comQ?

  完整的IP地址Q如Q?02.98.2.32Q?

  部分IP地址Q如Q?02.98

  |络地址/|络掩码对,如:202.98.0.0/255.255.0.0

  |络地址/nn(CIDR定义)Q如Q?02.98.0.1/16

  deny命o

  语法Qdeny from host1 host2 host3 ...

  q个命o定义了禁止访问站Ҏ目录的主机清单,其他与allow命o怼?

  order命o

  语法Qorder deny,allow | allow,deny

  q个命o定义评hallow和deny命o的先后顺序?

  例如Q?

  <Directory /home/httpd/html>

  order deny,allow

  deny from www.mot.com

  allow all

  </Directory>

  q组命o讄了www.mot.com讉K/home/httpd/html目录下的文g?

  请大家注意,序是先deny后allowQ如果是Qorder allow,deny 那么Q先?
  许所有的L讉KQ然后再止Q这h无效的,所有主Z然能够访问?

  2. Z用户?口o的认证方?

  q种认证方式其实相当单,当WWW览器请求经此认证模式保护的URL

  Ӟ会出现一个对话框Q要求用户键入用户名和口令。用戯入后Q传l?
  WWW服务器,WWW服务器验证它的正性,如果正确Q返回页面,否则q回401?
  误。要说明的一ҎQ这U认证模式是基本的,q不能用于安全性要求极高的
  场合?

  Apache 中有许多模块可以支持q种认证方式Q下面我们就介绍一下最基本、最
  标准的mod_auth模块。正如前面提到的一Pmod_auth模块使用存储在文本文
  件中的用户名、组名和口o来实现认证。这U方法非帔R合处理量用户Q它
  能工作得很好。如果你需要对大量的用P如数以千计的用户做认证时Q这U?
  Ҏ的性能急剧下降C可忍受,所以当q种情况下,需要考虑使用
  mod_dbm模块或mod_mysql模块来获得更好的性能?

  实例一Q需要用户名和口令的讉K控制

  下面我们׃h看一下如何徏立需要用户名/口o才能q行讉K的目录?

  基本情况Q?www.xxx.com

  的站Ҏ讄为:

  DocumentRoot /home/httpd/html

  AccessFileName .htaccess

  AllowOverride All

  需求:限制/home/httpd/html/backup/目录的访问,只允许用?super"以口?
  "fill-06"讉K此目录?

  实现步骤Q?

  使用htpasswd建立用户文g

  htpasswd -c /home/httpd/secr/.htpasswd super

  此程序会询问用户"super"的口令,你输?fill-06"Q两ơ生效?

  建立.htaccess文g

  用vi?home/httpd/html/backup/目录下徏立一个文?htaccessQ写?

  以下几行Q?

  AuthName My Friend Only (注:q个名字是Q取的)

  AuthType Basic

  AuthUserFile /home/httpd/secr/.htpasswd

  require user super

  讄文g权限Q确保Apache用户有读的权?

  q样完成了讄工作Q你可以试一试效果了?

  实例二:允许一l用戯问一个目?

  假设Qwww.xxx.com惌myfriendl中的mf1与mf2两个用户分别?

  使用口o"mf001-1""mf002-2"讉K/home/httpd/html/backup/目录?

  实现步骤Q?

  使用htpasswd建立用户文g

  htpasswd -c /home/httpd/secr/.htpasswd mf1

  htpasswd -c /home/httpd/secr/.htpasswd mf2

  建立l文?

  用vi/home/httpd/secr/目录下徏立一个文?htgroupQ写入:

  myfriend:mf1 mf2

  建立.htaccess文g

  用vi?home/httpd/html/backup/目录下徏立一个文?htaccessQ写?

  以下几行Q?

  AuthName My Friend Only

  AuthType Basic

  AuthUserFile /home/httpd/secr/.htpasswd

  AuthGroupFile /home/httpd/secr/.htgroup

  require group myfriend

  配置工作到此l束Q试一试吧Q?

  实例三:混合使用ZL与基于用户名/口o的认证方?

  如果你除了只允许让mf1与mf2两个用户讉K外,q想www.mot.com

  外的L讉Kq个目录的话Q就?home/httpd/html/backup/.htaccess修改?
  为:

  AuthName My Friend Only

  AuthType Basic

  AuthUserFile /home/httpd/secr/.htpasswd

  AuthGroupFile /home/httpd/secr/.htgroup

  require group myfriend

  order deny,allow

  deny from all

  allow from www.mot.com


  不行Q这不是我想要找的,我要再搜一搜声明:本站部分文章攉于网l,?
  供个人学习之用,l无M商业目的Q?
本节针对Apache中有兛_全方面的讄做出详细的叙qͼ涉及到Apache的配|文件、Apache的目录访问控制、在Apache上运行CGI{安全方面的讄?
4.5.1  Apache的配|文?

对于RedHat LinuxpȝQApache的配|文件放?etc/httpd/conf/目录下。如果是自行~译安装的ApacheQ则视编译时指定的目录\径而定Q默认是/usr/local/apache/conf?

在conf目录下有3个Apache的配|文Ӟ

          httpd.conf

          access.conf

          srm.conf

Apache启动时先调用httpd.confQ然后调用srm.confQ最后调用access.conf。但C版本的Apache为避免管理和l护的؜乱,已经改ؓ所有Apache的相关配|命令放在httpd.conf文g中,不再使用srm.conf和access.conf文g。虽然这两个文g仍然存在Q但内容中没有Q何配|命令,形同虚设?

httpd.conf文g分ؓ以下3部分Q?

          Global Environment

          'Main' server configuration

          Virtual Hosts 

下面讲q这3部分的用法和与安全相关的注意炏V?
4.5.1.1  Global Environment

          ServerType standalone

用来指定Apache的启动方式:standalone和inetd。standalone模式是Apache独立q行Q也是默认的启动方式。inetd模式是守护进E监听http的连接请求才启动httpdq程Q请求完毕后q束httpdq程Q这h务器负担很重?

          ServerRoot "/etc/httpd"

Apache的目录,此处是存N|、出错记录、日志文件的根目录。目录后面不要加?”字W?

          LockFile /var/lock/httpd.lock

保留默认|不要更改?

          PidFile /var/run/httpd.pid

指定记录Apache的父q程id的文件名及\径?

          ScoreBoard /var/run/httpd.scoreboard

指定用于储存服务器进E处理信息的文g名和路径?

          #ResourceConfig conf/srm.conf

          #AccessConfig conf/access.conf

在标准的配置中,服务器启动时会处理这两个文g。因为现在的Apache只用httpd.conf文gQ摒弃了srm.conf和access.conf文gQ所以这两行用?”注释掉?

           Timeout 300

讄时旉。如果远E客L过300U还没连上Apache ServerQ或者Apache Server过300U没有传送字节给客户端,qx开q接?

           KeepAlive On

KeepAlive允许客户端的每个q接有多个请求,设ؓOff时此Ҏ效?

           MaxKeepAliveRequests 100

讄每次q接期间所允许的最大请求数目。设?时表C允许无限制数目。设|数字越大,则服务器性能高?

           KeepAliveTimeout 15

讄{待同一个客L的同一个连接发Z一个连接请求超q一定的旉断Uѝ?

           MinSpareServers 5

          MaxSpareServers 20

讄最的闲置服务处理E序的数目和最大的闲置服务处理E序的数目。如果实际数目少于MinSpareServersQ则增加处理程序;反之Q如果实际数目超qMaxSpareServersQ一些多余的处理E序被杀掉?

           StartServers 8

讄启动q初始化后启动服务进E的数目?

           MaxClient 150

讄服务q行的L量。一旦达到此数目Q新来的客户端就被拒l,所以该限制数目不能讑־太小?

           MaxRequestsPerChild 100

讄每个子程序处理结果前的要求数目,设ؓ0表示不限制?

           #Listen 3000

#Listen 12.34.56.78:80

Listen 80

讄Apache监听的连接端口或IP地址及端口,默认?0?

           #BindAddress *

该选项用来支持虚拟LQƈ告知服务器监听哪个IP地址。可以用?”,或具体的IP地址和完整的域名?

           #LoadModule foo_module libexec/mod_foo.so

DSOQDynamic Shared ObjectQ支持。DSO模块的概念和作用与Windows的DLL文g极其怼?

           #ExtendedStatus On

当“server-status”管理程序被执行Ӟ查Apache的运行状态信息。默认是Off?
4.5.1.2  'Main' Server Configuration

如果在第一部分“Global Environment”中的ServerType命o设ؓinetd的话Q那么这部分没有Q何效果,直接跛_ServerAdmin命o?

           Port 80

讄Standalone服务器监听的q接端口Q也可以设ؓ其他端口Q必d? 023。必Mrootw䆾才能更改端口?

           User apache

           Group apache

指定q行httpd的用户和用户l。必首先以rootw䆾指派?

           ServerAdmin root@localhost

讄理员的电子邮g地址Q当Apache有问题时会自动发E-mail通知理员?

           #ServerName localhost

讄L名称Q可以用域名和IP地址?

           DocumentRoot "/var/www/html"

讄Apache攄|页的目录\径?

           <Directory/>

Options FollowSymLinks

AllowOverride None

<Directory/>

讄Apache能够讉K的每一个目录被讉K时所执行的动作。本章后面将详细叙述Apache的目录存取方法?

           <Directory "/car/www/html">

Options Indexes Include FollowSymLinks

AllowOverride None

Order allow, deny

Allow from all

</Directory>

此处讄Apache的网늛录的执行动作。本章节后面详l叙q目录的存取Ҏ?

           <Directory/>

AllowOverride None

Options None

Allow from all

</Directory>

此处可以防止用户创徏自己?htaccess文g。在q个文g中可以改变全局参数Q以致会影响到整个系l的安全。可以在httpd.conf文g中加入的命o中都加上上面的代码?

           UserDir public_html

讄用户在自q目录下徏立public_html攄|页Q即/home/*/public_html/。这样在览器地址栏输入“http://Apache服务?用户?”就能显C网c设|的目录必须告知用户Q否则他们不知道|页攑֜什么地斏V?

           DirectoryIndex index.html index.htm index.shtml index.php index.php4 index.php3 index.cgi

讄Apache的默认首|档?

           AccessFileName .htacess

指定控制存取的文件名U。Apache默认的是.htaccess。本章将在后面详l叙q该文g的用法?

           <Files ~ "^\.ht>

Order allow,deny

Deny from all

</Files>

防止用户端看到ht开头的文g内容。因?htaccess记蝲了相关信息,.htpasswd记蝲了密码信息,不允许其他h讉Kq些文g?

           #CacheNegotiatedDocs

指定Proxy服务器是否将交互产生的文件存在Cache中。将该命令注释掉则是不指定?

           UseCanonicalName On

讄是否使用标准的名Uͼ默认是On?

           TypeConfig /etc/mime.types

指定存放MIME文gcd的文件?

           Default Type text/plain

如果Apache不能识别此文件类型时Q则按照预设的格式显C,一般以文本文g昄?

           <IfModule mod_mine_magic.c>

MIMEMagicFile conf/magic

</ifModule>

mod_mime_magic模块可以让Apache由文件内容决定其MIMEcd。如果存在该模块Q才会处理MIMEMagicFileq一Dc上?行是当没有该模块时就处理q一Dc?

           HostnameLookups off

讄Apache是否向名U服务器解析该IP地址Q记录此链接的名Uͼ如Hacker.com.cnQ。因为DNS解析要花一定时_所以默认设为offQ仅记录IP?

           ErrorLog /var/log/httpd/error_log

指定Apache发生错误时记录文件的位置。如果在<VirtualHost>中没有指定记录文Ӟ则用/var/log/httpd/error_logQ否则?lt;VirtualHost>指定的文件?

           LogLevel warn

指定记录的详l等U,?个等U:debug、info、notice、warn、error、crit、alert和emerg。按从详l到略排列?

           LogFormat "%h %l %u %t\"%r"\"%>s%b\"{Referer}I"\"%{UserAgent}I\""combind

Logformat"%h%l%u%t\"%r"\"%>s%b"common

Logformat "%{Referer}I->%U"referer

LogFormat"%{User-agent}I"agint

定义4U格式的别名Qcombind、commen、referer和agint?

           #CustomLog /var/log/httpd/access_log common

CustomLog /var/log.httpd/access_log combind

指定记录文g使用哪种自定义的格式。其他不使用的自定义格式被注释掉?

以上是关于日志文件的Q将在后面的Apache日志文g中详l叙q?

           ServerSignature On

设ؓOnQ当Apache产生错误Ӟ在|页上显CApache的版本信息、主机名U、端口等一行信息。设为OffQ就不显C相关的信息。设为E-mailӞ有“mailto:”给理员的链接?

           Alias/icons /"var/www/icons/"

使用较短的别名,其格式ؓQAlias 别名 原名。可以无限制地徏立别名。注意别名的后面如果有?”,那么在用URL时也得有?”?

           ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"

和AliascMQ设|服务器脚本目录?

应该强制性地使用ScriptAlias命o来限定CGIE序位于某个或者某几个特定的位|。一般可以设|多个ScriptAlias。必M证cgi-bin目录不在html目录下,q一炚w帔R要,q样可以防止黑客通过览它们而查看CGIE序?

           IndexOptions FancyIndexing

以特定的囑Ş昄文g清单?

           AddIconByEncoding (CMP, /icons/compressed.gif) x-compress x-gzip

…?

DefaultIcon /icons/unknown.gif

指定昄文g清单时各U文件类型的对应囑Ş?
4.5.1.3  Virtual Hosts

q部分是讄虚拟L的。所谓虚拟主机,是指一台服务器作ؓ多域名的Web服务器。ISPl常通过一台服务器为其客户提供Web服务。而客户通常希望主页以自q名字出现Q而不是在该ISP的名字后面,因ؓ使用单独的域名和根网址可以看v来更正式一些。传l上Q用户必自p立一台服务器才能辑ֈ拥有单独域名的目的,然而这需要维护一个单独的服务器。很多小单位~Z_的维护能力,更ؓ合适的方式是租用别人维护的服务器。ISP也没有必要ؓ一个机构提供一个单独的服务器,完全可以使用虚拟L的能力,使服务器为多个域名提供Web服务Q而且不同的服务互不干扎ͼ对外pCؓ多个不同的服务器。虚拟主机就是解册U问题的ҎQ客户的域名实际指向ISP的同一台服务器?
1QApache支持虚拟L的方?

Apache有两U支持虚拟主机的方式。一是ؓ每一个虚拟主|单独的httpdq程Q二是ؓ所有的L讄一个单独的httpdq程?

           为每一个虚拟机讄单独的httpdq程

在httpd.conf文g的第一部分Global Environment中的BindAddress命o或Listen命o是用来指定虚拟L的地址和端口的?

BindAddress命o用来指定单一的地址Q可以用域名或IP地址。该命o在httpd.conf文g中只能出Cơ?

Listen命o可以让httpdq程监听多个地址或端口。反复用Listen命op实现q个要求?

           为所有的L讄一个单独的httpdq程

q是一个常用的Ҏ。用户只要维护一个httpd.conf文g。在此文件的W三部分Virtual Host中,?lt;VirtualHost></VirtualHost>命o来ؓ所有的虚拟Lq行配置。有多个虚拟L有多个<VirtualHost>Dc在不同的虚拟主机的<VirtualHost>D中可以指定不同的ServerAdmin、ServerName、DocumentRoot、ErrorLog和TransferLog?
2Q虚拟主机的实现方式

虚拟L有三U实现方式:以主机名U的方式虚拟、以IP的方式虚拟、以端口的方式虚拟。下面就举一个在httpd.conf的第三部分Virtual Host中实C面提及的方式的例子?

           以主机名U的方式虚拟

如果用户的一台服务器有多个域名,Virtual Host文g举例如下Q?

NameVirtualHost 210.12.195.6

<VirtualHost hacker.con.cn>

ServerAdmin bright@hacker.com.cn

DocumentRoot /var/www/html/hacker

ServerName hacker.com.cn

</VirtualHost>

<VirtualHost pcfrient.com.cn>

ServerAdmin admin@pcfrient.com.cn

DocumentRoot /var/www/html/pcfrient

Servername pcfrient.com.cn

</VirtualHost>

           以IP的方式虚?

注册域名是要׃W费用的。解x案是可以用IP的方式来虚拟。在Linux中可以ؓ一个网卡捆l两个IP地址。如服务器的地址?10.12.195.6Q现在有一个IP地址210.12.195.9没有使用。将210.12.195.9捆绑到服务器的网卡中Q执行下列命令:

#ifconfig eth0:0 210.12.195.9

q样Q服务器有两个IP地址了。以IP的方式虚拟和以主机名U的方式虚拟cMQ请看下面的例子Q?

NameVirtualHost 210.12.195.6

<VirtualHost 210.12.192.6>

ServerAdmin bright@hacker.com.cn

DocumentRoot /var/www/html/hacker

</VirtualHost>

<VirtualHost 210.12.192.9>

ServerAdmin bright@hacker.com.cn

DocumentRoot /var/www/html/pcfrient

</VirtualHost>

以IP的方式虚拟不用NameVirtualHost命o?

           以主机名U和IP的方式虚?

是上面的两个方式的l合。看下面的例子:

NameVirtualHost 210.12.195.6

<VirtualHost hacker.con.cn>

ServerAdmin bright@hacker.com.cn

DocumentRoot /var/www/html/hacker

ServerName hacker.com.cn

</VirtualHost>

<VirtualHost 210.12.195.6>

ServerAdmin bright@hacker.com.cn

DocumentRoot /var/www/html/pcfrient

</VirtualHost>

           以端口的方式虚拟

http默认的端口是80Q如果用戯开讑֏一个端?43作ؓ另一个虚拟主机,举例如下Q?

Listen 80

Listen 443

<VirtualHost 210.12.192.6:80>

ServerAdmin bright@hacker.com.cn

DocumentRoot /var/www/html/hacker

</VirtualHost>

<VirtualHost 210.12.195.6:443>

ServerAdmin suying@hacker.com.cn

DocumentRoot /var/www/html/pcfrient

</VirtualHost>

           以不同的IP和端口的方式虚拟

该方式是以IP的方式虚拟和以端口的方式虚拟的结合。假设服务器捆绑了两个IP地址Q?10.12.192.6?10.12.195.9Q后面的IP地址用端?43。D例如下:

Listen 210.12.192.6Q?0

Listen 210.12.195.9Q?43

<VirtualHost 210.12.192.6:80>

ServerAdmin bright@hacker.com.cn

DocumentRoot /var/www/html/hacker

</VirtualHost>

<VirtualHost 210.12.195.9:443>

ServerAdmin suying@hacker.com.cn

DocumentRoot /var/www/html/pcfrient

</VirtualHost>


zhyiwww 2006-10-25 16:59 发表评论
]]>
Eclipse快捷?转蝲)http://m.tkk7.com/zhyiwww/archive/2006/10/24/76959.htmlzhyiwwwzhyiwwwTue, 24 Oct 2006 06:06:00 GMThttp://m.tkk7.com/zhyiwww/archive/2006/10/24/76959.htmlhttp://m.tkk7.com/zhyiwww/comments/76959.htmlhttp://m.tkk7.com/zhyiwww/archive/2006/10/24/76959.html#Feedback0http://m.tkk7.com/zhyiwww/comments/commentRss/76959.htmlhttp://m.tkk7.com/zhyiwww/services/trackbacks/76959.html http://java.ccidnet.com/art/3737/20040710/523567_1.html

本文档从Eclipse软g上整理,是列Z标准的快捷键Q未列出Emacs快捷键。{贴请注明作者和出处?br />


~辑

作用?功能 快捷?

全局 查找q替?Ctrl+F

文本~辑?查找上一?Ctrl+Shift+K

文本~辑?查找下一?Ctrl+K

全局 撤销 Ctrl+Z

全局 复制 Ctrl+C

全局 恢复上一个选择 Alt+Shift+?

全局 剪切 Ctrl+X

全局 快速修?Ctrl1+1

全局 内容辅助 Alt+/

全局 全部选中 Ctrl+A

全局 删除 Delete

全局 上下文信?Alt+Q?br />

Alt+Shift+?

Ctrl+Shift+Space

Java~辑?昄工具提示描述 F2

Java~辑?选择装元素 Alt+Shift+?

Java~辑?选择上一个元?Alt+Shift+?

Java~辑?选择下一个元?Alt+Shift+?

文本~辑?增量查找 Ctrl+J

文本~辑?增量逆向查找 Ctrl+Shift+J

全局 _脓 Ctrl+V

全局 重做 Ctrl+Y


?

查看

作用?功能 快捷?

全局 攑֤ Ctrl+=

全局 ~小 Ctrl+-


?

H口

作用?功能 快捷?

全局 Ȁzȝ辑器 F12

全局 切换~辑?Ctrl+Shift+W

全局 上一个编辑器 Ctrl+Shift+F6

全局 上一个视?Ctrl+Shift+F7

全局 上一个透视?Ctrl+Shift+F8

全局 下一个编辑器 Ctrl+F6

全局 下一个视?Ctrl+F7

全局 下一个透视?Ctrl+F8

文本~辑?昄标尺上下文菜?Ctrl+W

全局 昄视图菜单 Ctrl+F10

全局 昄pȝ菜单 Alt+-


?

D

作用?功能 快捷?

Java~辑?打开l构 Ctrl+F3

全局 打开cd Ctrl+Shift+T

全局 打开cd层次l构 F4

全局 打开声明 F3

全局 打开外部javadoc Shift+F2

全局 打开资源 Ctrl+Shift+R

全局 后退历史记录 Alt+?

全局 前进历史记录 Alt+?

全局 上一?Ctrl+,

全局 下一?Ctrl+.

Java~辑?昄大纲 Ctrl+O

全局 在层ơ结构中打开cd Ctrl+Shift+H

全局 转至匚w的括?Ctrl+Shift+P

全局 转至上一个编辑位|?Ctrl+Q

Java~辑?转至上一个成?Ctrl+Shift+?

Java~辑?转至下一个成?Ctrl+Shift+?

文本~辑?转至?Ctrl+L



搜烦

作用?功能 快捷?

全局 出现在文件中 Ctrl+Shift+U

全局 打开搜烦对话?Ctrl+H

全局 工作Z的声?Ctrl+G

全局 工作Z的引?Ctrl+Shift+G


?

文本~辑

作用?功能 快捷?

文本~辑?改写切换 Insert

文本~辑?上滚?Ctrl+?

文本~辑?下滚?Ctrl+?


?

文g

作用?功能 快捷?

全局 保存 Ctrl+X

Ctrl+S

全局 打印 Ctrl+P

全局 关闭 Ctrl+F4

全局 全部保存 Ctrl+Shift+S

全局 全部关闭 Ctrl+Shift+F4

全局 属?Alt+Enter

全局 新徏 Ctrl+N




作用?功能 快捷?

全局 全部构徏 Ctrl+B



源代?br />

作用?功能 快捷?

Java~辑?格式?Ctrl+Shift+F

Java~辑?取消注释 Ctrl+\

Java~辑?注释 Ctrl+/

Java~辑?d导入 Ctrl+Shift+M

Java~辑?l织导入 Ctrl+Shift+O

Java~辑?使用try/catch块来包围 未设|,太常用了Q所以在q里列出,自己讄?br />

也可以用Ctrl+1自动修正?


?

q行

作用?功能 快捷?

全局 单步q回 F7

全局 单步跌 F6

全局 单步跛_ F5

全局 单步跛_选择 Ctrl+F5

全局 调试上次启动 F11

全局 l箋 F8

全局 使用qo器单步执?Shift+F5

全局 d/去除断点 Ctrl+Shift+B

全局 昄 Ctrl+D

全局 q行上次启动 Ctrl+F11

全局 q行臌 Ctrl+R

全局 执行 Ctrl+U



重构

作用?功能 快捷?

全局 撤销重构 Alt+Shift+Z

全局 抽取Ҏ Alt+Shift+M

全局 抽取局部变?Alt+Shift+L

全局 内联 Alt+Shift+I

全局 Ud Alt+Shift+V

全局 重命?Alt+Shift+R

全局 重做 Alt+Shift+Y



zhyiwww 2006-10-24 14:06 发表评论
]]>
UML L工具(转蝲) http://m.tkk7.com/zhyiwww/archive/2006/06/01/49639.htmlzhyiwwwzhyiwwwThu, 01 Jun 2006 07:45:00 GMThttp://m.tkk7.com/zhyiwww/archive/2006/06/01/49639.htmlhttp://m.tkk7.com/zhyiwww/comments/49639.htmlhttp://m.tkk7.com/zhyiwww/archive/2006/06/01/49639.html#Feedback0http://m.tkk7.com/zhyiwww/comments/commentRss/49639.htmlhttp://m.tkk7.com/zhyiwww/services/trackbacks/49639.html

UML L工具

ARTiSAN

Real-Time Studio

Borland

Together Designer 2005 W?15 ?Productivity Winner

Computas'Metis

Compuware

OptimalJ (MDA)

Embarcadero

Describe

I-Logix

Rphapsody

IBM

Rational Software Architect W?15 ?Productivity Winner

and Modeler

Interactive Objects

ArcStyler (MDA)

MetaMatrix

MetaBase Modeler

Microsoft

Visio

No Magic

MagicDraw UML 9.0 W?15 ?Productivity Winner

Oracle

JDeveloper

Sparx Systems

Enterprise Architect

Sybase

PowerDesigner

Telelogic

TAU Developer TAU Architect

Visual Paradigm International

Smart Development Environment 2.0 W?15 ?Jolt Winner

参考资?/h2>

UML Products by Company (Objects by Design)
Choosing a UML Modeling Tool (Objects by Design)
UML Tools (Mario Jeckle)
UML-Tools (Open directory)

 



zhyiwww 2006-06-01 15:45 发表评论
]]>
վ֩ģ壺 ˳Ƶ߲Ų| ҴýһAV| һƵ| Ұ¾þø | Ƶһ| լa| 4399ÿձߵӰ| ޳ַ| AVվ| һػػƵĴƬ| Ƶվ| ޾ƷƬþò | ۺƵ| þþƷ˳| ˳77777߲| պһ| ޳aëƬ| һһëƬȫ| þù׾Ʒҹ | ˾ҹƷƵ| ޾Ʒþò| ƷѴƬ| ޹Ӱ߹ۿ| ŮƵվa| һþAþѾƷ| Ʒһ| þ99׾Ʒ| ޾ƷѶ| ҹľƷ| ɫAAVѲ| ۺһպ| ۺ ŷ ˿ | һëƬ޶| avƬþ| www.ɫͼ.com| ҹƷ߹ۿ| ޹ľƷ| VVþþ| ߹ۿƵ| һëƬѹۿշ| ޹ƷۺϾþþ|