Apache中的SuExecUserGroup怎么没有作用?
我安装的是2.2.4版本:
[Copy to clipboard] [ - ]
CODE:
tar -zxvf httpd-2.2.4.tar.gz
cd httpd-2.2.4
./configure --prefix=/usr/local/apache2 --enable-mods-shared=most --enable-modules=most --enable-so --enable-suexec --with-s
uexec-caller=daemon --with-suexec-docroot=/usr/www
make
make install
然后创建一个网站test.xxx.cn:
[Copy to clipboard] [ - ]
CODE:
cd /usr/www
mkdir test.xxx.cn
建立了用户test和用户组test:
[Copy to clipboard] [ - ]
CODE:
groupadd test
useradd -g test test
设置虚拟主机的权限:
[Copy to clipboard] [ - ]
CODE:
chown test:test test.xxx.cn -R
chmod 770 test.xxx.cn
httpd.conf的部分配置如下:
[Copy to clipboard] [ - ]
CODE:
.
.
.
LoadModule suexec_module modules/mod_suexec.so
<IfModule !mpm_netware_module>
User daemon
Group daemon
</IfModule>
ServerAdmin you@example.com
DocumentRoot "/usr/local/apache2/htdocs"
Listen 80
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot /usr/www/test.xxx.cn
ServerName test.xxx.cn
SuexecUserGroup test test
<Directory "/usr/www/test.xxx.cn">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
DirectoryIndex index.php index.html
</Directory>
</VirtualHost>
.
.
.
启动Apache正常,浏览站点test.xxx.cn/test.php时出现
Forbidden
You don't have permission to access / on this server.
可是
chmod 775 test.xxx.cn -R
后就正常了,屏幕上显示
Hostnameort test.xxx.cn:0
User/Group daemon(2)/2
Max Requests Per Child: 10000 - Keep Alive: on - Max Per Connection: 100