【1】Nginx
* 読み方 : エンジンエックス * フリーのWebサーバ
【2】環境構築
1)設定環境
* OS : CentOS7 * Nginx : V 1.10.3
2)準備
別のWebサーバ / Apache が動いている場合
# 動いているか確認 systemctl status httpd.service # 「Active: active (running)」が表示 # 停止 systemctl stop httpd.service # 自動起動OFF systemctl disable httpd.service # 自動起動OFFになったか確認 systemctl is-enabled httpd.service # 「disabled」が表示
3)設定手順
sudo rpm -ivh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
[2] Nginx をインストールする
sudo yum install nginx
[3] Nginx を開始する
systemctl start nginx.service
[4] 確認を行う
# [4-1] バージョン確認 ~~~~ nginx -v ~~~~ # [4-2] ブラウザで「http://localhost/」にアクセスする # 「Welcome to nginx!」が表示されればOK
[5] 自動起動ON
systemctl enable nginx.service
[6] 自動起動ONを確認
systemctl is-enabled nginx.service
# 「enabled」が表示
【3】各種ファイルの場所
1)設定ファイル
/etc/nginx/nginx.conf
/etc/nginx/conf.d/default.conf
2)ログファイル
/var/log/nginx/access.log /var/log/nginx/error.log
3)ディレクトリ
/usr/share/nginx/html
【4】補足:商用 NGINX Plus
* 商用のNGINX Plusってのもあって、機能比較は以下のURLを参照のこと。
http://sios.jp/products/oss/nginx/products/
参考文献
http://www.atmarkit.co.jp/ait/articles/1406/17/news013.html
インストール
http://weblabo.oscasierra.net/install-nginx-1/
http://www.atmarkit.co.jp/ait/articles/1407/24/news003_2.html
関連記事
Nginx ~ ロードバランシング ~
https://dk521123.hatenablog.com/entry/2017/03/01/230523