LoginSignup
0
0

More than 5 years have passed since last update.

Centosでnginxをインストール手順

Posted at

前置き

centosでnginxを動かせたい時に、事前にやるところをリストします。

  • centosのバージョン確認
  • nginxのrepositoryを用意する
  • nginxのインストール&サービスを常駐させる

手順

centosのバージョン確認

[user@localhost ~]$ cat /etc/redhat-release
CentOS release 6.9 (Final)

nginxのrepositoryを用意する

/etc/yum.repos.d/nginx.repo
[nginx]
name=nginx repository
baseurl=http://nginx.org/packages/centos/6/$basearch/
gpgcheck=0
enabled=1

nginxのインストール&サービスを常駐させる

nginxのインストールと起動する

[user@localhost ~]$ sudo yum -y --enablerepo=nginx install nginx

[user@localhost ~]$ sudo service nginx status
nginx is stopped
[user@localhost ~]$ sudo service nginx start
Starting nginx:                                            [  OK  ]

NginxのRPMリスト

サービスを常駐させる

[user@localhost ~]$ chkconfig --list | grep nginx
nginx           0:off   1:off   2:on    3:on    4:on    5:on    6:off
nginx-debug     0:off   1:off   2:off   3:off   4:off   5:off   6:off

[user@localhost ~]$ sudo chkconfig nginx off
[user@localhost ~]$ chkconfig --list | grep nginx
nginx           0:off   1:off   2:off   3:off   4:off   5:off   6:off
nginx-debug     0:off   1:off   2:off   3:off   4:off   5:off   6:off

[user@localhost ~]$ sudo chkconfig nginx on
[user@localhost ~]$ chkconfig --list | grep nginx
nginx           0:off   1:off   2:on    3:on    4:on    5:on    6:off
nginx-debug     0:off   1:off   2:off   3:off   4:off   5:off   6:off

雑談

web serverのシェア状況
nginxの伸びがすごいっす
Screen Shot 0031-03-13 at 16.46.46.png

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