安装Apache服务器

安装Apache服务器之前的配置在DNS服务器配置实例里。

1.安装、启动与停止Apache服务

启动或重新启动、停止Apache服务的命令如下:

使用防火墙命令,放行http服务

更改当前的SELinux值,后面可以跟Enforcing、Permissive或者1、0。

[root@centos ~]# setenforce 0
[root@centos ~]# getenforce
Permissive

测试httpd服务是否安装成功,会跳出火狐浏览器

[root@centos ~]# systemctl start httpd
[root@centos ~]# systemctl enable httpd
Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.
[root@centos ~]# firefox http://127.0.0.1

当前网站普遍的首页面名称是index.html,因此可以向/var/www/html目录中写入一个文件,替换掉httpd服务程序的默认首页面,该操作会立即生效(在本机上测试)。

[root@centos ~]# echo "Welcome To MyWeb" > /var/www/html/index.html
[root@centos ~]# firefox http://127.0.0.1

 

在客户端上测试

  • 5
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值