简体   繁体   English

Apache Httpd和Eclipse Tomcat之间的连接(Windows 7)

[英]Connection between Apache Httpd and Eclipse Tomcat (Windows 7)

my purpose is to connect the httpd web server and the eclipse tomcat application server. 我的目的是连接httpd Web服务器和Eclipse tomcat应用程序服务器。 I configured the tomcat server inserting in the server.xml the following line: 我配置了将tomcat服务器插入server.xml中的以下行:

<Connector port="8009" protocol="AJP/1.3" enableLookups="false" redirectPort="8443"/>

I copied the mod_jk.so file into the httpd modules folder, I created into the conf folder the workers.properties file, which contains the following lines: 我将mod_jk.so文件复制到httpd modules文件夹中,并将workers.properties文件创建到conf文件夹中,该文件包含以下几行:

worker.list=myworker
worker.myworker.type=ajp13
worker.myworker.host=localhost
worker.myworker.port=8009

I added into the httpd.conf file the following lines: 我在httpd.conf文件中添加了以下几行:

LoadModule jk_module modules/mod_jk.so

JkWorkersFile conf/workers.properties
JkLogFile logs/mod_jk.log
JkLogStampFormat "[%b %d %Y - %H:%M:%S] "
JkRequestLogFormat "%w %V %T"
JkLogLevel info

JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories

Alias /testApacheTomcat "C:/Data/testApacheTomcat/"

<Directory "C:/Data/testApacheTomcat/">
    AllowOverride None
    Allow from all
</Directory>

<Location /*/WEB-INF/*>
    deny from all
</Location>

JkMount /testApacheTomcat/* myworker

and I started both Tomcat and Httpd. 我同时启动了Tomcat和Httpd。

Bot tomcat server and HTTPD are correctly started (if I ask for Bot tomcat服务器和HTTPD已正确启动(如果我要求

http://localhost:8080/testApacheTomcat/

I see my app and if I ask for 我看到了我的应用程序,如果我要

http://localhost/

I see the HTTPD welcome page), but they don't communicate (if I ask for 我看到了HTTPD欢迎页面),但是他们无法交流(如果我要求

http://localhost/testApacheTomcat/ 

I receive a 404 page not found). 我收到未找到404页面)。 What am I doing wrong? 我究竟做错了什么?

Thanks so much 非常感谢

You need to remove the Alias and Directoy tags, this will be handled automatically. 您需要删除Alias和Directoy标记,这将自动处理。 Therefore the Location tag is unnecessary too. 因此,位置标签也是不必要的。 Also add this line to you jk mounting: 还将这行添加到您的jk安装中:

JkMount /testApacheTomcat myworker

Then you shoul be able to access: 然后,您应该可以访问:

http://localhost/testApacheTomcat/ 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM