“华为云:搭建网页服务器”的版本间的差异
(→上传文件) |
|||
第1行: | 第1行: | ||
− | == | + | ==远程登录服务器== |
使用CloudShell登录 | 使用CloudShell登录 | ||
− | [[ | + | 如果忘记密码,可以重置实例密码 |
+ | |||
+ | ===软件安装=== | ||
+ | |||
+ | 安装apache软件: | ||
+ | |||
+ | yum install httpd -y | ||
+ | |||
+ | 启动apache软件: | ||
+ | |||
+ | service httpd restart | ||
+ | |||
+ | ==安全设置== | ||
+ | ===关闭防护墙和Selinux=== | ||
+ | 在远程命令行终端中远程执行linux命令: | ||
+ | |||
+ | 关闭防火墙: | ||
+ | |||
+ | systemctl stop firewalld | ||
+ | |||
+ | 关闭selinux: | ||
+ | |||
+ | setenforce 0 | ||
+ | ===设置安全组=== | ||
+ | 点击本实例 | ||
+ | |||
+ | [[文件:cloud2020-1-7.png|600px]] | ||
+ | |||
+ | 进入本实例安全组 | ||
+ | |||
+ | [[文件:cloud2020-1-8.png|600px]] | ||
+ | |||
+ | [[文件:cloud2020-1-9.png|600px]] | ||
+ | |||
+ | 点击配置规则 | ||
+ | |||
+ | [[文件:cloud2020-1-10.png|600px]] | ||
+ | |||
+ | |||
+ | 右上角 添加安全组规则 | ||
+ | |||
+ | [[文件:cloud2020-1-11.png|600px]] | ||
+ | |||
+ | |||
+ | |||
+ | ===验证=== | ||
+ | 刚才我们安装了apache服务器, | ||
+ | |||
+ | 并关闭了防火墙,现在验证一下在公网上是否能够访问。 | ||
+ | |||
+ | 浏览器输入云主机 IP: | ||
+ | |||
+ | [[文件:cloud20101706.png|600px]] | ||
+ | |||
+ | 这个页面为apache默认页面。 | ||
+ | |||
+ | 我们可以上传自己的页面来替代这个页面。 | ||
+ | |||
==编写网页== | ==编写网页== |
2022年10月26日 (三) 22:54的版本
远程登录服务器
使用CloudShell登录
如果忘记密码,可以重置实例密码
软件安装
安装apache软件:
yum install httpd -y
启动apache软件:
service httpd restart
安全设置
关闭防护墙和Selinux
在远程命令行终端中远程执行linux命令:
关闭防火墙:
systemctl stop firewalld
关闭selinux:
setenforce 0
设置安全组
点击本实例
进入本实例安全组
点击配置规则
右上角 添加安全组规则
验证
刚才我们安装了apache服务器,
并关闭了防火墙,现在验证一下在公网上是否能够访问。
浏览器输入云主机 IP:
这个页面为apache默认页面。
我们可以上传自己的页面来替代这个页面。
编写网页
编程工具
这里我推荐微软家的 Visual Studio Code,和其他编辑器比中文系统默认安装好就是中文,而且功能丰富,是一个比较不错的代码编辑器。
下载地址:https://code.visualstudio.com/Download
网页编写
标题:https://www.runoob.com/html/html-headings.html
段落:https://www.runoob.com/html/html-paragraphs.html
链接:https://www.runoob.com/html/html-links.html
图像:https://www.runoob.com/html/html-images.html
表格:https://www.runoob.com/html/html-tables.html
上传文件
远程文件目录树 /var/www/html
https://edu.huaweicloud.com/certifications/2fa579f4a81d420a94ac6a7bd12fed08