更改 apache Web 服务器的端口

Change port of apache web server

我是 运行 raspberry pi 上的 apache2 服务器。当我收到错误页面(404、500 等)或转到页面索引时,它会在底部显示: Apache 服务器在 (ip/domain) 端口(某个端口,在我的例子中是 80) 我想更改端口,但我不知道该怎么做。有人可以帮忙吗? 谢谢。

更改您的 Apache 配置文件中的端口并重新启动 Apache。您的配置文件应位于:

/etc/apache2/apache2.conf

将新端口保存到文件后,使用以下命令重新启动 Apache:

sudo service apache2 restart