Help us understand the problem. What is going on with this article?

[nginx] Amazon Linuxにnginxをインストールする (yumパッケージ)

More than 5 years have passed since last update.

インストール

コマンド(例/AmazonLinux)
sudo yum install nginx -y
結果(例)
完了しました!

起動

コマンド(例/AmazonLinux)
sudo service nginx start
結果(例)
Starting nginx:                                            [  OK  ]

起動設定変更

コマンド(例/AmazonLinux)
sudo chkconfig nginx on
chkconfig --list nginx
結果(例)
nginx           0:off   1:off   2:on    3:on    4:on    5:on    6:off

アクセス確認

インスタンスのパブリックIPアドレスにブラウザでアクセスしてコンテンツを確認してみましょう。

スクリーンショット 2015-10-08 17.09.11.png

ログ確認

コマンド(例/AmazonLinux)
sudo tail /var/log/nginx/access.log
結果
118.xxx.xxx.xxx - - [17/Aug/2015:05:41:33 +0000] "GET / HTTP/1.1" 200 3770 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/600.8.9 (KHTML, like Gecko) Version/7.1.8 Safari/537.85.17" "-"
118.xxx.xxx.xxx - - [17/Aug/2015:05:41:33 +0000] "GET /nginx-logo.png HTTP/1.1" 200 370 "http://54.xxx.xxx.xxx/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/600.8.9 (KHTML, like Gecko) Version/7.1.8 Safari/537.85.17" "-"
118.xxx.xxx.xxx - - [17/Aug/2015:05:41:33 +0000] "GET /poweredby.png HTTP/1.1" 200 3412 "http://54.xxx.xxx.xxx/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/600.8.9 (KHTML, like Gecko) Version/7.1.8 Safari/537.85.17" "-"
118.xxx.xxx.xxx - - [17/Aug/2015:05:41:34 +0000] "GET /favicon.ico HTTP/1.1" 404 3696 "http://54.xxx.xxx.xxx/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/600.8.9 (KHTML, like Gecko) Version/7.1.8 Safari/537.85.17" "-"

完了

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away