简体   繁体   English

Tomcat、mod_jk、Plesk 和 SSL 设置问题

[英]Tomcat, mod_jk, Plesk and SSL setup problems

my workers.properties:我的workers.properties:

vi /etc/httpd/conf.d/workers.properties
worker.list=worker1
worker.worker1.type=ajp13
worker.worker1.host=localhost
worker.worker1.port=8009

my mod_jk.conf我的 mod_jk.conf

vi /etc/httpd/conf.d/mod_jk.conf
JkWorkersFile /etc/httpd/conf.d/workers.properties
JkShmFile     /var/log/httpd/mod_jk.shm
JkLogFile     /var/log/httpd/mod_jk.log
JkLogLevel    info
JkLogLevel info
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
JkRequestLogFormat "%w %V %T"

Added to Tomcat server.xml添加到 Tomcat 服务器。xml

<Engine name="Catalina" defaultHost="localhost" jvmRoute="worker1">
<Host name="domain.com" appBase="/opt/tomcat/webapps/">
<Context path="" docBase="domain-dir"/>
<Alias>www.domain.com</Alias>
</Host>

added mod_jk entries in plesk domain name as under:在 plesk 域名中添加了 mod_jk 条目,如下所示:

vi /var/www/vhosts/system/domain.com/conf/vhost.conf
<IfModule mod_jk.c>
JkMount /servlet/* worker1
JkMount /*.jsp worker1
</IfModule>

Till here things started towards working but tomcat was redirecting to apache on port 80 whilst its using port 8443 for all hosted domains.直到这里,事情开始朝着工作的方向发展,但 tomcat 正在重定向到端口 80 上的 apache,同时它对所有托管域使用端口 8443。

Then I tried to add SSL via java keytool utility and added the following into tomcat server.xml然后我尝试通过 java keytool 实用程序添加 SSL 并将以下内容添加到 tomcat server.Z0F635D78B81C

<Connector port="8445" protocol="org.apache.coyote.http11.Http11NioProtocol"
maxThreads="150" SSLEnabled="true" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS" keystoreFile="/opt/tomcat/ssl/keytool.jks" keystoreType="JKS" keystorePass="pass"/>

The error was ajp cannot be initialized as address is already in use.错误是无法初始化 ajp,因为地址已在使用中。 I think the reason was port 8443 is used by Plesk.我认为原因是 Plesk 使用了端口 8443。 Then I changed port 8443 as 8445 and tomcat start working as https but with some error obviously because of self signed certificate.然后我将端口 8443 更改为 8445 和 tomcat 开始工作为 https 但显然由于自签名证书而出现了一些错误。

Still not able to fix the problem(s):仍然无法解决问题:

http ://domain.com --> working http ://domain.com -->工作在此处输入图像描述

https ://domain.com --> not working https ://domain.com -->不工作在此处输入图像描述

https ://domain.com: 8445 --> Rendering servlet pages but not pages from http (Apache) on Plesk https ://domain.com: 8445 --> 在 Plesk 上呈现 servlet 页面但不是来自 http (Apache) 的页面在此处输入图像描述

  1. Why tomcat working fine with Plesk http pages and not working with HTTPS pages?为什么 tomcat 可以在 Plesk http 页面上正常工作,而不能在 HTTPS 页面上工作?
  2. Why tomcat request is not going to https domains of Plesk为什么 tomcat 请求不会发送到 Plesk 的 https 域
  3. Plesk is occupied 8443 port for displaying domains and 443 for devcot. Plesk 占用 8443 端口用于显示域,443 用于 devcot。
  4. I don't know where I am making mistake as this 4th day I am clueless and finally decided to get help here in this forum我不知道我在哪里犯错,因为这第四天我一无所知,最后决定在这个论坛上寻求帮助

Please advise请指教

Do you want to Access the application via HTTPS in Apache httpd?您想通过 Apache httpd 中的 HTTPS 访问应用程序吗? If yes then please add all JKmount entry in Apache httpd SSL VirtualHost.如果是,请在 Apache httpd SSL VirtualHost 中添加所有 JKmount 条目。

JkMount /servlet/* worker1
JkMount /*.jsp worker1

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

相关问题 mod_jk或mod_proxy_ajp用于集群tomcat和ssl - mod_jk or mod_proxy_ajp for clustering tomcat and ssl 多个Apache mod_jk服务器指向同一个Tomcat工作者? - Multiple Apache mod_jk servers pointing to the same Tomcat worker? Tomcat在本地主机上未响应,但通过apache2 / mod_jk工作 - Tomcat not responding on localhost, but working through apache2/mod_jk 配置mod_jk以在CentOS7上通信Tomcat 8和Apache 2.4 - Configuring mod_jk to communicate Tomcat 8 and Apache 2.4 on CentOS7 使用Apache mod_jk,tomcat的后备负载均衡器 - Fallback Load balancer with apache mod_jk, tomcat Apache + Tomcat与mod_jk - 网站挂起 - Apache + Tomcat with mod_jk - Web site hangs 在apache / tomcat设置(mod_jk)之后在Vaadin中获取IP地址始终会提供服务器的IP地址 - Getting the IP address in Vaadin behind an apache/tomcat setup (mod_jk) always gives the server's IP address 使用mod_jk,tomcat和jersey,如何保持长时间运行的请求? - With mod_jk, tomcat, and jersey, how do you keep a long running request alive? mod_jk Tomcat-Apache连接器,第一个webapp工作,第二个webapp无法访问 - mod_jk Tomcat-Apache connector, 1st webapp works, 2nd webapp inaccessible 是什么导致java.lang.IllegalStateException:在tomcat / mod_jk中发布过大 - What causes java.lang.IllegalStateException: Post too large in tomcat / mod_jk
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM