LoginSignup
5
6

More than 5 years have passed since last update.

CentOS6 に nginx を yum からインストール

Posted at

CentOS6.7 にnginxの Mainline を yum でインストールした時のメモです。

yum リポジトリの登録

yum でインストールするため、yumのリポジトリを登録します。

$ sudo rpm -ivh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm

Mainlineをインストールしたいので、「/etc/yum.repos.d/nginx.repo 」を修正します。
stable の場合 nginx.repo は修正しなくて良いです。

/etc/yum.repos.d/nginx.repo
# nginx.repo

[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/mainline/centos/6/$basearch/
gpgcheck=0
enabled=1

baseurl に mainline を追加しました。

インストール

リポジトリの登録が終わったのでインストールします。

$ sudo yum install nginx

これでインストールは完了です。
ひとまずデフォルト設定で起動します。
(設定ファイルは「/etc/nginx/nginx.conf」にあります。)

$ sudo service nginx start

参考

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