0.AGENDA
- curlの復習
- telnetで同じことをやって見る
- ブラウザのアドレスバーに入れるURLって何?
- GWの宿題
1.curlの復習
-前回参照
http://qiita.com/nagahisa/items/ca8f4e9cc373edd0473d
2. telnetで同じことをやって見る
(1)まず適当な(軽い)サイトに以下でアクセス
$ telnet kenzo-vps.nagahisa.me 80
Trying 160.16.89.214...
Connected to kenzo-vps.nagahisa.me.
Escape character is '^]'.
(2)HEAD
HEAD / HTTP/1.1
HOST: kenzo-vps.nagahia.me
HTTP/1.1 200 OK
Server: nginx
Date: Wed, 27 Apr 2016 23:00:02 GMT
Content-Type: text/html
Content-Length: 612
Last-Modified: Tue, 21 Apr 2015 15:38:08 GMT
Connection: keep-alive
ETag: "55366ee0-264"
Accept-Ranges: bytes
#(2)GET
GET / HTTP/1.1
HOST: kenzo-vps.nagahisa.me
HTTP/1.1 200 OK
Server: nginx
Date: Wed, 27 Apr 2016 22:57:44 GMT
Content-Type: text/html
Content-Length: 612
Last-Modified: Tue, 21 Apr 2015 15:38:08 GMT
Connection: keep-alive
ETag: "55366ee0-264"
Accept-Ranges: bytes
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
body {
width: 35em;
margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif;
}
</style>
</head>
<body>
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p>
<p>For online documentation and support please refer to
<a href="http://nginx.org/">nginx.org</a>.<br/>
Commercial support is available at
<a href="http://nginx.com/">nginx.com</a>.</p>
<p><em>Thank you for using nginx.</em></p>
</body>
</html>
(3) GET と HEADの違いを見てみる
(4) 対象サイトをブラウザで見て、「右クリック>ソースを表示」を見てみる
(5) 存在しないパスを指定
GET /hoge HTTP/1.1
HOST: kenzo-vps.nagahisa.me
HTTP/1.1 404 Not Found
Server: nginx
Date: Wed, 27 Apr 2016 23:06:12 GMT
Content-Type: text/html
Content-Length: 162
Connection: keep-alive
<html>
<head><title>404 Not Found</title></head>
<body bgcolor="white">
<center><h1>404 Not Found</h1></center>
<hr><center>nginx</center>
</body>
</html>
404って出てきた!(前は200だった)
(6) HTTPとHTML
https://ja.wikipedia.org/wiki/Hypertext_Transfer_Protocol
https://ja.wikipedia.org/wiki/HyperText_Markup_Language
3. ブラウザのアドレスバーに入れるURLって何? (スミマセン、手抜きです )
(1)URLって何?
(2)ホスト名って何?
(3)プロトコルって何?
http://www.ubuntulinux.jp/ubuntu/mirrors
(4)ポートって何?
4.GWの宿題
-
CentOSコマンドを手当たりしだいに試してみる
-
できればWebサーバを立ち上げて簡単なHTML文書の作成・アクセステストを行う
・rootでないとインストールできないので、#1の "su -" や "sudo"を使う
Enjoy!