CentOS7安装配置Apache

 时间:2026-04-22 02:10:25

1、yum install httpd

CentOS7安装配置Apache

2、安装httpd会自动安装一下依赖包:

这是要下载的依赖包

CentOS7安装配置Apache

3、选择y及安装已下载好的安装包。安装大概需要30秒左右。

CentOS7安装配置Apache

4、配置

进入配置界面vi httpd.conf

把里面的 AllowOverride None 全部修改为 AllowOverride All

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

这个是配置默认首页的

:wq 保存退出 service httpd restart 重启 apache 服务,再访问一下。果然可以访问了。

CentOS7安装配置Apache

5、重启服务器

CentOS7安装配置Apache

6、systemctl start httpd.service #启动apache

systemctl stop httpd.service #停止apache

systemctl restart httpd.service #重启apache

systemctl enable httpd.service #设置apache开机启动

7、测试。在浏览器中输入相应网址。

CentOS7安装配置Apache

  • Windows Server 2008 R2如何安装SAN存储管理器
  • sql查询分析器怎么设置显示行号
  • Server 2016如何通过命令添加Flash Player
  • linux系统下各应用的版本号查询
  • Windows Server 2012如何从Starter GPO新建GPO
  • 热门搜索
    笑点低是什么意思 当特种兵有什么要求 有什么好看的小说玄幻 良药苦口利于病忠言逆耳利于行的意思 回眸一笑的意思 毕业礼物送什么给闺蜜 怅然若失的意思 拜年的祝福语 鸿鹄的意思 什么页游好玩