Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/28.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux 如何在启动apache服务器时解决chown:无效用户?_Linux_Apache_Lamp - Fatal编程技术网

Linux 如何在启动apache服务器时解决chown:无效用户?

Linux 如何在启动apache服务器时解决chown:无效用户?,linux,apache,lamp,Linux,Apache,Lamp,我正在尝试通过运行- sudo service apache2 start 但这导致了- Job for apache2.service failed because the control process exited with error code. See "systemctl status apache2.service" and "journalctl -xe" for details. 我试过了- sudo systemctl status

我正在尝试通过运行-

sudo service apache2 start
但这导致了-

Job for apache2.service failed because the control process exited with error code.
See "systemctl status apache2.service" and "journalctl -xe" for details.
我试过了-

sudo systemctl status apache2.service
它正在展示-

● apache2.service - The Apache HTTP Server
     Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Tue 2020-12-08 11:17:18 IST; 7min ago
       Docs: https://httpd.apache.org/docs/2.4/
    Process: 30529 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)

Dec 08 11:17:18 dk systemd[1]: Starting The Apache HTTP Server...
Dec 08 11:17:18 dk apachectl[30535]: chown: invalid user: 'dk'
Dec 08 11:17:18 dk systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
Dec 08 11:17:18 dk systemd[1]: apache2.service: Failed with result 'exit-code'.
Dec 08 11:17:18 dk systemd[1]: Failed to start The Apache HTTP Server.
我假设问题在于无效用户:dk。我如何解决这个问题? 我最近还删除了一个已经安装了LAMP stack的用户帐户。这就是它显示无效用户的原因吗?

您必须在文件中看到:
/etc/apache2/apache2.conf
/etc/apache2/httpd.conf

  • 输入的用户和组是什么
通常是:

User www-data
Group www-data
或者在你的情况下是“dk”

此外,您可能已在服务器文件中指定站点位置位于“dk”拥有的目录中

使用以下命令检查服务器配置:

apachectl configtest


在新系统中,例如ubuntu 20*LTS,配置文件是
/etc/apache2/envvars


查找APACHE_RUN_用户和APACHE_RUN_组。

堆栈溢出用于解决编程问题。“你可以试着问下去,或者改为问。”约翰·古格曼谢谢你的建议。我将尝试在这些站点提问。
apachectl configtest
返回
chown:invalid user:'dk'
Yes,RUN_用户和RUN_组设置为dk。我应该把它改成www数据吗?我把它改成了www数据,它现在可以工作了。谢谢你的帮助。:)酷-我能帮上忙真是太好了
sudo apachectl configtest