添加另一个端口以监听httpd.conf会使Apache

时间:2018-07-07 23:24:20

标签: apache centos7

该项目的要求是,当某人使用端口80访问该应用程序时,他们应该看到默认应用程序,但是如果某人使用端口8083访问该应用程序,则他们应该看到该控件的控制面板。应用。

我在CentOS上,在Listen 80中添加Listen 8083httpd.conf会使Apache崩溃。

cpanel.conf

<VirtualHost *:8083>
        ServerName cpanel.com
        ServerAlias www.cpanel.com
        DocumentRoot /var/www/cpanel
</VirtualHost>

重新启动Apache时,出现以下错误消息。

错误消息

 httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Sat 2018-07-07 18:56:00 EDT; 7min ago
     Docs: man:httpd(8)
           man:apachectl(8)
  Process: 14972 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=1/FAILURE)
  Process: 14971 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
 Main PID: 14971 (code=exited, status=1/FAILURE)

Jul 07 18:56:00 localhost.localdomain httpd[14971]: (13)Permission denied: AH00072: make_sock: co...083
Jul 07 18:56:00 localhost.localdomain httpd[14971]: (13)Permission denied: AH00072: make_sock: co...083
Jul 07 18:56:00 localhost.localdomain httpd[14971]: no listening sockets available, shutting down
Jul 07 18:56:00 localhost.localdomain httpd[14971]: AH00015: Unable to open logs
Jul 07 18:56:00 localhost.localdomain systemd[1]: httpd.service: main process exited, code=exited...URE
Jul 07 18:56:00 localhost.localdomain kill[14972]: kill: cannot find process ""
Jul 07 18:56:00 localhost.localdomain systemd[1]: httpd.service: control process exited, code=exi...s=1
Jul 07 18:56:00 localhost.localdomain systemd[1]: Failed to start The Apache HTTP Server.
Jul 07 18:56:00 localhost.localdomain systemd[1]: Unit httpd.service entered failed state.
Jul 07 18:56:00 localhost.localdomain systemd[1]: httpd.service failed.
Hint: Some lines were ellipsized, use -l to show in full.

我对此很陌生,因此将非常感谢您的帮助。

1 个答案:

答案 0 :(得分:1)

在启动Apache之前,您可以首先验证是否已经在侦听端口8083,例如:

netstat -an|grep LISTEN|grep 8083

此外,您是否以root用户身份启动Apache?如果需要让它侦听端口80,则需要这样做。让我烦恼的是日志条目,指示它无法打开日志。除了添加“收听8083”以外,您是否还进行了其他更改?