为什么我无法访问我的 ocsigen 网站?

发布于 2024-12-23 12:13:10 字数 1545 浏览 2 评论 0原文

%yaourt -Qi ocaml-ocsigenserver
name   : ocaml-ocsigenserver
version  : 2.0.2-1
URL : http://ocsigen.org/

%cat ocsigen.conf.qachina
...
<ocsigen>
<server>
    <port>8000</port>
    <logdir>/media/E/RnD/ocaml/test/log/</logdir>
    <datadir>/media/E/RnD/ocaml/test/data</datadir>

    <user>***</user>
    <group>***</group>

    <charset>utf-8</charset>
    <findlib path="/usr/lib/ocaml"/>

    <extension findlib-package="ocsigenserver.ext.staticmod"/>
    <extension findlib-package="ocsigenserver.ext.cgimod">
        <cgitimeout value="30"/>
    </extension>

    <host charset="utf-8" hostfilter="*">
        <site path="ocsigenstuff">
            <static dir="/srv/ocsigenserver/ocsigenstuff" />
        </site>

        <site path="qachina">
           <cgi regexp="cgi-bin/([^/]*)" dir="/media/E/www/qachina/cgi-bin/" script="\1" />
           <static dir="/media/E/www/qachina" />
       </site>

       <static dir="/srv/ocsigenserver" />
    </host>
</server>
</ocsigen>

%ocsigen -c ocsigen.conf.qachina

当访问 http://127.0.0.1:8000 时,效果很好!但是,无论访问 http://127.0.0.1:8000/ocsigenstuff 还是 http://127.0.0.1:8000/qachina,报404错误!

任何建议表示赞赏!

%yaourt -Qi ocaml-ocsigenserver
name   : ocaml-ocsigenserver
version  : 2.0.2-1
URL : http://ocsigen.org/

%cat ocsigen.conf.qachina
...
<ocsigen>
<server>
    <port>8000</port>
    <logdir>/media/E/RnD/ocaml/test/log/</logdir>
    <datadir>/media/E/RnD/ocaml/test/data</datadir>

    <user>***</user>
    <group>***</group>

    <charset>utf-8</charset>
    <findlib path="/usr/lib/ocaml"/>

    <extension findlib-package="ocsigenserver.ext.staticmod"/>
    <extension findlib-package="ocsigenserver.ext.cgimod">
        <cgitimeout value="30"/>
    </extension>

    <host charset="utf-8" hostfilter="*">
        <site path="ocsigenstuff">
            <static dir="/srv/ocsigenserver/ocsigenstuff" />
        </site>

        <site path="qachina">
           <cgi regexp="cgi-bin/([^/]*)" dir="/media/E/www/qachina/cgi-bin/" script="\1" />
           <static dir="/media/E/www/qachina" />
       </site>

       <static dir="/srv/ocsigenserver" />
    </host>
</server>
</ocsigen>

%ocsigen -c ocsigen.conf.qachina

When visiting http://127.0.0.1:8000, it works great! However, no matter visiting http://127.0.0.1:8000/ocsigenstuff or http://127.0.0.1:8000/qachina, it reports 404 error!

Any suggestion is appreciated!

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

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

发布评论

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

评论(1

铁轨上的流浪者 2024-12-30 12:13:10

你的配置文件没有任何问题。 Ocsigen 正在目录中查找“index.html”,但您提供了“index.htm”,因此它返回“找不到页面”错误。

正如 Stéphane 指出的那样,可以通过使用 -V 选项运行 ocsigen 来发现此类问题。

There is nothing wrong with your config file. Ocsigen is looking for "index.html" in the directory, but you provided "index.htm", so it returns a "page not found" error.

As Stéphane pointed out, such a problem can be discovered by running ocsigen using the -V option.

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