我昨天安装了“SuPHP”,每当我重新启动“Apache”时,都会出现以下错误:-
* Restarting web server apache2 [fail]
* The apache2 configtest failed.
Output of config test was:
AH00526: Syntax error on line 15 of /etc/apache2/sites-enabled/000-default.conf:
Invalid command 'suPHP_UserGroup', perhaps misspelled or defined by a module not included in the server configuration
Action 'configtest' failed.
The Apache error log may have more information.
我的文件内容/etc/apache2/sites-enabled/000-default.conf
是:-
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
<IfModule mod_suphp.c>
<Directory /var/www/html>
suPHP_UserGroup rocky rocky
</Directory>
</IfModule>
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
现在,“/var/www/html”的权限、用户和组是:-
root@rocky:/var/www# ll
total 12
drwxr-xr-x 3 rocky rocky 4096 Oct 29 05:38 ./
drwxr-xr-x 14 root root 4096 Oct 29 05:38 ../
drwxr-xr-x 8 rocky rocky 4096 Nov 1 15:29 html/
我想提供一些信息。
之前的/var/www
内容是在 下运行的root
,我将owner id
和更改Group id
为我的普通用户组,即rocky
(用户) 和rocky
(组)。
因此,:- 1)。 我不必以 root 用户身份运行或浏览目录。 2)。 当浏览到时http://localhost
,我不会收到Forbidden
错误。 3)。 我不必以 root 用户身份运行我的编辑器。
我做了什么 ?
- 我已经检查过权限和文件夹,它们由当前用户(即我)的
755
用户和组运行-rocky
没有成功 - 我尝试将目录改回
root
,user id
然后group id
。——没有成功 - 我将其编辑
suPHP_UserGroup rocky rocky
为suPHP_UserGroup root root
。
我是否遗漏了什么,我的网络服务器无法正常工作,出现以下错误。请帮助。
* Restarting web server apache2 [fail]
* The apache2 configtest failed.
Output of config test was:
AH00526: Syntax error on line 15 of /etc/apache2/sites-enabled/000-default.conf:
Invalid command 'suPHP_UserGroup', perhaps misspelled or defined by a module not included in the server configuration
Action 'configtest' failed.
The Apache error log may have more information.
Log 说:-SoftException in Application.cpp:566: Directory "/var/www/html/" is writeable by group
请帮忙。谢谢
答案1
好的,要从组中删除用户,请在终端中使用以下命令
sudo deluser username group
然后在将用户添加到组时使用以下命令:
sudo usermod -a -G group username
我不确定您使用什么来添加和创建用户,因为您没有在问题中指定,因此请删除该用户,然后使用我提供的命令重新创建它,如果这不起作用,请向我们展示您如何创建用户。
您还可以尝试安装 gnome-system-tool 来直观地管理您的用户和组,如下所示:
sudo apt-get install gnome-system-tools
答案2
我通过删除这个烦人的东西解决了这个问题suPHP
。我不再需要它了,因为它需要更多时间来修复并且支持很少。
谢谢