.htaccess 重写Tomcat服务器

发布于 2024-12-14 14:17:30 字数 657 浏览 8 评论 0原文

我正在使用 Railo 编写一个网站。我的代码将部署在 Tomcat 上运行的 Railo 服务器上,覆盖在常规 Apache+PHP 服务器上。

我需要将所有请求发送到 http://subdomain.myserver.co.uk/ 及其子文件到目录 /public_html/railo/tomcat/webapps/ROOT/subdomain/< /代码> 目录。

我在 cPanel 中定义了一个子域,文档根目录为 /public_html/railo/tomcat/webapps/ROOT/subdomain/,但仍然请求 http://subdomain.myserver.co。 uk/ 显示 /public_html/railo/tomcat/webapps/ROOT/ 中的文件。如果我请求 http://subdomain.myserver.co.uk/subdomain/ 我可以查看我的文件

我已经摆弄 .htaccess 文件很长一段时间了,但我陷入困境

有什么方法可以实现我想要实现的目标,或者我是否辞职使用 http://subdomain.myserver.co.uk/subdomain/ 获取这些页面

I am writing a website using Railo. My code is to be deployed on a Railo Server running on Tomcat, overlayed on a regular Apache+PHP server.

I need to send all requests to http://subdomain.myserver.co.uk/ and its child files to the directory /public_html/railo/tomcat/webapps/ROOT/subdomain/ directory.

I defined a subdomain in cPanel, with the document root as /public_html/railo/tomcat/webapps/ROOT/subdomain/, but still requests to http://subdomain.myserver.co.uk/ display files in /public_html/railo/tomcat/webapps/ROOT/. I can view my files if I request http://subdomain.myserver.co.uk/subdomain/

I've been fiddling with the .htaccess files for quite some time now, but I'm stuck

Is there any way I can do what I'm trying to achieve, or am I resigned to get those pages using http://subdomain.myserver.co.uk/subdomain/

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

等风来 2024-12-21 14:17:31

有关将站点添加到 Railo/Tomcat/Apache/Linux 安装的 Railo 文档位于:

http ://wiki.getrailo.org/wiki/Installation:InstallerDocumentation:LinAddingSites

我个人还建议不要将站点文件放入ROOT/sitedir/ 因为 ROOT 目录已经为 localhost 配置,并且将子目录放入另一个站点将导致 WEB-INF 目录中的主机配置重叠。

相反,只需使用控制面板的默认设置,并更新 Tomcat server.xml 文件以指向控制面板自然放置站点的目录。这将使您的 Railo 站点和控制面板能够非常顺利地协同工作。

希望这有帮助!

The Railo documentation on adding a site to a Railo/Tomcat/Apache/Linux install is here:

http://wiki.getrailo.org/wiki/Installation:InstallerDocumentation:LinAddingSites

I would also personally recommend against putting your site files in ROOT/sitedir/ because the ROOT directory is already configured for localhost, and making a subdirectory into another site will cause overlapping host configs in the WEB-INF directories.

Instead, just use whatever the default is for your control panel, and update your Tomcat server.xml file to point to the directory that your control panel naturally puts sites in. This will make your Railo site and your control panel work very smoothly together.

Hope this helps!

澉约 2024-12-21 14:17:31

如果您希望 Tomcat 应用程序在 example.com 上运行,而不是在 example.com/application 上运行,那么您需要将应用程序部署在 /ROOT 上> 而不是在 /application 处。这将使其成为“默认 Web 应用程序”,因此它将能够直接从 example.com 提供服务。

看一下: http://tomcat.apache.org/tomcat- 5.5-doc/config/context.html

If you want your tomcat application to serve at example.com and not at example.com/application then you need to deploy your application at /ROOT and not at /application. This will make it the "default web application" so it'll be able to serve directly from example.com.

Have a look at: http://tomcat.apache.org/tomcat-5.5-doc/config/context.html

差↓一点笑了 2024-12-21 14:17:31

Cherouvim 的回答对我不起作用。最终我将整个应用程序放在 ROOT 目录中

Cherouvim's answer didn't work for me. Eventually I ended up putting my entire application in the ROOT directory

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文