6
6

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.

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

Last updated at Posted at 2015-08-17

インストール

コマンド(例/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" "-"

完了

6
6
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
6
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?