AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 1009980
Accepted
harshrathod50
harshrathod50
Asked: 2020-03-30 12:26:53 +0800 CST2020-03-30 12:26:53 +0800 CST 2020-03-30 12:26:53 +0800 CST

如何使用 httpd (https/ssl) 作为 tomcat 的代理服务器

  • 772

我已经在我的服务器上安装了 httpd 和 tomcat,但不知何故我无法连接它们。

<VirtualHost *:80>
        ServerName www.harshrathod.dev
        ServerAlias harshrathod.dev
        ServerAdmin ******************
        DocumentRoot /var/www/html
        DirectoryIndex index.html
RewriteEngine on
RewriteCond %{SERVER_NAME} =www.harshrathod.dev [OR]
RewriteCond %{SERVER_NAME} =harshrathod.dev
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]

ProxyRequests off
ProxyPass /projects/legend ajp://localhost:8009/legend
ProxyPassReverse /projects/legend ajp://localhost:8009/legend

</VirtualHost>

访问harhrathod.dev 上的图例页面显示错误,而不是响应“../webapps/legend”中的index.jsp 页面。两台服务器都已启动并正在运行。HTTPD 在 localhost:8080 上侦听 80 和 tomcat

我需要将其粘贴到:

ProxyRequests off
ProxyPass /projects/legend ajp://localhost:8009/legend
ProxyPassReverse /projects/legend ajp://localhost:8009/legend

在 httpd-le-ssl.conf 中?

error_log 上有这些与代理相关的错误

[Sun Mar 29 17:13:28.909192 2020] [proxy:error] [pid 6690] (70007)The timeout specified has expired: AH00957: AJP: attempt to connect to 120.0.0.1:8009 (120.0.0.1) failed
[Sun Mar 29 17:13:28.909285 2020] [proxy_ajp:error] [pid 6690] [client 27.56.193.67:10405] AH00896: failed to make connection to backend: 120.0.0.1, referer: https://harshrathod.dev/
[Sun Mar 29 17:18:19.513513 2020] [proxy:error] [pid 6659] (70007)The timeout specified has expired: AH00957: AJP: attempt to connect to 120.0.0.1:8009 (120.0.0.1) failed
[Sun Mar 29 17:18:19.513582 2020] [proxy_ajp:error] [pid 6659] [client 103.125.234.198:57195] AH00896: failed to make connection to backend: 120.0.0.1, referer: https://harshrathod.dev/
ssl httpd.conf httpd ajp tomcat8
  • 1 1 个回答
  • 604 Views

1 个回答

  • Voted
  1. Best Answer
    Piotr P. Karwasz
    2020-03-30T21:12:25+08:002020-03-30T21:12:25+08:00

    您<VirtualHost *:80>设置为将所有内容重定向到端口443(至少对于harshrathod.devandwww.harshrathod.dev域),因此该ProxyPass指令将永远不会被执行。

    正如您在问题中建议的那样,您应该将ProxyPass和相关指令移至您的<VirtualHost *:443>.

    另请注意,此配置中未使用Tomcat 的HTTP/1.1 <Connector>on 端口。8080您改用AJP/1.3 <Connector>on 端口8009,这是一个更快的协议。如果您想使用(较慢)HTTP/1.1 <Connector>使用:

    ProxyPass /projects/legend http://localhost:8080/legend
    ProxyPassReverse /projects/legend http://localhost:8080/legend
    
    • 0

相关问题

  • 如何使用 Tomcat 5.5 更新 SSL 证书

  • 为 IIS6 自行生成 SSL 证书?

  • plesk 上的域和子域 ssl 访问

  • 如何设置 SSL 邮件服务器?

  • 如何通过 SVN 命令行接受 SSL 证书?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve