[英]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) 的页面
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.