我用的是ubuntu 15.04。
我已经安装了suphp (repo)和这个url: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.编辑
根据第一个答案,我已经用<Directory>封装了我的<Directory>,但仍然是相同的错误。
我不是一个大专家,所以现在没有编译,只是为了了解为什么一个软件包使用的很多人不适合我。
有什么想法吗?
发布于 2016-01-20 06:27:07
http://www.suphp.org/DocumentationView.html?file=apache/CONFIG
suPHP_UserGroup (expects user- and groupname)只有在使用setid-模式"force“或”偏执“*编译时,才支持指定要运行PHP脚本的用户名和组名。此设置只能在或上下文中使用。示例: suPHP_UserGroup foouser bargroup
./配置-前缀=/usr-sysconfdir=/etc-with-apr=/usr/bin/apr-1-config-with-apxs=/usr/sbin/apxs-with-apache-user=apache-user-with-setid-mode-with-php=/usr/bin/php-cgi-with-logfile=/var/log/httpd/SUPHP_log-启用-SUPHP_USE_USERGROUP=yes
更多参考:suPHP setting user/group to virtual host and using docroot
https://stackoverflow.com/questions/34892930
复制相似问题