suPHP将用户/组设置为虚拟主机并使用docroot [英] suPHP setting user/group to virtual host and using docroot

查看:111
本文介绍了suPHP将用户/组设置为虚拟主机并使用docroot的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使suPHP正常运行,我遵循了教程,并且似乎已正确安装了它.

I am trying to get suPHP working, i followed tutorials and seem to have it installed correctly.

现在我的问题是这个

1)我在suphp.conf文件中设置了docroot,但默认情况下将其设置为/var/www.我的问题是我的域也存储在另一个目录下.例如,我的子域位于一个目录中,常规域位于另一个目录中.因此我在浏览器中遇到一个错误,告诉我域正在解析到不在配置中的目录.

1) i set docroot in the suphp.conf file, but its set to /var/www by default. The problem I have with this is that my domains are stored under another directory as well. So for instance i have my subdomains in one directory and my regular domains in another. So I get an error thrown to my browser telling me that a domain is resolving to a directory not in the configuration.

2)我想知道如何使用suPHP_UserGroup在VirtualHost配置下设置特定域集的用户/组.

2) I would like to know how to use suPHP_UserGroup to set the user/group of a specific domain set under my VirtualHost configuration.

这是一个示例VirtualHost,我必须更好地展示我的问题.

This is an example VirtualHost that I have to better show my issues.

<VirtualHost *:80>
    ServerAdmin admin@domain.com
    ServerAlias mail.domain.com
    DocumentRoot /web/users/domain.com/subdomains/mail/webmail

    <IfModule mod_suphp.c>
        suPHP_UserGroup mail mail
    </IfModule>

    <Directory "/web/users/domain.com/subdomains/mail/webmail">
        AllowOverride All
        Order allow,deny
        Allow from All
    </Directory>
</VirtualHost>

重新加载apache时出现错误:

When I reload apache I get an error:

Invalid command 'suPHP_UserGroup', perhaps misspelled or defined by a module not included in the server configuration

我为此配置了suPHP:

./configure --prefix=/usr --sysconfdir=/etc --with-apr=/usr/bin/apr-1-config --with-apxs=/usr/sbin/apxs --with-apache-user=apache --with-setid-mode=owner --with-php=/usr/bin/php-cgi --with-logfile=/var/log/httpd/suphp_log --enable-SUPHP_USE_USERGROUP=yes

推荐答案

http://www.suphp.org/DocumentationView.html?file=apache/CONFIG

suPHP_UserGroup(期望用户名和组名)

suPHP_UserGroup (expects user- and groupname)

  • 仅在使用setid模式"force"或"paranoid"进行编译时受支持* 指定用于运行PHP脚本的用户名和组名.这个设定 只能在或上下文中使用. 示例:suPHP_UserGroup foouser bargroup

  • Only supported when compiled with setid-mode "force" or "paranoid" * Specify the user- and groupname to run PHP-scripts with. This setting can only be used within a or context. Example: suPHP_UserGroup foouser bargroup

./configure --prefix =/usr --sysconfdir =/etc --with-apr =/usr/bin/apr-1-config --with-apxs =/usr/sbin/apxs --with- apache-user = apache --with-setid-mode = paranoid --with-php =/usr/bin/php-cgi --with-logfile =/var/log/httpd/suphp_log --enable-SUPHP_USE_USERGROUP = yes

./configure --prefix=/usr --sysconfdir=/etc --with-apr=/usr/bin/apr-1-config --with-apxs=/usr/sbin/apxs --with-apache-user=apache --with-setid-mode=paranoid --with-php=/usr/bin/php-cgi --with-logfile=/var/log/httpd/suphp_log --enable-SUPHP_USE_USERGROUP=yes

这篇关于suPHP将用户/组设置为虚拟主机并使用docroot的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆