Centos7安装配置Apache服务

准备工作:

1、  备份当前状态

2、  知道Centos7的IP地址

1、安装软件包/查看是否安装软件包

yum install httpd -y 安装软件

rpm -qa httpd 检测系统是否安装

aec5b3cf268d4b368166f60c9ca3ffbf.png

2、cp一份,vim进入编辑

cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.bak

vim /etc/httpd/conf/httpd.conf

d4a7d18083e44b77901b440910964ec7.png

 3、编辑末行模式set nu 查看行号,修改

30271bbe25344040b443a2482a444227.png

 dc946330b730451483be24388c713e36.png

 大概119行图片方框的三个修改成图片一样的

4、创建www目录,在www目录下建立网页文件index.html,写入东西去index.html

mkdir /www 创建www目录

touch index.html 网页文件

echo "Hello World" > index.html 把hello world写入index.html里面///也可以vim编辑

89daf625d55f41ab8b4963b46bc5187e.png

 5、start/开启服务,restart/重启服务,关闭防火墙,将Selinux设置成允许Permissive

2c0960e1d47f4f59bfefc037c9112d12.png

 6、网页搜索cetos7的ip查看Centos7安装配置Apache服务

76f36ee9eee149969eba26ca219ca83c.png

猜你喜欢

转载自blog.csdn.net/m0_63704136/article/details/128601929
今日推荐