入门:如何搭建一个简单的静态网站,apache服务器,https,SSL(TLS)握手过程和发送包的内容

目录

1.安装httpd,并将访问apache服务器的首页修改为hello.html, 且内容为: "My Home Page is hello"

2.虚拟主机:虚拟两台主机ip为100,200, 对应访问目录:/www/ip/100, /www/ip/200并创建首页文件index.html 

3.配置不同端口的虚拟主机访问apache服务器


1.安装httpd,并将访问apache服务器的首页修改为hello.html, 且内容为: "My Home Page is hello"

我们定义的静态页面在/var/www/html目录中,静态网页的名字必须是index.html,这个文件存放在/var/www/html目录下,在访问页面时默认打开这个目录中的index.html文件。

[root@localhost ~]# yum install httpd -y

[root@localhost ~]# systemctl status firewalld       #查看防火墙状态
[root@localhostr ~]# systemctl stop firewalld         # 关闭防火墙

[root@localhost conf]# cd /var/www/html

[root@localhost html]# vim hello.html 

 [root@localhost html]# systemctl restart httpd

我们还得将首页文件名改为index.html,然后重启httpd服务,就可以在服务器中访问到了。

[root@localhost conf]# cd /var/www/html
[root@localhost html]# mv hello.html index.html
[root@localhost html]# systemctl restart httpd

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值