apache使用userdir
Edit by King最方面和别人共享html文档(由docbook转换),当然是在自己的电脑上搭建apache了。使用系统的源安装apache非常方面,为了能够用非root用户也能够方便发布,将文件放入主文件夹中的public_html文件夹最方便了。
要让apache访问这个文件夹,只要使用userdir模块。在opensuse中默认就已经安装好了,默认配置也已经适用。来看下默认的配置:
<IfModule mod_userdir.c>
UserDir disabled root
<Directory /home/*/public_html>
AllowOverride FileInfo AuthConfig Limit Indexes
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
<Limit GET POST OPTIONS PROPFIND>
Order allow,deny
Allow from all
</Limit>
<LimitExcept GET POST OPTIONS PROPFIND>
Order deny,allow
Deny from all
</LimitExcept>
</Directory>
</IfModule>
这个配置文件中可以使用UserDir来设置不同用户的权限,如使用:
UserDir disabled root
禁止使用root账户的public_html文件夹,当然也可以disable其他账户。
启动apache服务后,就可以通过~USERNAME/xxx.html来访问USERNAME用户的public_html文件夹中的html文件了。
页:
[1]