.
3ss.cn

怎么在centos下安装apache

在centos下安装apache的方法是:1、执行【yum install httpd】命令安装httpd;2、打开配置文件,将【AllowOverride None】更改为【AllowOverride All】;3、重启服务器。

(推荐教程:apache从入门到精通)

具体方法如下:

1、安装httpd

yum install httpd

安装httpd时会自动安装以下依赖包:

选择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测试

在浏览器中输入相应网址,出现如下界面则表示配置成功了。

赞(0)
未经允许不得转载:互联学术 » 怎么在centos下安装apache

评论 抢沙发