Jboss3.0-tomcat4.03的配置-2(虚拟主机)

来源:互联网 发布:知乎漂亮女朋友体验 编辑:程序博客网 时间:2024/06/06 19:08
<script type="text/javascript">google_ad_client = "pub-8800625213955058";/* 336x280, 创建于 07-11-21 */google_ad_slot = "0989131976";google_ad_width = 336;google_ad_height = 280;//</script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>(灰狐动力-中间件技术论坛 by huihoo.com Etre) Jboss3.0-Tomcat4.03的虚拟主机的配置 1、 请你首先打开WINNT/system32/drivers/etc目录下的hosts文件,在里面加入你想要虚拟的机器名,如我是这样加的 127.0.0.1 www www.www.systekgz.com.cn 在这里www.systekgz.com.cn是我的域名。 www是虚拟名 而我机器的本身名字是fangm,在域中的就是fangm.www.systekgz.com.cn 2、 打开jboss-tomcat安装目录下的server/default/deploy的目录中的tomcat4-service.xml文件,原来的文件是这样的 <?xml version="1.0" encoding="UTF-8"?> <!-- Set catalina.home to the location of the Tomcat-4.x dist. The default value is that of the JBoss/Catalina bundle where the jakarta-tomcat-4.0.3-LE-jdk14 is included as jboss_dist/catalina --> <!DOCTYPE server [ <!ENTITY catalina.home "../catalina"> ]> <!-- The service configuration for the embedded Tomcat4 web container --> <server> <classpath codebase="file:&catalina.home;/common/lib/" archives="*"/> <classpath codebase="file:&catalina.home;/server/lib/" archives="*"/> <classpath codebase="file:&catalina.home;/bin/" archives="*"/> <classpath codebase="file:&catalina.home;/lib/" archives="*"/> <classpath codebase="." archives="tomcat4-service.jar"/> <mbean code="org.jboss.web.catalina.EmbeddedCatalinaServiceSX" name="jboss.web:service=EmbeddedCatalinaSX"> <attribute name="CatalinaHome">&catalina.home;</attribute> <attribute name="Config"> <Server> <Service name = "JBoss-Tomcat"> <Engine name="MainEngine" defaultHost="localhost"> <Logger className = "org.jboss.web.catalina.Log4jLogger" verbosityLevel = "trace" category = "org.jboss.web.localhost.Engine"/> <Host name="localhost"> <Valve className = "org.apache.catalina.valves.AccessLogValve" prefix = "localhost_access" suffix = ".log" pattern = "common" directory = "../server/default/log" /> <DefaultContext cookies = "true" crossContext = "true" override = "true" /> </Host> </Engine> <!-- A HTTP Connector on port 8080 --> <Connector className = "org.apache.catalina.connector.http.HttpConnector" port = "8080" minProcessors = "3" maxProcessors = "10" enableLookups = "true" acceptCount = "10" debug = "0" connectionTimeout = "60000"/> </Service> </Server> </attribute> </mbean> </server> 第一、 找到 <Engine name="MainEngine" defaultHost="localhost">处,Jboss-tomcat默认是发布在localhost下面,你改为你的机器名,在这里我改成了<Engine name="MainEngine" defaultHost="fangm.www.systekgz.com.cn">注意不是虚拟的名字。 第二、 加如下的一段<Host name="fangm.www.systekgz.com.cn"> <Alias>www.www.systekgz.com.cn</Alias> <Logger className = "org.jboss.web.catalina.Log4jLogger" verbosityLevel = "debug" category = "org.jboss.web.Host=www"/> <Valve className = "org.apache.catalina.valves.AccessLogValve" prefix = "www_access" suffix = ".log" pattern = "common" directory = " ../server/default/log" /> </Host> 注意这里<Logger className = "org.jboss.web.catalina.Log4jLogger" verbosityLevel = "debug" category = "org.jboss.web.Host=www"/> 和prefix = "www_access" www是虚拟的机器名 当然你也可以不修改 <Engine name="MainEngine" defaultHost="localhost">处把这里<Host name="fangm.www.systekgz.com.cn"> 改为<Host name="localhost"> 改后完整的文件如下: <?xml version="1.0" encoding="UTF-8"?> <!-- Set catalina.home to the location of the Tomcat-4.x dist. The default value is that of the JBoss/Catalina bundle where the jakarta-tomcat-4.0.3-LE-jdk14 is included as jboss_dist/catalina --> <!DOCTYPE server [ <!ENTITY catalina.home "../catalina"> ]> <!-- The service configuration for the embedded Tomcat4 web container --> <server> <classpath codebase="file:&catalina.home;/common/lib/" archives="*"/> <classpath codebase="file:&catalina.home;/server/lib/" archives="*"/> <classpath codebase="file:&catalina.home;/bin/" archives="*"/> <classpath codebase="file:&catalina.home;/lib/" archives="*"/> <classpath codebase="." archives="tomcat4-service.jar"/> <mbean code="org.jboss.web.catalina.EmbeddedCatalinaServiceSX" name="jboss.web:service=EmbeddedCatalinaSX"> <attribute name="CatalinaHome">&catalina.home;</attribute> <attribute name="Config"> <Server> <Service name = "JBoss-Tomcat"> <Engine name="MainEngine" defaultHost="fangm.www.systekgz.com.cn"> <Logger className = "org.jboss.web.catalina.Log4jLogger" verbosityLevel = "trace" category = "org.jboss.web.localhost.Engine"/> <Host name="localhost"> <Valve className = "org.apache.catalina.valves.AccessLogValve" prefix = "localhost_access" suffix = ".log" pattern = "common" directory = "../server/default/log" /> <DefaultContext cookies = "true" crossContext = "true" override = "true" /> </Host> <Host name="fangm.www.systekgz.com.cn"> <Alias>www.www.systekgz.com.cn</Alias> <Logger className = "org.jboss.web.catalina.Log4jLogger" verbosityLevel = "debug" category = "org.jboss.web.Host=www"/> <Valve className = "org.apache.catalina.valves.AccessLogValve" prefix = "www_access" suffix = ".log" pattern = "common" directory = " ../server/default/log" /> </Host> </Engine> <!-- A HTTP Connector on port 8080 --> <Connector className = "org.apache.catalina.connector.http.HttpConnector" port = "8080" minProcessors = "3" maxProcessors = "10" enableLookups = "true" acceptCount = "10" debug = "0" connectionTimeout = "60000"/> </Service> </Server> </attribute> </mbean> </server> 第三、 在你发布.ear应用时,在你找包.war的web应用是,请你在jboss-web.xml文件中加入如下的 <jboss-web> <context-root>/</context-root> <virtual-host>www.www.systekgz.com.cn</virtual-host> </jboss-web> 你就可以通过http:// www.www.systekgz.com.cn:8080来访问了。如果你出现 Apache Tomcat/4.0.3 - HTTP Status 500 - No Context configured to process this request那是因为你没有发布应用.
原创粉丝点击
热门IT博客
热门问题 老师的惩罚 人脸识别 我在镇武司摸鱼那些年 重生之率土为王 我在大康的咸鱼生活 盘龙之生命进化 天生仙种 凡人之先天五行 春回大明朝 姑娘不必设防,我是瞎子 流量到巨星谢不臣 从流量到巨星谢不臣 不忮不求何用不成臧的意思 锲而不舍 恋恋不舍 逝者如斯夫不舍昼夜什么意思 锲而不舍意思 强聒不舍 恋恋不舍意思 一不小心夺舍系统 恋恋不舍反义词 一万个舍不得 依依不舍 恋恋不舍近义词 舍不得 逝者如斯夫不舍昼夜 锲而不舍读音 强聒不舍读音 强聒不舍意思 不舍昼夜 不舍 舍不得你 锲而不舍作文 锲而不舍金石可镂 穷追不舍 舍不得和你说再见 想分手又舍不得怎么办 想离婚舍不得孩子怎么办 依依不舍意思 舍不得说再见 舍友打呼噜睡不着怎么办 离婚舍不得孩子怎么办 离婚舍不得孩子 医医不舍姜小饼干 锲而不舍高中作文 舍不得和你说再见原唱 恋恋不舍造句 舍不得分开在每一次醒来 念念不舍 有种离开叫舍不得 强聒不舍拼音