安装Apache服务器

1、安装Apache服务器,并配置访问端口为9999
[root@bogon ~]# yum install httpd -y(安装apache,注意要联网)
[root@bogon ~]# yum install httpd-manual
[ root@bogon ~]# systemctl start httpd
[root@bogon ~]# systemctl enable httpd
[rootalocalhost ~]# rpm -ga lgrep httpd(查看安装是否完成)
[root@localhost ~]# firewall-cmd --list-all (列出防火墙信息)
[root@localhost ~]# firewall-cmd --permanent --add-service=http success(永久允许http)
[root@localhost ~1# firewall-cmd --reload (重新加载策略)
rootalocalhost ~]# cd /etc/httpd/conf
[rootalocalhost conf]# ls 
httpd.conf   magic
[root@localhost conf]# vim httpd.conf
进入后将端口改为9999,并保存退出

[root@localhost conf]# firewall-cmd --permanent add-port=9999/tcp (端口加入防火墙)
[rootalocalhost conf]# firewall-cmd --reload 
[rootalocalhost conf]# firewall-cmd --list-all
[rootalocalhost conf]# systemctl restart httpd(重启httpd重启后进入浏览器输入192.168.182.131:5555
[root@localhost ~]# cd /var/www/net/160
[root@localhost net]# cd 160
[root@localhost 160]# ls
index.html
[root@localhost 160]# cd /etc/httpd/conf
[root@localhost conf]# ls
httpd.conf  magic
[root@localhost conf]# vim httpd.conf 进入后将index.html改为sorry.html

[root@localhost conf]# setenforce 0
[root@localhost conf]# systemctl restart httpd

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值