0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【Rocky8】Nginx1.26.1にバージョンアップ

Posted at

背景

RockyLinuxの8.10でnginxをインストールすると1.14.1がインストールされた
このバージョンは古いので新しいバージョンを入れるようにしてみます

環境

Ubuntu 22.04.4 LTS
Docker 27.0.2
rockylinux:8.10
nginx:1.26.1

手順

docker準備

Rocky Linux 8.10のイメージを取得します

$ docker pull rockylinux:8.10

取得できたか確認

$ docker images
rockylinux                      8.10                 c79048e50f5f   7 months ago    198MB

コンテナを作成してみる

$ docker run -it -d --privileged --name R-Proxy -h R-Proxy -p 9080:80 -p 9443:443 rockylinux:8.10 /sbin/init

/sbin/initがないとsystemctlが使えない

開発

$ docker exec -it <コンテナID> /bin/bash

パッケージのインストール

# dnf update -y
# dnf install -y iproute wget gcc pcre pcre-devel zlib zlib-devel openssl openssl-devel make

Nginxのバージョンを上げます

# cd /tmp/
# wget http://nginx.org/download/nginx-1.26.1.tar.gz
# cd nginx-1.26.1.tar.gz
# ./configure --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --with-pcre-jit --with-http_addition_module --with-http_dav_module --with-http_gzip_static_module --with-http_realip_module --with-http_stub_status_module --with-http_ssl_module --with-http_sub_module --with-mail --with-mail_ssl_module
# make
# make install

インストール完了後の確認

# nginx -V
# systemctl start nginx
# systemctl status nginx
# systemctl enable nginx

エラー発生
systemctl start nginxにてFailが発生

Can't open PID file /run/nginx.pid (yet?) after start: No such file or director

/etc/nginx/conf/nginx.confの中身を確認して、pidの指定がされているか確認
ない場合は以下を追加

pid        /run/nginx.pid;
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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?