无法更改unix中的Apache http服务器端口

我下载了Apache HTTP服务器,将其编译并安装在unix框中。

我试图在UNIX下启动我的Apache HTTP服务器,但得到了下面的错误,所以我想改变端口。

(13)Permission denied: make_sock: could not bind to address 0.0.0.0:80 no listening sockets available, shutting down 

我尝试通过修改httpd.conf文件(存在于conf目录下)来更改UNIX中的Apache HTTP服务器的侦听端口,但是当我重新启动服务器时,这似乎没有任何作用。

 # # Listen: Allows you to bind Apache to specific IP addresses and/or # ports, instead of the default. See also the <VirtualHost> # directive. # # Change this to Listen on specific IP addresses as shown below to # prevent Apache from glomming onto all bound IP addresses (0.0.0.0) # #Listen 12.34.56.78:80 Listen 82 

我试图将端口号改为大于1024(非特权端口号)的值,但是我得到了与上面相同的错误(错误仍列表端口80)。

我正在使用httpd来启动服务器。 我什至尝试开始使用下面的命令,但我仍然得到相同的错误..

apachectl -f ./conf/httpd.conf

我错过了什么吗?

当你说你下载Apache并将其安装在“UNIX”框中时,你实际上在运行什么操作系统? 你在运行Linux吗? 的Solaris? FreeBSD的? OpenBSD的? 等等。?

此外,无论您正在运行的系统是否可能将Apache作为一个包从它的包pipe理实用程序进行安装。

此外,apachectl不应该采取configuration参数。 你可以尝试运行…

 # httpd -f ./conf/httpd.conf 

如果你使用完整的path,而不是相对只是为了确保没有任何问题,可能会更好。 但是,最好的办法是告诉我们你正在使用哪个操作系统,并且可以用一个更具可支持性的方式来安装它,并且有相关的文档。

检查你是否使用了在命令行中指定的httpd.conf文件,在Centos系统上,我必须指定./conf/httpd.conf仍然使用/etc/httpd/conf/httpd.conf文件(相对path看起来是根源于/ etc / httpd)。

还要检查你是否没有运行SELinux,它可以被configuration为只允许httpd绑定到特定的端口,作为root你可以得到列表

 semanage -port -l | grep http_port_t http_port_t tcp 80, 443, 488, 8008, 8009, 8443 

您可以使用添加自己的端口

  semanage port -a -t http_port_t -p tcp 1025 

作为根,但如果你没有root权限,你将不得不从上面的列表中select一个。