【发布时间】:2016-07-12 03:36:43
【问题描述】:
G-WAN 开箱即用,运行动态内容没问题,但无法访问静态内容。
我用 kk 用户(不是 root,没有 sudo)运行 G-WAN。所有文件和目录都属于 kk 用户/组。
我将它安装在本地主机中。当我在浏览器中输入127.0.0.1:8080 时,它返回:
Server not found
Firefox can't find the server at www.index.html.
奇怪的是返回的服务器名是www.index.html
当我输入127.0.0.1:8080/index.html 时,它返回了404 file not found。
在新版本发布之前,我该如何解决这些问题?
这次,日志文件中没有错误消息。
(我在 Ubuntu 15.10 中安装了 G-WAN)
更新:------------
来自served_from.c 中有两个奇怪的信息,如下:
This page was processed...
Using get_env():
by the Server: 0.0.0.0:8080:8080(hostname: 127.0.0.1)
^^^^^^^^^^^^^^^^^(Should it be only one '8080'?)
Virtual Host: /home/kk/dev/gwan_v7.12.6/0.0.0.0:8080/#0.0.0.0
HTTP method: GET
HTTP request: /?served_from
HTTP query: served_from
HTTP entity: (null)
Content-Encoding: 0
Content-Length: 0
Content-Type: 0
for the Client: 127.0.0.1:43199
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0
Using HTTP Headers to get the same information:
by the Server: 27.0.0.1:8080 (hostname: 27.0.0.1)
^^^^^^^^^^^^^(Should it be 127.0.0.1 ?
The leading '1' is missing.)
HTTP method: GET
HTTP entity: -
Content-Encoding: 0
Content-Length: 0
Content-Type: 0
for the Client: 127.0.0.1:43199
ozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0
Acpt-Language: n-US,en;q=0.5
Acpt-Encoding: 3: |GZIP|DEFLATE
Cookies: -
v7.12.6 有什么问题吗?
更新 2 ==================================
通过以下步骤,G-WAN v7.12.6 无法显示静态内容:
1.所有文件和目录都属于同一个用户/组(即kk)
2.开箱即用,收听8080
3. 运行 ./gwan
无法访问静态内容。
经过以下改动,G-WAN 可以正常工作:
1. 将目录 0.0.0.0.8080 更改为 0.0.0.0:80
2. 运行 sudo ./gwan -d:kk:kk
一切正常。
抱歉,我在 UPDATE2 中输入错误。它应该是 0.0.0.0:80(强调冒号)。实际上,我在目录名称中输入了它。重复:./gwan 应该根据 G-WAN 的文档工作,因为启动程序的用户拥有所有文件和目录。
【问题讨论】:
标签: g-wan