关键词“ECS”获取教程资料!
9.5元学生服务器购买地址:
本小节的主要内容:在阿里云服务器中,安装部署Apache环境。
ssh root@(ip)
<v:shapetype id="_x0000_t75" coordsize="21600,21600" o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f"><v:stroke joinstyle="miter"><v:formulas></v:formulas><v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"></v:path></v:stroke></v:shapetype><v:shape id="图片_x0020_8" o:spid="_x0000_i1047" type="#_x0000_t75" alt="https://edu.aliyun.com/lab/files/courses/129136057c2a4d50af22490b5ce8f878/sections/ba70fc3a856948459ee8792994f23447/content/images/course-129136057c2a4d50af22490b5ce8f878-section-ba70fc3a856948459ee8792994f23447-content-image-1492759584987-vz3Qss" style="width:429pt;height:76pt;visibility:visible;mso-wrap-style:square"><v:imagedata src="file:///C:/Users/XS/AppData/Local/Temp/msohtmlclip1/01/clip_image001.png" o:title="course-129136057c2a4d50af22490b5ce8f878-section-ba70fc3a856948459ee8792994f23447-content-image-1492759584987-vz3Qss"></v:imagedata></v:shape>
2. 执行如下命令,使用yum方式,下载并安装Apache。
yum -y install httpd
<v:shape id="图片_x0020_7" o:spid="_x0000_i1046" type="#_x0000_t75" alt="https://edu.aliyun.com/lab/files/courses/129136057c2a4d50af22490b5ce8f878/sections/ba70fc3a856948459ee8792994f23447/content/images/course-129136057c2a4d50af22490b5ce8f878-section-ba70fc3a856948459ee8792994f23447-content-image-1492759770031-nzd21n" style="width:617.5pt;height:141.5pt;visibility:visible;mso-wrap-style:square"><v:imagedata src="file:///C:/Users/XS/AppData/Local/Temp/msohtmlclip1/01/clip_image002.png" o:title="course-129136057c2a4d50af22490b5ce8f878-section-ba70fc3a856948459ee8792994f23447-content-image-1492759770031-nzd21n"></v:imagedata></v:shape>
等待一段时间后,页面显示 Complete****!证明Apache环境安装完成。
<v:shape id="图片_x0020_6" o:spid="_x0000_i1045" type="#_x0000_t75" alt="https://edu.aliyun.com/lab/files/courses/129136057c2a4d50af22490b5ce8f878/sections/ba70fc3a856948459ee8792994f23447/content/images/course-129136057c2a4d50af22490b5ce8f878-section-ba70fc3a856948459ee8792994f23447-content-image-1492759842255-UbBz2m" style="width:621pt;height:93.5pt;visibility:visible;mso-wrap-style:square"><v:imagedata src="file:///C:/Users/XS/AppData/Local/Temp/msohtmlclip1/01/clip_image003.png" o:title="course-129136057c2a4d50af22490b5ce8f878-section-ba70fc3a856948459ee8792994f23447-content-image-1492759842255-UbBz2m"></v:imagedata></v:shape>
3. 执行如下命令,添加一个Linux用户 **siteadmin **并指定新增用户的远程登录默认访问路径为 /var/www/html****,忽略警告信息即可。
adduser -d /var/www/html siteadmin
<v:shape id="图片_x0020_5" o:spid="_x0000_i1044" type="#_x0000_t75" alt="https://edu.aliyun.com/lab/files/courses/129136057c2a4d50af22490b5ce8f878/sections/ba70fc3a856948459ee8792994f23447/content/images/course-129136057c2a4d50af22490b5ce8f878-section-ba70fc3a856948459ee8792994f23447-content-image-1492760211907-MAUpC2" style="width:507pt;height:36.5pt;visibility:visible;mso-wrap-style:square"><v:imagedata src="file:///C:/Users/XS/AppData/Local/Temp/msohtmlclip1/01/clip_image004.png" o:title="course-129136057c2a4d50af22490b5ce8f878-section-ba70fc3a856948459ee8792994f23447-content-image-1492760211907-MAUpC2"></v:imagedata></v:shape>
4. 执行如下命令,设置新建用户 **siteadmin **的登录密码:
passwd siteadmin
自定义登录密码,例如:Zhuyun123!
<v:shape id="图片_x0020_4" o:spid="_x0000_i1043" type="#_x0000_t75" alt="https://edu.aliyun.com/lab/files/courses/129136057c2a4d50af22490b5ce8f878/sections/ba70fc3a856948459ee8792994f23447/content/images/course-129136057c2a4d50af22490b5ce8f878-section-ba70fc3a856948459ee8792994f23447-content-image-1492764212954-tkaMKo" style="width:270.5pt;height:66.5pt;visibility:visible;mso-wrap-style:square"><v:imagedata src="file:///C:/Users/XS/AppData/Local/Temp/msohtmlclip1/01/clip_image005.png" o:title="course-129136057c2a4d50af22490b5ce8f878-section-ba70fc3a856948459ee8792994f23447-content-image-1492764212954-tkaMKo"></v:imagedata></v:shape>
5. 执行如下命令,授予 **siteadmin **用户权限:
chown -Rf siteadmin.siteadmin /var/www/html
其中代码:siteadmin.<自定义用户密码>
<v:shape id="图片_x0020_3" o:spid="_x0000_i1042" type="#_x0000_t75" alt="https://edu.aliyun.com/lab/files/courses/129136057c2a4d50af22490b5ce8f878/sections/ba70fc3a856948459ee8792994f23447/content/images/course-129136057c2a4d50af22490b5ce8f878-section-ba70fc3a856948459ee8792994f23447-content-image-1492760429820-G8ItrA" style="width:427pt;height:25pt;visibility:visible;mso-wrap-style:square"><v:imagedata src="file:///C:/Users/XS/AppData/Local/Temp/msohtmlclip1/01/clip_image006.png" o:title="course-129136057c2a4d50af22490b5ce8f878-section-ba70fc3a856948459ee8792994f23447-content-image-1492760429820-G8ItrA"></v:imagedata></v:shape>
6. 执行如下命令,启动Apache服务:
service httpd start
<v:shape id="图片_x0020_2" o:spid="_x0000_i1041" type="#_x0000_t75" alt="https://edu.aliyun.com/lab/files/courses/129136057c2a4d50af22490b5ce8f878/sections/ba70fc3a856948459ee8792994f23447/content/images/course-129136057c2a4d50af22490b5ce8f878-section-ba70fc3a856948459ee8792994f23447-content-image-1492760520387-4BqM6E" style="width:381pt;height:57.5pt;visibility:visible;mso-wrap-style:square"><v:imagedata src="file:///C:/Users/XS/AppData/Local/Temp/msohtmlclip1/01/clip_image007.png" o:title="course-129136057c2a4d50af22490b5ce8f878-section-ba70fc3a856948459ee8792994f23447-content-image-1492760520387-4BqM6E"></v:imagedata></v:shape>
7. 本地打开浏览器,并输入实验资源中提供的 Linux****服务器的**公网****IP **。若页面显示 Apache 2 Test Page****,则证明Apache已部署成功。
<v:shape id="图片_x0020_1" o:spid="_x0000_i1040" type="#_x0000_t75" alt="https://edu.aliyun.com/lab/files/courses/129136057c2a4d50af22490b5ce8f878/sections/ba70fc3a856948459ee8792994f23447/content/images/course-129136057c2a4d50af22490b5ce8f878-section-ba70fc3a856948459ee8792994f23447-content-image-1492760637682-xLHx0K" style="width:1083pt;height:544pt;visibility:visible;mso-wrap-style:square"><v:imagedata src="file:///C:/Users/XS/AppData/Local/Temp/msohtmlclip1/01/clip_image008.png" o:title="course-129136057c2a4d50af22490b5ce8f878-section-ba70fc3a856948459ee8792994f23447-content-image-1492760637682-xLHx0K"></v:imagedata></v:shape>
1.3 使用FileZilla上传本地站点文件(Mac系统)
本小节主要内容:Mac用户使用FileZilla做SFTP连接ECS(SSL加密协议,保证传输通道安全),并上传本地站点文件。
说明:若用户本地系统为****Windows****,则请忽略本小节的内容,直接进入下一小节。
1. 请通过如下步骤,下载并安装 FileZilla****软件。
2)解压已下载的 **FileZilla_3.25.2_macosx-x86.app.tar.bz2 **文件到当前或其他路径中。
3)此时,在FileZilla的解压路径中,双击并打开 **FileZilla **软件。
<v:shape id="图片_x0020_16" o:spid="_x0000_i1039" type="#_x0000_t75" alt="https://edu.aliyun.com/lab/files/courses/129136057c2a4d50af22490b5ce8f878/sections/eabc66a10c91439faaf2e608bdadda59/content/images/course-129136057c2a4d50af22490b5ce8f878-section-eabc66a10c91439faaf2e608bdadda59-content-image-1492762286399-atHlh0" style="width:352.5pt;height:108.5pt;visibility:visible;mso-wrap-style:square"><v:imagedata src="file:///C:/Users/XS/AppData/Local/Temp/msohtmlclip1/01/clip_image009.png" o:title="course-129136057c2a4d50af22490b5ce8f878-section-eabc66a10c91439faaf2e608bdadda59-content-image-1492762286399-atHlh0"></v:imagedata></v:shape>
弹出FileZilla操作界面。
<v:shape id="图片_x0020_15" o:spid="_x0000_i1038" type="#_x0000_t75" alt="https://edu.aliyun.com/lab/files/courses/129136057c2a4d50af22490b5ce8f878/sections/eabc66a10c91439faaf2e608bdadda59/content/images/course-129136057c2a4d50af22490b5ce8f878-section-eabc66a10c91439faaf2e608bdadda59-content-image-1492762572686-tJXwb8" style="width:802pt;height:563.5pt;visibility:visible;mso-wrap-style:square"><v:imagedata src="file:///C:/Users/XS/AppData/Local/Temp/msohtmlclip1/01/clip_image010.png" o:title="course-129136057c2a4d50af22490b5ce8f878-section-eabc66a10c91439faaf2e608bdadda59-content-image-1492762572686-tJXwb8"></v:imagedata></v:shape>
2. 通过如下操作,连接到ECS服务器。
1)输入如下信息,并点击 快速连接,连接到ECS服务器。
· 主机:输入本实验资源中分配的ECS Linux****服务器 的 公网****IP****;
· 用户名:输入ECS服务器中新建用户 siteadmin****;
· 密码:输入 siteadmin 用户的自定义登录密码,例如:Zhuyun123!****;
· 端口:输入22 ;
<v:shape id="图片_x0020_14" o:spid="_x0000_i1037" type="#_x0000_t75" alt="https://edu.aliyun.com/lab/files/courses/129136057c2a4d50af22490b5ce8f878/sections/eabc66a10c91439faaf2e608bdadda59/content/images/course-129136057c2a4d50af22490b5ce8f878-section-eabc66a10c91439faaf2e608bdadda59-content-image-1493088815074-LcxU0K" style="width:799pt;height:144.5pt;visibility:visible;mso-wrap-style:square"><v:imagedata src="file:///C:/Users/XS/AppData/Local/Temp/msohtmlclip1/01/clip_image011.png" o:title="course-129136057c2a4d50af22490b5ce8f878-section-eabc66a10c91439faaf2e608bdadda59-content-image-1493088815074-LcxU0K"></v:imagedata></v:shape>
2)弹出记住密码对话框,选择 不要保存密码,完成后,点击 确定****。
<v:shape id="图片_x0020_13" o:spid="_x0000_i1036" type="#_x0000_t75" alt="https://edu.aliyun.com/lab/files/courses/129136057c2a4d50af22490b5ce8f878/sections/eabc66a10c91439faaf2e608bdadda59/content/images/course-129136057c2a4d50af22490b5ce8f878-section-eabc66a10c91439faaf2e608bdadda59-content-image-1492764542241-kuLrdP" style="width:244.5pt;height:141.5pt;visibility:visible;mso-wrap-style:square"><v:imagedata src="file:///C:/Users/XS/AppData/Local/Temp/msohtmlclip1/01/clip_image012.png" o:title="course-129136057c2a4d50af22490b5ce8f878-section-eabc66a10c91439faaf2e608bdadda59-content-image-1492764542241-kuLrdP"></v:imagedata></v:shape>
3)弹出 是否信任主机的提示,点击 确定****。
<v:shape id="图片_x0020_12" o:spid="_x0000_i1035" type="#_x0000_t75" alt="https://edu.aliyun.com/lab/files/courses/129136057c2a4d50af22490b5ce8f878/sections/eabc66a10c91439faaf2e608bdadda59/content/images/course-129136057c2a4d50af22490b5ce8f878-section-eabc66a10c91439faaf2e608bdadda59-content-image-1492764599960-wFeBS6" style="width:451.5pt;height:205pt;visibility:visible;mso-wrap-style:square"><v:imagedata src="file:///C:/Users/XS/AppData/Local/Temp/msohtmlclip1/01/clip_image013.png" o:title="course-129136057c2a4d50af22490b5ce8f878-section-eabc66a10c91439faaf2e608bdadda59-content-image-1492764599960-wFeBS6"></v:imagedata></v:shape>
4)此时,右侧页面显示ECS的访问路径 /var/www/html****,且当前路径下无文件。
<v:shape id="图片_x0020_11" o:spid="_x0000_i1034" type="#_x0000_t75" alt="https://edu.aliyun.com/lab/files/courses/129136057c2a4d50af22490b5ce8f878/sections/eabc66a10c91439faaf2e608bdadda59/content/images/course-129136057c2a4d50af22490b5ce8f878-section-eabc66a10c91439faaf2e608bdadda59-content-image-1492764832096-JTQaDN" style="width:801pt;height:408.5pt;visibility:visible;mso-wrap-style:square"><v:imagedata src="file:///C:/Users/XS/AppData/Local/Temp/msohtmlclip1/01/clip_image014.png" o:title="course-129136057c2a4d50af22490b5ce8f878-section-eabc66a10c91439faaf2e608bdadda59-content-image-1492764832096-JTQaDN"></v:imagedata></v:shape>
3. 通过如下步骤,将本地的站点文件上传到ECS服务器中。
1)点击手册左侧的 附件下载,下载并保存 **web-demo.zip **示例站点到本地。
2)解压 **web-demo.zip **到当前目录。
3)选中解压后的 **web-demo 文件夹中的 所有文件,并拖拽文件到ECS的 /var/www/html **路径的 空目录列表 处。
<v:shape id="图片_x0020_10" o:spid="_x0000_i1033" type="#_x0000_t75" alt="https://edu.aliyun.com/lab/files/courses/129136057c2a4d50af22490b5ce8f878/sections/eabc66a10c91439faaf2e608bdadda59/content/images/course-129136057c2a4d50af22490b5ce8f878-section-eabc66a10c91439faaf2e608bdadda59-content-image-1493089846596-G3cfR4" style="width:928pt;height:523.5pt;visibility:visible;mso-wrap-style:square"><v:imagedata src="file:///C:/Users/XS/AppData/Local/Temp/msohtmlclip1/01/clip_image015.png" o:title="course-129136057c2a4d50af22490b5ce8f878-section-eabc66a10c91439faaf2e608bdadda59-content-image-1493089846596-G3cfR4"></v:imagedata></v:shape>
4)完成后,在浏览器中,再次访问ECS服务器的 **公网****IP **,或者刷新已访问ECS服务器的 公网****IP 页面。此时,将从Apache的测试页面变为 **LAB ROOM **的示例网站。
<v:shape id="图片_x0020_9" o:spid="_x0000_i1032" type="#_x0000_t75" alt="https://edu.aliyun.com/lab/files/courses/129136057c2a4d50af22490b5ce8f878/sections/eabc66a10c91439faaf2e608bdadda59/content/images/course-129136057c2a4d50af22490b5ce8f878-section-eabc66a10c91439faaf2e608bdadda59-content-image-1493086386934-I0FMQZ" style="width:15in;height:498pt;visibility:visible;mso-wrap-style:square"><v:imagedata src="file:///C:/Users/XS/AppData/Local/Temp/msohtmlclip1/01/clip_image016.png" o:title="course-129136057c2a4d50af22490b5ce8f878-section-eabc66a10c91439faaf2e608bdadda59-content-image-1493086386934-I0FMQZ"></v:imagedata></v:shape>
1.4 使用FileZilla上传本地站点文件(Windows系统)
本小节主要内容:Windows用户使用FileZilla做SFTP连接ECS(SSL加密协议,保证传输通道安全),并上传本地站点文件。
说明:若用户本地系统为Mac,则请忽略本小节的内容,直接进入下一小节。
1. 请通过如下步骤,下载并安装 FileZilla****软件。
2)解压已下载的 **Filezilla_for_win64.zip **文件到当前或其他路径中。
4)此时,在FileZilla的解压路径中,双击并打开FileZilla软件。
<v:shape id="图片_x0020_23" o:spid="_x0000_i1031" type="#_x0000_t75" alt="屏幕快照 2017-09-27 上午12.01.28.png" style="width:635pt;height:209.5pt;visibility:visible;mso-wrap-style:square"><v:imagedata src="file:///C:/Users/XS/AppData/Local/Temp/msohtmlclip1/01/clip_image017.png" o:title="屏幕快照 2017-09-27 上午12.01.28"></v:imagedata></v:shape>
弹出的FileZilla操作界面如下所示:
<v:shape id="图片_x0020_22" o:spid="_x0000_i1030" type="#_x0000_t75" alt="https://edu.aliyun.com/lab/files/courses/129136057c2a4d50af22490b5ce8f878/sections/2d318b95ee774a99ace71bbdcc6db16e/content/images/course-129136057c2a4d50af22490b5ce8f878-section-2d318b95ee774a99ace71bbdcc6db16e-content-image-1493088598826-DM8hUV" style="width:673pt;height:562.5pt;visibility:visible;mso-wrap-style:square"><v:imagedata src="file:///C:/Users/XS/AppData/Local/Temp/msohtmlclip1/01/clip_image018.png" o:title="course-129136057c2a4d50af22490b5ce8f878-section-2d318b95ee774a99ace71bbdcc6db16e-content-image-1493088598826-DM8hUV"></v:imagedata></v:shape>
2. 通过如下操作,连接到ECS服务器。
1)输入如下信息,并点击 快速连接,连接到ECS服务器。
· 主机:输入本实验资源中分配的ECS** Linux****服务器 **的 公网IP;
· 用户名:输入ECS服务器中新建用户** siteadmin**;
· 密码:输入** siteadmin 用户的自定义登录密码,例如:Zhuyun123! **;
· 端口:输入** 22** ;
<v:shape id="图片_x0020_21" o:spid="_x0000_i1029" type="#_x0000_t75" alt="https://edu.aliyun.com/lab/files/courses/129136057c2a4d50af22490b5ce8f878/sections/2d318b95ee774a99ace71bbdcc6db16e/content/images/course-129136057c2a4d50af22490b5ce8f878-section-2d318b95ee774a99ace71bbdcc6db16e-content-image-1493089718404-nwrCIB" style="width:673.5pt;height:160pt;visibility:visible;mso-wrap-style:square"><v:imagedata src="file:///C:/Users/XS/AppData/Local/Temp/msohtmlclip1/01/clip_image019.png" o:title="course-129136057c2a4d50af22490b5ce8f878-section-2d318b95ee774a99ace71bbdcc6db16e-content-image-1493089718404-nwrCIB"></v:imagedata></v:shape>
2)页面弹出 **是否信任主机 **提示。点击 **确定 **。
<v:shape id="图片_x0020_20" o:spid="_x0000_i1028" type="#_x0000_t75" alt="https://edu.aliyun.com/lab/files/courses/129136057c2a4d50af22490b5ce8f878/sections/2d318b95ee774a99ace71bbdcc6db16e/content/images/course-129136057c2a4d50af22490b5ce8f878-section-2d318b95ee774a99ace71bbdcc6db16e-content-image-1493089736124-ZPMhSQ" style="width:350.5pt;height:180pt;visibility:visible;mso-wrap-style:square"><v:imagedata src="file:///C:/Users/XS/AppData/Local/Temp/msohtmlclip1/01/clip_image020.png" o:title="course-129136057c2a4d50af22490b5ce8f878-section-2d318b95ee774a99ace71bbdcc6db16e-content-image-1493089736124-ZPMhSQ"></v:imagedata></v:shape>
3)此时,页面右侧部分显示ECS的访问路径 /var/www/html****,且当前路径下无文件。
<v:shape id="图片_x0020_19" o:spid="_x0000_i1027" type="#_x0000_t75" alt="https://edu.aliyun.com/lab/files/courses/129136057c2a4d50af22490b5ce8f878/sections/2d318b95ee774a99ace71bbdcc6db16e/content/images/course-129136057c2a4d50af22490b5ce8f878-section-2d318b95ee774a99ace71bbdcc6db16e-content-image-1493089013768-T7b6So" style="width:671.5pt;height:437pt;visibility:visible;mso-wrap-style:square"><v:imagedata src="file:///C:/Users/XS/AppData/Local/Temp/msohtmlclip1/01/clip_image021.png" o:title="course-129136057c2a4d50af22490b5ce8f878-section-2d318b95ee774a99ace71bbdcc6db16e-content-image-1493089013768-T7b6So"></v:imagedata></v:shape>
3. 通过如下步骤,将本地的站点文件上传到ECS服务器中。
1)点击手册左侧的 **附件下载 **,下载并保存 **web-demo.zip **示例站点到本地。
2)解压 **web-demo.zip **到当前或其他目录中。
3)选中解压后的 **web-demo 文件夹中的所有文件,并拖拽文件到ECS的 /var/www/html **路径的 **空目录列表 **中。
<v:shape id="图片_x0020_18" o:spid="_x0000_i1026" type="#_x0000_t75" alt="https://edu.aliyun.com/lab/files/courses/129136057c2a4d50af22490b5ce8f878/sections/2d318b95ee774a99ace71bbdcc6db16e/content/images/course-129136057c2a4d50af22490b5ce8f878-section-2d318b95ee774a99ace71bbdcc6db16e-content-image-1493089615797-OZmz6n" style="width:943pt;height:484pt;visibility:visible;mso-wrap-style:square"><v:imagedata src="file:///C:/Users/XS/AppData/Local/Temp/msohtmlclip1/01/clip_image022.png" o:title="course-129136057c2a4d50af22490b5ce8f878-section-2d318b95ee774a99ace71bbdcc6db16e-content-image-1493089615797-OZmz6n"></v:imagedata></v:shape>
4)完成后,在浏览器中,再次访问ECS服务器的 公网IP,或者刷新已访问ECS服务器的 **公网IP **页面。此时,将从Apache的测试页面变为 **LAB ROOM **的示例网站。
<v:shape id="图片_x0020_17" o:spid="_x0000_i1025" type="#_x0000_t75" alt="https://edu.aliyun.com/lab/files/courses/129136057c2a4d50af22490b5ce8f878/sections/2d318b95ee774a99ace71bbdcc6db16e/content/images/course-129136057c2a4d50af22490b5ce8f878-section-2d318b95ee774a99ace71bbdcc6db16e-content-image-1493089698754-5SdBPb" style="width:15in;height:498pt;visibility:visible;mso-wrap-style:square"><v:imagedata src="file:///C:/Users/XS/AppData/Local/Temp/msohtmlclip1/01/clip_image016.png" o:title="course-129136057c2a4d50af22490b5ce8f878-section-2d318b95ee774a99ace71bbdcc6db16e-content-image-1493089698754-5SdBPb"></v:imagedata></v:shape>
原文链接:https://blog.csdn.net/qq_42076679/article/details/94922268