【问题标题】:Set JSP as Apache default page将 JSP 设置为 Apache 默认页面
【发布时间】:2014-01-15 12:24:30
【问题描述】:

嗨,

我目前是第一次配置个人服务器。我目前正在使用 Apache 2 和 JBoss,它们都使用 mod_proxy 进行连接。 假设我的服务器 IP 是 myserverip,我目前能够访问部署在 JBoss 中的任何 JSP 文件,而无需键入:8080。 (http://myserverip:8080/myjsp --> http://myserverip/myjsp) 但是现在我想将我的 apache 服务器配置为使用 JSP 页面作为它的默认页面,而不是 index.html。例如,我想访问 http://myserverip/myjsp 作为 http://myserverip 。 假设 myjsp 是我在 JBoss 中部署的 .war。

谢谢

【问题讨论】:

    标签: java apache jsp jboss


    【解决方案1】:
    1. 打开您的 Apache 配置文件 httpd.conf

    2. 找出如下行:DirectoryIndex

    3. 现在根据您的要求进行设置:DirectoryIndex /myjsp/

    4. 保存并关闭文件。

    5. 重新启动 Apache Web 服务器。

    【讨论】:

    • httpd.conf。文件为空。
    • 然后尝试添加建议的行,或编辑另一个配置文件(在我的服务器上大约有 5 个)
    • 在这种情况下您可能想尝试编辑 apache2.conf。
    • 我发现的对 DirectoryIndex 的唯一引用在 mods-enable/dir.conf 和 mods-available/dir.conf 中。在他们两个中,我都有以下行: DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm 这是我必须更改的行吗?
    • 顺便说一下,我正在使用 Ubuntu,这就是为什么我的 httpd.conf 是空的。
    猜你喜欢
    • 1970-01-01
    • 2014-05-04
    • 1970-01-01
    • 1970-01-01
    • 2015-05-16
    • 2015-03-22
    • 2012-10-06
    • 2011-10-25
    • 1970-01-01
    相关资源
    最近更新 更多