在Amazon Linux上安装nginx(通过yum包)
安装
sudo yum install nginx -y
完了しました!
启动
sudo service nginx start
Starting nginx: [ OK ]
更改启动设置
sudo chkconfig nginx on
chkconfig --list nginx
nginx 0:off 1:off 2:on 3:on 4:on 5:on 6:off
确认访问
让我们通过浏览器访问实例的公共IP地址来查看内容。

日志检查
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" "-"