雄猫Apache 与 mod_jk 部分工作
我有一个 grails 应用程序在 apache 2.2 http 服务器指向的 tomcat 服务器上运行。使用 mod_jk,我可以使用 myapp.com:9090 访问该应用程序。然而 myapp.com 只是给我 503 错误:
“无法可靠地确定服务器的完全限定域名,使用 193.xx.xxx.xxx 作为 ServerName。”
但这是我得到的唯一错误。 虚拟主机看起来像这样:
<VirtualHost 193.xx.xxx.xxx:80>
ServerName www.myapp.se
ServerAlias myapp.se
DocumentRoot "D:/apache-tomcat-7.0.5/webapps/ROOT"
JkMount /* worker1
</VirtualHost>
在 httpd.conf 中,我像这样加载模块:
# Load module
LoadModule jk_module modules/mod_jk.so
# Where to find workers.properties
JkWorkersFile conf/workers.properties
# Where to put jk logs
JkLogFile logs/mod_jk.log
# Set the jk log level [debug/error/info]
JkLogLevel emerg
# Select the log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
# JkOptions indicate to send SSL KEY SIZE,
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
# JkRequestLogFormat set the request format
JkRequestLogFormat "%w %V %T"
并且workers.properties看起来像这样:
workers.tomcat_home="D:/apache-tomcat-7.0.5"
workers.java_home="C:/Program Files/Java/jdk1.6.0_22"
ps=/
worker.list=worker1
worker.worker1.port=8010
worker.worker1.host=localhost
worker.worker1.type=ajp13
worker.worker1.lbfactor=1
I have a grails app running on a tomcat server that is pointed to by apache 2.2 http server. Using mod_jk I've gotten it to work using myapp.com:9090 to get to the app. However myapp.com just gives me 503 with the error:
"Could not reliably determine the server's fully qualified domain name, using 193.xx.xxx.xxx for ServerName."
But this is the only error I get.
The virtual host looks like this:
<VirtualHost 193.xx.xxx.xxx:80>
ServerName www.myapp.se
ServerAlias myapp.se
DocumentRoot "D:/apache-tomcat-7.0.5/webapps/ROOT"
JkMount /* worker1
</VirtualHost>
In the httpd.conf i load the module like this:
# Load module
LoadModule jk_module modules/mod_jk.so
# Where to find workers.properties
JkWorkersFile conf/workers.properties
# Where to put jk logs
JkLogFile logs/mod_jk.log
# Set the jk log level [debug/error/info]
JkLogLevel emerg
# Select the log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
# JkOptions indicate to send SSL KEY SIZE,
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
# JkRequestLogFormat set the request format
JkRequestLogFormat "%w %V %T"
And the workers.properties looks like this:
workers.tomcat_home="D:/apache-tomcat-7.0.5"
workers.java_home="C:/Program Files/Java/jdk1.6.0_22"
ps=/
worker.list=worker1
worker.worker1.port=8010
worker.worker1.host=localhost
worker.worker1.type=ajp13
worker.worker1.lbfactor=1
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您尝试过 mod_proxy_ajp 吗?我有一个正在生产中的 Grails 应用程序,它使用 Apache 2.2、Tomcat 6x、Grails 1.3.7,并通过 Apache 代理到 Tomcat,使用 mod_proxy_ajp 时不会出现问题。如果您不限于使用 mod_jk,我建议您尝试一下。我在 Centos 5.5、Ubuntu 10.4LTS 和 Win2k3 环境上工作,仅供参考。
Have you tried mod_proxy_ajp? I have a Grails app in production that uses Apache 2.2, Tomcat 6x, Grails 1.3.7 with Apache proxying to Tomcat w/o issue using mod_proxy_ajp. If you're not restricted to using mod_jk, I recommend giving this a try. And I have this working on Centos 5.5, Ubuntu 10.4LTS and Win2k3 environments, FYI.