免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
楼主: liyoujunlizi
打印 上一主题 下一主题

[Web] 求助:apahce服务器不能正常显示网页 [复制链接]

论坛徽章:
0
11 [报告]
发表于 2009-04-07 17:32 |只看该作者
内网里面。。。进来不到。
谢谢哈。

论坛徽章:
0
12 [报告]
发表于 2009-04-09 10:31 |只看该作者
update...
我在httpd.conf文件里面修改了默认的主站点的存储位置,出现了IE显示空白的现象.
昨天我改回到默认位置,并加载了网页文件,就可以正常访问了.
好奇怪.附件是部分conf文件...

httpd.conf.JPG (42.85 KB, 下载次数: 49)

httpd.conf.JPG

论坛徽章:
0
13 [报告]
发表于 2009-04-09 10:44 |只看该作者
原帖由 liyoujunlizi 于 2009-4-9 10:31 发表
update...
我在httpd.conf文件里面修改了默认的主站点的存储位置,出现了IE显示空白的现象.
昨天我改回到默认位置,并加载了网页文件,就可以正常访问了.
好奇怪.附件是部分conf文件...

默认存储位置在哪里?
你修改的位置又在哪里?

会不会是文件的权限问题。

论坛徽章:
0
14 [报告]
发表于 2009-04-09 10:48 |只看该作者
默认的位置就在/etc/httpd/apache/htdocs. 信息如下:

drwxr-xr-x   3 root root 4096 Apr  8 18:23 htdocs

修改的.../html
drwxrwxrwx  4 root  root          1024 Apr  8 15:55 html
我把权限全放开了.

至于网页文件,我用的cp -a sr ds,应该不会出现权限问题...

我在想是不是httpd.conf文件我没有修改到,才发生的那种现象.

[ 本帖最后由 liyoujunlizi 于 2009-4-9 10:50 编辑 ]

论坛徽章:
0
15 [报告]
发表于 2009-04-09 10:52 |只看该作者
原帖由 liyoujunlizi 于 2009-4-9 10:48 发表
默认的位置就在/etc/httpd/apache/htdocs. 信息如下:

drwxr-xr-x   3 root root 4096 Apr  8 18:23 htdocs

修改的.../html
drwxrwxrwx  4 root  root          1024 Apr  8 15:55 html
我把权限全放开了 ...

http://www.lslnet.com/linux/f/docs1/i18/big5185364.htm
http://www.fwolf.com/blog/post/219

[ 本帖最后由 ziggler 于 2009-4-9 10:55 编辑 ]

论坛徽章:
0
16 [报告]
发表于 2009-04-09 11:10 |只看该作者
谢谢老兄...正在看.

论坛徽章:
0
17 [报告]
发表于 2009-04-09 11:14 |只看该作者
我觉得我这儿可能与用户还有关系.我所有的操作都是以root身份实现的.

论坛徽章:
0
18 [报告]
发表于 2009-04-09 11:16 |只看该作者
原帖由 liyoujunlizi 于 2009-4-9 11:14 发表
我觉得我这儿可能与用户还有关系.我所有的操作都是以root身份实现的.

普通用户是啥权限?

是否需要考虑用户组?

能访问你的WEB用户,默认的当成啥用户?

论坛徽章:
0
19 [报告]
发表于 2009-04-09 15:33 |只看该作者
我查了下httpd运行的程序.它是以daemon用户运行的.请看附件:
而且目录,文件的权限都能达到755的标准.
也就是说用户与组的权限问题,可以不用考虑了.
感觉有一点奇怪的是,type显示ipv6...

[ 本帖最后由 liyoujunlizi 于 2009-4-9 15:36 编辑 ]

ls.JPG (31.88 KB, 下载次数: 59)

lsof -i:80

lsof -i:80

论坛徽章:
0
20 [报告]
发表于 2009-04-09 15:48 |只看该作者
原帖由 liyoujunlizi 于 2009-4-9 15:33 发表
我查了下httpd运行的程序.它是以daemon用户运行的.请看附件:
而且目录,文件的权限都能达到755的标准.
也就是说用户与组的权限问题,可以不用考虑了.
感觉有一点奇怪的是,type显示ipv6...



官网上看看这个:
Apache Module mod_userdir



This module allows user-specific directories to be accessed using the http://example.com/~user/ syntax.
Directives

    * UserDir

See also

    * Mapping URLs to the Filesystem
    * public_html tutorial

top
UserDir Directive
Description:        Location of the user-specific directories
Syntax:        UserDir directory-filename [directory-filename] ...
Context:        server config, virtual host
Status:        Base
Module:        mod_userdir

The UserDir directive sets the real directory in a user's home directory to use when a request for a document for a user is received. Directory-filename is one of the following:

    * The name of a directory or a pattern such as those shown below.
    * The keyword disabled. This turns off all username-to-directory translations except those explicitly named with the enabled keyword (see below).
    * The keyword disabled followed by a space-delimited list of usernames. Usernames that appear in such a list will never have directory translation performed, even if they appear in an enabled clause.
    * The keyword enabled followed by a space-delimited list of usernames. These usernames will have directory translation performed even if a global disable is in effect, but not if they also appear in a disabled clause.

If neither the enabled nor the disabled keywords appear in the Userdir directive, the argument is treated as a filename pattern, and is used to turn the name into a directory specification. A request for http://www.example.com/~bob/one/two.html will be translated to:
UserDir directive used         Translated path
UserDir public_html         ~bob/public_html/one/two.html
UserDir /usr/web         /usr/web/bob/one/two.html
UserDir /home/*/www         /home/bob/www/one/two.html

The following directives will send redirects to the client:
UserDir directive used         Translated path
UserDir http://www.example.com/users         http://www.example.com/users/bob/one/two.html
UserDir http://www.example.com/*/usr         http://www.example.com/bob/usr/one/two.html
UserDir http://www.example.com/~*/         http://www.example.com/~bob/one/two.html
Be careful when using this directive; for instance, "UserDir ./" would map "/~root" to "/" - which is probably undesirable. It is strongly recommended that your configuration include a "UserDir disabled root" declaration. See also the Directory directive and the Security Tips page for more information.

Additional examples:

To allow a few users to have UserDir directories, but not anyone else, use the following:

UserDir disabled
UserDir enabled user1 user2 user3

To allow most users to have UserDir directories, but deny this to a few, use the following:

UserDir enabled
UserDir disabled user4 user5 user6

It is also possible to specify alternative user directories. If you use a command like:

Userdir public_html /usr/web http://www.example.com/

With a request for http://www.example.com/~bob/one/two.html, will try to find the page at ~bob/public_html/one/two.html first, then /usr/web/bob/one/two.html, and finally it will send a redirect to http://www.example.com/bob/one/two.html.

If you add a redirect, it must be the last alternative in the list. Apache cannot determine if the redirect succeeded or not, so if you have the redirect earlier in the list, that will always be the alternative that is used.

User directory substitution is not active by default in versions 2.1.4 and later. In earlier versions, UserDir public_html was assumed if no UserDir directive was present.
See also

    * public_html tutorial

http://httpd.apache.org/docs/2.2/mod/mod_userdir.html#userdir
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP