在centos下安装apache的方法是:1、执行【yum install httpd】命令安装httpd;2、打开配置文件,将【AllowOverride None】更改为【AllowOverride All】;3、重启服务器。
(推荐教程:
apache从入门到精通
)
具体方法如下:
1、安装httpd
安装httpd时会自动安装以下依赖包:
选择y及安装已下载好的安装包。
2、配置
打开配置文件,把里面的 AllowOverride None 全部修改为 AllowOverride All
Apache 2.4.62
PHP中文网提供Apache 2.4.62 官方 tar.gz 源码包下载,通过源码编译安装,开发者能够灵活定制模块、优化性能并精准控制安装路径,满足多样化的业务需求。
下载
顺便在 DirectoryIndex index.html 后面加上 index.htm index.php index.shtml
:wq 保存退出
3、重启服务器
4测试
在浏览器中输入相应网址,出现如下界面则表示配置成功了。
yum install httpdvi httpd.confservice httpd restartsystemctl start httpd.service #启动apache
systemctl stop httpd.service #停止apache
systemctl restart httpd.service #重启apache
systemctl enable httpd.service #设置apache开机启动