Ubuntu16下HTTP服务器配置.docx

上传人:牧羊曲112 文档编号:4925593 上传时间:2023-05-23 格式:DOCX 页数:13 大小:446.96KB
返回 下载 相关 举报
Ubuntu16下HTTP服务器配置.docx_第1页
第1页 / 共13页
Ubuntu16下HTTP服务器配置.docx_第2页
第2页 / 共13页
Ubuntu16下HTTP服务器配置.docx_第3页
第3页 / 共13页
Ubuntu16下HTTP服务器配置.docx_第4页
第4页 / 共13页
Ubuntu16下HTTP服务器配置.docx_第5页
第5页 / 共13页
亲,该文档总共13页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述

《Ubuntu16下HTTP服务器配置.docx》由会员分享,可在线阅读,更多相关《Ubuntu16下HTTP服务器配置.docx(13页珍藏版)》请在三一办公上搜索。

1、计算机网络实验报告实验名称:http服务器的安装和配置学号、姓名:张焓实验 日期:2016-10-14 实验报告日期:2016-10-14实验地点:小组成员分工:一实验目的1、基础配置观察实验:用wireshark抓包分析2、Linux下完成HTTP服务器的安装和配置3、HTTP服务器测试二.实验环境1. 实验设备:软件:linux ubuntu, Windos, Wireshark;硬件:PC 1台2. 网络拓扑结构图如下:三 实验内容及步骤、实验的详细记录、实验结果分析(写出每个命令执行时,所显示的内容,实验中遇到的问题和思考。)1. 安装 apache2米用命令:sudo apt-get

2、 install apache2:Ubuntu 副本(备份 1)正在运行-Oracle VM VirtualBox管理控制视图热键设备帮助I* 食邕处 IS3 V) 10:46 4X 一匚1终端文件(F)编辑(E)查看(V)搜索(S)终端(T)帮助(H)hanQhan-VirtualBoxsudo apt-get install apache2 正在读取软件包列表.完成 正在分析软件包的依赖关系树 正在读取状态信息.完成将会同时安装下列软件:apache2-bin apache2-data apache2-utils libaprl libaprutilllibaprutill-dbd-sql

3、ite3 libaprutill-Idap libluaS.1-0建议安装:apache2-doc apache2-suexec-pristine I apacheZ-suexec-custom下狗【新】软件包将被安装:apache2 apacheZ-btn apache2-data apache2-uttls libaprl libaprutilllibaprutill-dbd-sqlite3 libaprutill-Idap ItbluaS.l-O升级了 0个软件包,券安装了 9个软件包,囊卸载0个软件包,有392个软件包未被升 级。需要下载537 kB的归档。解压缩后会掐耗6,350 k

4、B的额外空间。您希望继续执行吗? Y/n y获取:1 http:/cn. archive, ubuntu .con/ubuntu -3 86.0 kB获耳又:2 http:/cn.archive.ubuntu.con/ubuntu.5.4-lbuildl 77.1 kB获取:3 http:/ /cn.archive.ubuntu.con/ubuntuite3 and64 1.5.4-lbuildl 10.6 kB获取:4 http:/cn.archive.ubuntu.con/ubuntuxenial/matnxenial/mainxenial/matnxenial/matnamd64amd6

5、4amd64libaprl amd64 1.5.2amd64Ubuntu Kylinlibaprutill amd64 1libaprutiH-dbd-sqllibaprutill-Idap am在浏览器输入localhost查看是否成功安装Ubuntu 副本(备份 1)正在运行-Oracle VM VirtualBoxUbuntu systems. It is based on the equivalent page on Debian, from which the Ubuntu Apache packaging is derived. If you can read this page,

6、 it means that the Apache HTTP server installed at this site is working properly. You should replace this file (located at /va r/www/html/index. html) before continuing to operate your HTTP server.管理控制视图热键设备帮助J Apache2 | 127.0.0.1If you are a normal user of this web site and dont know what this page

7、 is about, this probably means that the site/etc/apache2/- apache2.confI .- ports.conf/- mods-enabledIQi Ql (g).园蓟部云三酱(3彩Right Ctrl2. 配置 apache2编辑 apache2.conf:sudo vi /etc/apache2/apache2.confUbuntu 副本(备份 1)正在运行-Oracle VM VirtualBox管理控制视图热键设备帮助I* 宜蜃画 V) 13:27 4X _ B 文件编辑查看历史书签工具帮助X _ I终端文件(F)编辑(E)查

8、看(V)搜索(S)终端(I)帮助(H)your system is serving content from a sub-directory in /srv you must allow access here, or in any related virtual host.irectory /Options FollowSymLinksAllowOverride NoneRequire all deniediry /usr/share AllowOverride None Require all grantediry /var/www/ tOptions Indexes FbllowSynL

9、tnksAllowOverride NoneRequire all granted:ory /srv/Options Indexes FollowSymLinks AllowOverride None151,175%删除原有的index.html,并创建一个新的index.htmlPS:这里可能需要重启一下 apache2 服务:sudo /etc/init.d/apache2 restartRequire all granted期 Ubuntu 副本(备份 1)正在运行-Oracle VM VirtualBox 管理控制视图热健设备帮助|X 一 口终端文件(F)编辑(E)查看(V)搜索(S)

10、终端(T)帮助(H)hanQhan-VirtualBoxvt /etc/apache2/apache2.confhanghan-VirtualBoxsudo rm /var/www/html/tndex.htnlsudo han 的密码:hanghan-VirtualBoxsu密码:rootghan-VirtualBox:/home/han# cd /var/www/htmlrootghan-VirtualBox:/var/www/html# echo this is a test web for zhindex.html rootghan-VirtualBox:/var/www/html#

11、|Ubuntu Kylin1。匚浏览器打开localhost变为:密 Ubuntu 副本(备份 1)正在运行-Oracle VM VirtualBox 管理控制视图热键设备帮助X _ 文件编辑查看历史书签工具帮助 邕 函!) 13:20 O4 localhostI C I 叵搜索旧 D 命this is a test web for zh 彳 fli IB Qi eRight Ctrl3. 由客户端虚拟机访问服务端虚拟机:重新打开一个能与当前作为服务器的虚拟机互相ping通的虚拟机作为客户端,在浏 览器输入服务器IP: 192.168.137.2(上为服务器虚拟机,下为客户端虚拟机,可能需要在

12、 服务器中重启一下dhcp服务)羽 Ubuntu 副本(备份 1)正在运行-OracleVMVirtualBox X管理控制视图热键设备帮助X _ 文件编辑查看历史书签工具帮助通邕 由) 13:21 OJhttp:/localhost/定 | localhost| |Q 搜索旧 D 命t转到二页 lZh右击或下拉显示历史景 Ubuntu 正在运行-Oracle VM Virtual Box 管理控制视图热键设备帮助X _ 文件编辑查看历史书签工具帮助http:/192.168.137.2/X6 192.168.137. h ttp:/192.168.137.2/ this is a test

13、web for zh4.nginx安装与配置安装:xenial-updates/matnxenial-updates/mainamd64 nginx-corexenial-updates/matnamd64 nginx all 1xenial-updates/matnUbuntu Kylin1386 nginx-common1386 nginx-common管理控制视图热键设备帮助配置文件,将端口号由80改为88:X: _ 终端文件(F)编辑(E)查看(V)搜索(S)终端(T)帮助(H)hanQhan-VirtualBox:$ sudo apt-get install nginx sudo h

14、an 的密码:隹在强取软件包列表.完成 正在分析软件包的依赖关系树 正在读取状态信息.完成|将会同时安装下列软件:nginx-common nginx-core建设安装:fcgiwrap nginx-doc下列【新】软奔包将被安装:nginx nginx-common ngtnx-core升缓了 0个软件包,新安装了 3个软件包,要卸载0个软件包,有392个软件包未被升 |虱需要下载457 kB的归档。解压缩后会消耗1,48。kB的额外空间。您希望继续执行吗? Y/n V忽略:1 http:/cn all 1.10.0-OubuntuO.16.04.2获取 amd64 1.10.0-Oubun

15、tu0.16.04.2 428 kB 获取:3 http:/cn.archive.ubuntu.con/ubuntu .10.0-Oubuntu0.16.O4.2 3,498 B获取:1 http: /cn .archive. ubuntu. com/ubuntuall 1.10.O-OubuntuO.16.04.2 25.6 kBlisten 88 listen :Default serverI defaultSSL configurationconfigurationdefault_server;:88 default_server;Generally, you will want to

16、move this file somewhere, and start with a clean file but keep this around for reference. Or just disable in sttes-enabled.Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.X _ 口终端文件(F)编辑(E)查看(V)搜索(S)终端(!)帮助(H)# # # #期 Ubuntu 副本(备份 1)正在运行-Oracle VM Virtual Box 管理控制视图热键设备帮助You

17、should look at the following URLs in order to grasp a solid understanding of Nginx configuration files in order to fully unleash the power of Nginx.http:/wiki.nginx.org/Pitfallshttp:/wiki.nginx.org/QuickStarthttp:/wiki.nginx.org/Configurationlisten 443 ssl default_server;listen :443 ssl default_serv

18、er;86L, 2074C4,1顶端关闭apache2服务,重启nginx服务,并测试:管理控制视图热键设备帮助X _ 终端文件(F)编辑(E)查看(V)搜索(S)终端(T)帮助(H)nstatzipsplitnsupdatezjsdecodentfsdecryptzlib-flatevi defaultvi defaultsudo /etc/init.d/nglnx restarthanhan-VirtualBox:/usr/bin$ cd /etc hanhan-VirtualBox:/etc$ cd nginx hanhan-VirtualBox:/etc/ngtnx$ cd sites

19、-avatlable hanhan-VirtualBox:/etc/ngtnx/sttes-available$ default hanhan-VirtualBox:/etc/nginx/sites-avatlable$ hanQhan-VirtualBox:/etc/nginx/sites-available$ hanhan-VirtualBox:/etc/ngtnx/sttes-available$vi defaultsudo vt defaultsudo /etc/init.d/nginx restart. Restarting nginx (via systemctl): ngtnx.

20、serviceJob for ngtnx.service fail ed because the control process exited with error code. See systemctl status ngi nx.service and Mjournalctl -xeM for details.hanhan-VirtualBox:/etc/ngtnx/sttes-available$ hanhan-VirtualBox:/etc/ngtnx/sttes-available$ hanQhan-VirtualBox:/etc/nginx/sites-available$ ok

21、Restarting nginx (via systemctl): nginx.service. hanQhan-VirtualBox:/etc/nginx/sites-available$ sudo /etc/init,d/apache2 stop ok Stopping apache2 (via systemctl): apache2sevtce. hanhan-VirtualBox:/etc/ngtnx/sttes-available$ sudo /etc/initd/ngtnx restart ok Restarting nginx (via systemctl): nginx.ser

22、vice.hanhan-VirtualBox:/etc/ngtnx/sttesavatlable$ 口X _ 文件编辑查看历史书签工具帮助,http:/localhost:88/。i | localhost:88this is a test web for zhEr r MBEIu1 fllL客户端测试:Ubuntu 副本(备份 1)正在运行-Oracle VM VirtualBox管理控制视图热键设备帮助X _ D 文件编辑查看历史书签工具帮助http:/localhost:88/xej |Q搜索产-、I localhost:88this is a test web for zhUbuntu

23、 正在运行-Oracle VM VirtualBox管理控制视图热键设备帮助X _ D 文件编辑查看历史书签工具帮助+http:/192.168.137.2/ Xc | |q搜索 | 192.168.137.2转到上一页右击或下拉显示历史,rzh5.HTTP协议在客户端打开wireshark,进行抓包分析;在此期间,在浏览器输入192.168.137.2 (服 务器IP地址),在wireshark中有如下结果: Hypertext Transfer Protocol HTTP/1.1 304 Not ModifiedrnF http:/192.168.137.2/No. TimeSourceD

24、estinationProtoc Length Info472 GET / HTTP/1.1246 HTTP/1.1 304 Not Modifie.472 GET / HTTP/1.1246 HTTP/1.1 304 Not Modifie.http表达式.+23 6.138872310192.168.137.10125 6139725364192.168.137.2131 82.598754807 192.168.137.101133 82.599286821 192.168.137.2192.168.137.2192.168.137.101192.168.137.2192.168.137

25、.101HTTPHTTPHTTPHTTPDate: Fri, 14 Oct 2016 05:52:02 GMTrnIa-53ecccbc79b20rnresponse 1/1since request: 0.000853054 secondsConnection: Keep-AlivernKeep-Alive: timeout=5, max=100rnETag :rnHTTPTimeRequest in frame: 23Ubuntu 正奁行-Oracle VM VirtualBox管理控制视图热键设备帮助。 | 192.168.137.2this is a test web for zh园包

26、淳 旦酱晦笏j Right CtrlX 一口 文件(F)编辑(E)视图(V)跳转(G)捕获(C)分析(A)统计(S)电话(Y)无线(W)工具(T)帮助(H)Server: Apache/2.4.18 (Ubuntu)rn念 18C 画奥 t. S) 分蛆 25 - wireshark_pcapng_enp0s8_20161014135158_E57VXNX _ 文件(F)Connection: Keep-Alivern绘 18C 宜奥画 V) 14:00X _ 文件编辑查看历史书签工具帮助四. 思考题回答五. 实验总结在这次实验中,我了解了 HTTP的相关概念、工作原理及其作用。掌握了如何在Linux 下安装HTTP服务器软件,并在实验中成功地设置了 HTTP服务器,并在客户端成功地访问 了该服务器,并且知道了如何正确配置HTTP服务器,并学会了如何借此搭建一个HTTP服 务器。

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 生活休闲 > 在线阅读


备案号:宁ICP备20000045号-2

经营许可证:宁B2-20210002

宁公网安备 64010402000987号