Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學
您现在的位置: Windows教程網 >> Windows教程 >  >> Linux 系統教學 >> Linux 教學

CentOS 5.5 修改 Apache 預設端口 80 為自訂端口 (含 SELinux 端口標記)

編輯:Linux 教學

編輯 /etc/httpd/conf/httpd.conf,修改兩處:

Listen 80          → Listen 5555
NameVirtualHost *:80  → NameVirtualHost *:5555

關鍵步驟:SELinux 預設僅允許 httpd 綁定特定端口,需執行:

semanage port -a -t http_port_t -p tcp 5555

否則 httpd 啟動失敗。完成後 service httpd start 或 /etc/rc.d/init.d/httpd start 啟動服務。

Copyright © Windows教程網 All Rights Reserved