0

我正在使用 ubuntu 15.04。

我已经使用此 url 中的指南安装了 suphp (repo): Install suphp with apache on ubuntu

在我像这个例子一样定义虚拟主机之后:

<VirtualHost 64.131.72.23:80>
ServerName some-site.com
ServerAlias www.some-site.com
DocumentRoot /home/mike/public_html
<IfModule mod_suphp.c>
    suPHP_UserGroup mike mike
</IfModule>
</VirtualHost>

我重新启动了apache服务并得到了错误:

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


:/etc/apache2/sites-available# systemctl status apache2.service -l
apache2.service - LSB: Apache2 web server
   Loaded: loaded (/etc/init.d/apache2)
   Active: failed (Result: exit-code) since Wed 2016-01-20 00:36:26 CST; 41s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 18692 ExecStop=/etc/init.d/apache2 stop (code=exited, status=0/SUCCESS)
  Process: 18718 ExecStart=/etc/init.d/apache2 start (code=exited, status=1/FAILURE)

Jan 20 00:36:26 numi apache2[18718]: * The apache2 configtest failed.
Jan 20 00:36:26 numi apache2[18718]: Output of config test was:
Jan 20 00:36:26 numi apache2[18718]: AH00526: Syntax error on line 7 of /etc/apache2/sites-enabled/wpdev.co.il.c                           onf:
Jan 20 00:36:26 numi apache2[18718]: Invalid command 'suPHP_UserGroup', perhaps misspelled or defined by a modul                           e not included in the server configuration
Jan 20 00:36:26 numi apache2[18718]: Action 'configtest' failed.
Jan 20 00:36:26 numi apache2[18718]: The Apache error log may have more information.
Jan 20 00:36:26 numi systemd[1]: apache2.service: control process exited, code=exited status=1
Jan 20 00:36:26 numi systemd[1]: Failed to start LSB: Apache2 web server.
Jan 20 00:36:26 numi systemd[1]: Unit apache2.service entered failed state.
Jan 20 00:36:26 numi systemd[1]: apache2.service failed.

编辑

根据第一个答案,我已将我的 suPHP_UserGroup 包装在<Directory>其中,但仍然是相同的错误。
我不是一个大专家,所以暂时不编译,只是为了理解为什么很多人使用的包对我不起作用。

有任何想法吗 ?

4

1 回答 1

0

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

suPHP_UserGroup (expects user- and groupname)

仅在使用 setid-mode "force" 或 "paranoid" 编译时支持 * 指定运行 PHP 脚本的用户名和组名。此设置只能在 a 或上下文中使用。示例: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

更多参考:suPHP 将用户/组设置为虚拟主机并使用 docroot

于 2016-01-20T06:27:07.357 回答