架站最常用的就是apache了

以下就介紹在CentOS 7內安裝的方法

 

先進行更新
sudo yum -y update

安裝apache
sudo yum -y install httpd

設定防火牆的HTTP port
sudo firewall-cmd --permanent --add-port=80/tcp

設定防火牆的HTTPS port
sudo firewall-cmd --permanent --add-port=443/tcp

重新啟動防火牆
sudo firewall-cmd --reload

重新起動apache
sudo systemctl start httpd

預設會啟動apache

sudo systemctl enable httpd

到此就安裝完成了

相關指令
確認apache狀態
sudo systemctl status httpd

關閉apache
sudo systemctl stop httpd

 

1. 參考網頁https://www.liquidweb.com/kb/how-to-install-apache-on-centos-7

 

文章標籤
全站熱搜
創作者介紹
創作者 RX1226 的頭像
RX1226

給你魚竿

RX1226 發表在 痞客邦 留言(0) 人氣(170)