为什么我无法访问我的 ocsigen 网站?
%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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你的配置文件没有任何问题。 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.