如何在centos下安裝apache

centos下安裝apache的方法是:1、執(zhí)行【yum install httpd】命令安裝httpd;2、打開(kāi)配置文件,將【AllowOverride None】更改為【AllowOverride All】;3、重啟服務(wù)器。

如何在centos下安裝apache

(推薦教程:apache從入門(mén)到精通

具體方法如下:

1、安裝httpd

yum?install?httpd

安裝httpd時(shí)會(huì)自動(dòng)安裝以下依賴(lài)包:

如何在centos下安裝apache

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

2、配置

打開(kāi)配置文件,把里面的 AllowOverride None?全部修改為 AllowOverride All

vi?httpd.conf

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

:wq?保存退出

3、重啟服務(wù)器

service?httpd?restart
systemctl?start?httpd.service?#啟動(dòng)apache systemctl?stop?httpd.service?#停止apache systemctl?restart?httpd.service?#重啟apache systemctl?enable?httpd.service?#設(shè)置apache開(kāi)機(jī)啟動(dòng)

4測(cè)試

在瀏覽器中輸入相應(yīng)網(wǎng)址,出現(xiàn)如下界面則表示配置成功了。

如何在centos下安裝apache

以上就是如何在

? 版權(quán)聲明
THE END
喜歡就支持一下吧
點(diǎn)贊10 分享