首頁  >  文章  >  運維  >  如何在centos下安裝apache

如何在centos下安裝apache

王林
王林轉載
2020-06-24 17:45:125679瀏覽

在centos下安裝apache的方法是:1、執行【yum install httpd】命令安裝httpd;2、開啟設定文件,將【AllowOverride None】更改為【AllowOverride All】;3、重啟伺服器。

如何在centos下安裝apache

(推薦教學:apache從入門到精通

#具體方法如下:

1.安裝httpd

yum install httpd

安裝httpd時會自動安裝以下依賴套件:

如何在centos下安裝apache

選擇y及安裝已下載好的安裝套件。

2、設定

開啟設定文件,把裡面的AllowOverride None 全部修改為AllowOverride All

vi httpd.conf

順便在DirectoryIndex index.html 後面加上index.htm index. php index.shtml

:wq 保存退出

3、重啟伺服器

service httpd restart
systemctl start httpd.service #启动apache
systemctl stop httpd.service #停止apache
systemctl restart httpd.service #重启apache
systemctl enable httpd.service #设置apache开机启动

4測試

在瀏覽器中輸入對應網址,出現如下介面則表示配置成功了。

如何在centos下安裝apache

以上是如何在centos下安裝apache的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述:
本文轉載於:csdn.net。如有侵權,請聯絡admin@php.cn刪除