1.首先准备:
一个公网ip,一台云服务器
2.用ssh连接云服务器
3.rm -rf /etc/yum.repos.d/*.repo 清除损坏的repo包
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.myhuaweicloud.com/repo/CentOS-Base-7.repo 下载华为的yum
yum clean all 清除缓存
yum makecache 重新生成
4.yum -y install httpd 下载
systemctl start httpd 开启
systemctl enable httpd 开机自启
5.在华为云上给主机绑定公网ip
6.cd /var/www/html/进入跟目录
写html文件
登录页面文件
<include file="public@header"/>
</head>
<body>
<div class="wrap js-check-wrap">用户/账号名字:<input id="name" type="text"name="name"value="" placeholder="请输入用户名"><input id="password" type="text"name="password"value="" placeholder="请输入密码"><input type="submit" id="sub" class="btn btn-primary" value="登录"/></div>
<script type="text/javascript" src="jquery.min.js"></script>
<script>$("#sub").click(function(){var name = $('#name').val();var password = $('#password').val();$(location).attr('href', 'b.html?name='+name+'&password='+password);})</script>
</body>
</html>
编写二跳网页文件,因为上一个html指定登录后跳到b.html。
所以我们要写个b.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>书籍之家</title>
</head>
<body>
<p>渣反番外
<a href="/haha1.html"><img src="haha1.png" border="0" width="150" height="200"> </a>
<a href="/haha1.html" target="_blank" rel="noopener noreferrer">点击跳转</a>
</body>
</html>
这里haha1.html是指定点击超链接或者图片超链接进入的网页
图片你可以放在服务器的/var/www/html/下
剩下的指定的网页你可以自己写
看看效果
网上上找的话----ip/文件所在目录/index.html 如192.168.1.21/jq/index.html
可以看到已经成功了,是不是非常简单