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