在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测试
在浏览器中输入相应网址,出现如下界面则表示配置成功了。
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号