-
Notifications
You must be signed in to change notification settings - Fork 35
/
ecs-online-education-video-course-sharing-website.yml
308 lines (291 loc) · 10.4 KB
/
ecs-online-education-video-course-sharing-website.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
ROSTemplateFormatVersion: '2015-09-01'
Description:
zh-cn: 该模板用于在指定Centos ECS实例上部署一个视频课程分享网站,配置安全组允许SSH(22)和HTTP(80)访问,自动安装Nginx并生成首页,嵌入OSS视频链接,提供外部访问URL。
en: This template is used to deploy a video course sharing website on a designated Centos ECS instance, configure the security group to allow SSH (22) and HTTP (80) access, automatically install Nginx and generate a homepage, embed OSS video links, and provide external access URLs.
Parameters:
InstanceId:
Type: String
Label:
en: ECS Instance ID
zh-cn: ECS实例ID
Description:
en: An ECS instance used to build a video course sharing website, Please select
the ECS instance of the Centos system.
zh-cn: 用于搭建视频课程分享网站的ECS实例, 请选择 Centos 系统的 ECS 实例。
AssociationProperty: ALIYUN::ECS::Instance::InstanceId
OssUrl:
Type: String
Label:
en: OSS URL
zh-cn: OSS URL
Description:
en: The video URL from the OSS console.
zh-cn: 从OSS控制台并获取到的视频URL。
Resources:
DS_Instances:
Type: DATASOURCE::ECS::Instances
Properties:
InstanceIds:
- Ref: InstanceId
SecurityGroupIngress_22:
Type: ALIYUN::ECS::SecurityGroupIngress
Properties:
SecurityGroupId:
Fn::Jq:
- First
- .[0].SecurityGroupIds[0]
- Fn::GetAtt:
- DS_Instances
- Instances
SourceCidrIp: 0.0.0.0/0
IpProtocol: tcp
NicType: intranet
PortRange: 22/22
SecurityGroupIngress_80:
Type: ALIYUN::ECS::SecurityGroupIngress
Properties:
SecurityGroupId:
Fn::Jq:
- First
- .[0].SecurityGroupIds[0]
- Fn::GetAtt:
- DS_Instances
- Instances
SourceCidrIp: 0.0.0.0/0
IpProtocol: tcp
NicType: intranet
PortRange: 80/80
InstallWebServer:
Type: ALIYUN::ECS::RunCommand
Properties:
InstanceIds:
- Ref: InstanceId
Type: RunShellScript
Sync: true
Timeout: 3600
CommandContent:
Fn::Sub: |-
#!/bin/bash
echo "#########################"
echo "# Install Nginx"
echo "#########################"
yum install -y nginx
cat > /usr/share/nginx/html/index.html << \EOF
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>在线教育</title>
<meta name="keywords" content="在线教育">
<meta name="description" content="在线教育">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<!--Favicon-->
<link rel="shortcut icon" href="" title="Favicon">
<style>
@media all and (orientation : portrait) {
/*竖屏*/
.mypic {
width: 80%;
}
}
@media all and (orientation : landscape) {
/*横屏*/
.mypic {
width: 40%;
}
}
a {
color: #000000;
}
a:link {
color: #000000;
}
a:visited {
color: #000000;
}
a:hover {
color: #000000;
}
a:active {
color: #000000;
}
</style>
</head>
<body style=" font-family: 'Microsoft JhengHei UI';">
<div id="wrapper" style=" margin: 0 15px; padding: 15px 0; position: relative;">
<div style="padding:20px;">
<p><font size="10" color="green">在线教育网</font></p>
<p><font size="3" >您贴身的教育管家</font></p>
</div>
<p style="text-align:center"><font size="6" color="green">您可在此获取到丰富的教学视频,充分满足学习要求</font></p>
<div style="padding:50px;">
<h1 style="text-align:center">精选课程</h1>
<p style="text-align:center">口碑好,效益佳</p>
<div>
<table style="float: center;">
<tbody>
<tr>
<td>
<b>
<center>
<div class="video">
<video width="320" height="240" controls>
<source src='${OssUrl}' type="video/mp4">
</video>
<p>实战视频1</p>
<p>您可以在此视频学习相关内容1</p>
</div>
</center>
</b>
</td>
<td>
<b></b>
<center><b>
<div class="video">
<video width="320" height="240" controls>
<source src="moive.mp4" type="video/mp4">
</video>
<p>实战视频2</p>
<p>您可以在此视频学习相关内容2</p>
</div>
</b></center>
</td>
<td>
<b>
<center>
<div class="video">
<video width="320" height="240" controls>
<source src="movie.mp4" type="video/mp4">
</video>
<p>实战视频3</p>
<p>您可以在此视频学习相关内容3</p>
</div>
</center>
</b>
</td>
<td>
<b>
<center>
<div class="video">
<video width="320" height="240" controls>
<source src="movie.mp4" type="video/mp4">
</video>
<p>实战视频4</p>
<p>您可以在此视频学习相关内容4</p>
</div>
</center>
</b>
</td>
</tr>
</tbody>
</table>
</div>
<h1 style="text-align:center">观看金牌讲师直播</h1>
<p style="text-align:center">所有导师来自名企,有多年教学经验</p>
<div>
<table style="float: center;">
<tbody>
<tr>
<td>
<b>
<center>
<div class="video">
<video width="320" height="240" controls>
<source src="movie.mp4" type="video/mp4">
</video>
<p>张佳佳</p>
<p>擅长教学产品知识</p>
</div>
</center>
</b>
</td>
<td>
<b></b>
<center><b>
<div class="video">
<video width="320" height="240" controls>
<source src="movie.mp4" type="video/mp4">
</video>
<p>李文</p>
<p>多年web开发经验</p>
</div>
</b></center>
</td>
<td>
<b>
<center>
<div class="video">
<video width="320" height="240" controls>
<source src="movie.mp4" type="video/mp4">
</video>
<p>王杰</p>
<p>专攻大数据计算</p>
</div>
</center>
</b>
</td>
<td>
<b>
<center>
<div class="video">
<video width="320" height="240" controls>
<source src="movie.mp4" type="video/mp4">
</video>
<p>刘子雯</p>
<p>运营专家</p>
</div>
</center>
</b>
</td>
</tr>
</tbody>
</table>
</div>
<p style=" margin: 0 auto; text-align: center; ">
<img class="mypic" src=""
style=" vertical-align: middle; text-align: center;">
</p>
<p>
更多:
<a style=" font-size:14px; font-family: 'Microsoft JhengHei UI'" href="aliyun.com"
target="_blank">aliyun.com</a>
</p>
<p>电话号码:xxxxx;</p>
</div>
</div>
<div style="text-align: center; margin: 0px; width: 100%; font-size: 14px; font-family: 'Microsoft JhengHei UI';">
@
<a href="https://beian.miit.gov.cn/" target="_blank" style="text-decoration:none">京ICP备15047403号-1</a>
</div>
</body>
</html>
EOF
cd /usr/sbin/
./nginx
DependsOn:
- SecurityGroupIngress_22
- SecurityGroupIngress_80
Outputs:
WebUrl:
Description:
en: Video sharing website page.
zh-cn: 视频分享网站页面。
Value:
Fn::Sub:
- http://${IP}
- IP:
Fn::Jq:
- First
- if .[0].PublicIpAddress != [] then .[0].PublicIpAddress[0] else .[0].EipAddress.IpAddress
end
- Fn::GetAtt:
- DS_Instances
- Instances
Metadata:
ALIYUN::ROS::Interface:
ParameterGroups:
- Parameters:
- InstanceId
- OssUrl
TemplateTags:
- acs:document:试用教程:搭建在线教育视频课程分享网站