Skip to content

Instantly share code, notes, and snippets.

@curious-eyes
Created September 12, 2019 01:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save curious-eyes/57b9136e1a5222a89da759e1e69d1d4a to your computer and use it in GitHub Desktop.
Save curious-eyes/57b9136e1a5222a89da759e1e69d1d4a to your computer and use it in GitHub Desktop.

Nginx最新版をCentOS7に載せる手順

  $ sudo rpm -ivh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
  $ sudo yum update nginx-release-centos
  $ sudo vi /etc/yum.repos.d/nginx.repo

nginx.repo の baseurl を切り替えることで、 stable or mainline を選べる。

  • stable
  baseurl=http://nginx.org/packages/centos/7/$basearch/  
  • mainline
  baseurl=http://nginx.org/packages/mainline/centos/7/$basearch/

下記コマンドで、Nginx最新版インストール実行をやってみて、該当のバージョンが無かったら、 stable / mainline を切り替えてみると良い

  $ sudo yum -y --enablerepo=nginx install nginx
@curious-eyes
Copy link
Author

$basearch には、使っているシステムのベースアーキテクチャをあらわす文字列が入る。
「x86_64」の場合は、

http://nginx.org/packages/centos/7/x86_64/RPMS/

または、

http://nginx.org/packages/mainline/centos/7/x86_64/RPMS/

を見ると、インストール可能な rpm の一覧を確認できる。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment