手抄报 安全手抄报 手抄报内容 手抄报图片 英语手抄报 清明节手抄报 节约用水手抄报

CentOS7安装配置Apache

时间:2024-10-14 05:13:06

平时大家都是在Windows系统的电脑下部署网站。linux系统的电脑想必大家都很少使用吧。下面我来简单讲解下如何在linux系统的电脑下部署一个Apache服务器。

工具/原料

Apache安装包

Apache安装

1、yum install httpd

CentOS7安装配置Apache

2、安装httpd会自动安装一下依赖包:这是要下载的依赖包

CentOS7安装配置Apache

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

CentOS7安装配置Apache

4、配置进入配置界面vihttpd.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 http蟠校盯昂d.service #启动apachesystemctl stop httpd.service #停止apachesystemctl restart httpd.service #重启apachesystemctl enable httpd.service #设置apache开机启动

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

CentOS7安装配置Apache
© 手抄报圈