如何在centos下安裝apache

centos下安裝apache的方法是:1、執(zhí)行【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測試

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

如何在centos下安裝apache

以上就是如何在

? 版權聲明
THE END
喜歡就支持一下吧
點贊10 分享