CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
不看会后悔的Windows XP之经验谈 简单快捷DIY实用家庭影院
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  Java >  J2SE / 基础类

高手请进,Apache+Tomcat

楼主yinjialiang(夜半歌手)2002-03-19 22:32:16 在 Java / J2SE / 基础类 提问

今天遇到了这个问题,搞了一晚上还是没结果。  
  我采用了Apache+tomcat  
  因为它太大了,我的机子是128内存。  
  我确信Apache配置的绝对没问题,而且我测试过。  
  对tomcat我设置了如下环境变量:  
  SET   PATH=%PATH%;.;C:\JDK1.3\BIN  
  SET   CLASSPATH=%CLASSPATH%;.;C:\JDK1.3\LIB\TOOLS.JAR;C:\JAKARTA-TOMCAT\LIB\SERVLET.JAR  
  又执行了下面一句:ApacheEnv.bat  
   
  接着又在APACHER的HTTPD.CONF的最后一行加了下面一句:  
  INCLUDE   C:\JAKARTA-TOMCAT\CONF\CONF\TOMCAT-APACHE.CONF  
   
  接着:  
  STOP   APACHE  
  STOP   TOMCAT  
  START   TOMCAT  
  START   APACHE  
  在START   APACHER时,出现如下错误:  
  TOMCAT-APACHE.CONF是无效的文件,权限拒绝  
   
  请问该如何解决 问题点数:20、回复次数:1Top

1 楼xexplorer(西风漂流)回复于 2002-03-20 08:38:50 得分 20

你是用的tomcat4.0吧,4.0中不包含tomcat-apache.conf这个文件的,这个文件在3.x中才有,4.0提供以一种更简便的方法来使tomcat和apache结合起来。就是用mod_webapp组件。下面的是他的配置方法。  
  Installing   mod_webapp   and   using   it   with   Apache   1.3  
  --------------------------------------------------  
   
  Once   you   have   successfully   built   the   mod_webapp   DSO   as   described   in   the  
  README.txt   file   coming   with   the   sources,   installing   the   module   is   pretty  
  easy.  
   
  First   of   all,   copy   the   resulting   mod_webapp.so   file   you   will   find   in   this  
  directory   (or   in   the   apache-1.3   directory   if   you're   building   from   sources)  
  into   your   Apache   1.3   "libexec"   directory   (that   directory   where   all   DSO   modules  
  for   Apache   reside).  
   
  If   you're   using   Apache   1.3   for   Windows,   your   modules   directory   will   be   called  
  "modules"   (there's   a   "libexec   directory,   but   it   contains   other   stuff).   Please  
  take   care   when   loading   the   module.   For   Windows   your   "LoadModule"   directive  
  looks   like:  
   
          LoadModule   webapp_module   modules/mod_webapp.so  
   
  Another   note   for   Windows:   copy   also   the   "libapr.dll"   file   with   the   module,   or  
  your   Apache   1.3   web   server   will   refuse   to   start   reporting   that   the   WebApp  
  module   cannot   be   loaded.  
   
  Once   you   have   done   that,   edit   your   "httpd.conf"   configuration   file   and  
  add   a   few   lines   to   load   that   module   at   startup   (Windows   users,   read   above,  
  you   have   to   "replace"   libexec   with   "modules"   -   I'm   paranoid,   sorry):  
   
          LoadModule   webapp_module   libexec/mod_webapp.so  
  and  
          AddModule   mod_webapp.c  
   
  NOTE:   It   was   reported   that   sometimes   Apache   under   windows   doesn't   like   the  
  AddModule   line   in   the   configuration   file.   Please,   if   you   can't   start   your  
  Apache   service,   try   commenting   out   that   line   in   your   httpd.conf   file.  
   
  Looking   at   the   default   "httpd.conf"   file   coming   with   Apache   1.3,   I   usually  
  add   the   "LoadModule   ..."   line   at   the   end   of   all   pre-written   and   commented   out  
  "LoadModule"   directives,   and   my   "AddModule   ..."   directive   at   the   end   of   all  
  commented   out   "AddModule"   directives.   My   "httpd.conf"   file   looks   something  
  like   this:  
   
          [...]  
          #LoadModule   unique_id_module     libexec/mod_unique_id.so  
          #LoadModule   dav_module                 libexec/libdav.so  
          #LoadModule   ssl_module                 libexec/libssl.so  
          LoadModule   webapp_module             libexec/mod_webapp.so  
          [...]  
          ClearModuleList  
          [...]  
          #AddModule     mod_unique_id.c  
          #AddModule     mod_dav.c  
          #AddModule     mod_ssl.c  
          AddModule       mod_webapp.c  
          [...]  
   
  Once   you've   edited   your   "httpd.conf"   in   such   fashion,   it's   better   to   check  
  if   everything   still   works   within   the   Apache   core.   You   can   test   your   newly  
  constructed   configuration   by   issuing:  
   
          apachectl   configtest  
   
  The   apachectl   script   comes   with   your   Apache   1.3   distribution.   It   usually  
  lies   in   /usr/local/apache/bin,   but   depending   on   _YOUR_   apache   distribution,  
  that   might   change.  
   
  Once   you   verified   that   "apachectl"   reports   "Syntax   OK"   (meaning   that   all  
  modules   have   been   successfully   loaded   and   started),   you   can   start   adding   your  
  web   application   connections   and   context   into   the   Apache   configurations.  
  Back   to   the   "httpd.conf"   file,   you   need   to   add   something   like:  
   
          WebAppConnection   conn             warp     localhost:8008  
          WebAppDeploy           examples     conn     /examples  
   
  In   this   example,   I'm   instructing   the   WebApp   connector   to   connect   to   the  
  servlet   container   waiting   for   requests   on   the   current   "localhost"   host   and  
  bound   to   port   8008   (note,   this   port   is   the   one   you   specified   in   your  
  "server.xml"   file   for   the   "org.apache.catalina.connectors.warp.WarpConnector"  
  connector,   not   your   HTTP   one).  
   
  A   brief   detailed   description   of   the   above-mentioned   directives   is:  
   
          WebAppConnection   [connection   name]   [provider]   [host:port]  
   
                  [connection   name]  
                          A   unique   name   for   the   connection   to   be   created   between   Apache  
                          and   Tomcat.  
   
                  [provider]  
                          The   name   of   the   provider   used   to   connect   to   the   servlet   container.  
                          Currently   only   the   "warp"   provider   is   available.  
   
                  [host:port]  
                          The   host   name   and   port   number   to   which   the   WARP   connection   must  
                          attempt   to   connect.   The   port   is   the   one   you   specified   in   your  
                          "server.xml"   file   for   the   "...WarpConnector"   connector,   not   your  
                          HTTP   one.  
   
          WebAppDeploy   [application   name]   [connection   name]   [url   path]  
   
                  [application   name]  
                          The   application   name   as   present   in   your   "webapps"   directory   in  
                          Tomcat.   For   example,   if   you   want   to   deploy   a   WAR-based   web  
                          application,   your   application   name   will   look   something   like  
                          "myApplication.war".  
   
                  [connection   name]  
                          The   name   of   a   previously   declared   WebAppConnection   directive.  
   
                  [url   path]  
                          The   URL   path   where   this   application   will   be   deployed.  
   
  The   "WebAppDeploy"   directive   is   scoped   around   the   current   host,   meaning   that  
  if   you   insert   it   into   a   "<VirtualHost   ...>"   tag,   your   application   will   be  
  deployed   only   for   that   particular   virtual   host.   To   deploy   the   same   application  
  on   several   virtual   hosts,   you   will   have   to   declare   it   once   inside   each  
  "<VirtualHost   ...>"   tag.   This,   in   accordance   with   the   Servlet   specification,  
  will   create   a   new   instance   of   the   web-application   per   virtual   host.  
   
  Another   directive   is   available   for   the   WebApp   connector.   The   "WebAppInfo"  
  directive   will   allow   you   to   see   the   current   status   of   all   configured  
  connections   and   deployed   applications.   To   use   it,   simply   add   something   like:  
   
          WebAppInfo   /webapp-info  
   
  You   can   then   access   the   information   page   hitting   your   web   server   for   the  
  following   URL:  
   
          http://server.name:port/webapp-info/  
   
  Have   fun...  
  Top

相关问题

  • apache+tomcat
  • apache+tomcat
  • 配置Apache+Tomcat
  • 求救(tomcat+apache)!!!
  • apache,tomcat,php,resin
  • 请教:tomcat 与apache有关问题
  • 请问Apache+Tomcat怎么配置!
  • 请问Apache+Tomcat怎么配置!
  • 请问Apache和Tomcat有什么区别?
  • 菜鸟请教apache 和 Tomcat的问题

关键词

  • apache
  • tomcat
  • 文件
  • virtual
  • start
  • servlet
  • server
  • webapp
  • libexec
  • module

得分解答快速导航

  • 帖主:yinjialiang
  • xexplorer

相关链接

  • CSDN Java频道
  • Java类图书
  • Java类源码下载

广告也精彩

反馈

请通过下述方式给我们反馈
反馈
提问
网站简介|广告服务|VIP资费标准|银行汇款帐号|网站地图|帮助|联系方式|诚聘英才|English|问题报告
北京创新乐知广告有限公司 版权所有, 京 ICP 证 070598 号
世纪乐知(北京)网络技术有限公司 提供技术支持
Copyright © 2000-2008, CSDN.NET, All Rights Reserved
GongshangLogo