我昨天安裝了“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.
日誌說:-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
。我不再需要了,因為它需要更多的時間來修復並且支援很少。
謝謝