「CentOS8.3」 nginxをインストールする方法
1.リポジトリを追加
# vi /etc/yum.repos.d/nginx.repo
追記
[nginx-stable] name=nginx stable repo baseurl=http://nginx.org/packages/centos/$releasever/$basearch/ gpgcheck=1 enabled=1 gpgkey=https://nginx.org/keys/nginx_signing.key module_hotfixes=true [nginx-mainline] name=nginx mainline repo baseurl=http://nginx.org/packages/mainline/centos/$releasever/$basearch/ gpgcheck=1 enabled=0 gpgkey=https://nginx.org/keys/nginx_signing.key module_hotfixes=true
2.nginxのインストール
# sudo yum install nginx
略
インストール済みのサイズ: 2.7 M
これでよろしいですか? [y/N]: y
3.バージョンを確認
# nginx -v
nginx version: nginx/1.18.0
4.nginxの起動
# systemctl enable nginx
Created symlink /etc/systemd/system/multi-user.target.wants/nginx.service → /usr/lib/systemd/system/nginx.service.
# systemctl start nginx
# systemctl status nginx
● nginx.service – nginx – high performance web server
Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disa>
Active: active (running) since Mon 2021-02-22 20:35:40 JST; 5s ago
略