1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

[Cloud101]#2 HTTPとHTMLを感じる

Posted at

0.AGENDA

  1. curlの復習
  2. telnetで同じことをやって見る
  3. ブラウザのアドレスバーに入れるURLって何?
  4. 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) 対象サイトをブラウザで見て、「右クリック>ソースを表示」を見てみる

ViewSource.JPG

(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って何? (スミマセン、手抜きです :sweat_smile: )

(1)URLって何?

(2)ホスト名って何?

(3)プロトコルって何?

http://www.ubuntulinux.jp/ubuntu/mirrors

(4)ポートって何?

4.GWの宿題

  • CentOSコマンドを手当たりしだいに試してみる

  • できればWebサーバを立ち上げて簡単なHTML文書の作成・アクセステストを行う
    ・rootでないとインストールできないので、#1の "su -" や "sudo"を使う

Enjoy! :tada:

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?