$ rpm -qs nginx normal /etc/logrotate.d/nginx normal /etc/nginx normal /etc/nginx/conf.d normal /etc/nginx/conf.d/default.conf normal /etc/nginx/fastcgi_params normal /etc/nginx/koi-utf normal /etc/nginx/koi-win normal /etc/nginx/mime.types normal /etc/nginx/modules normal /etc/nginx/nginx.conf normal /etc/nginx/scgi_params normal /etc/nginx/uwsgi_params normal /etc/nginx/win-utf normal /etc/sysconfig/nginx normal /etc/sysconfig/nginx-debug normal /usr/lib/systemd/system/nginx-debug.service normal /usr/lib/systemd/system/nginx.service normal /usr/lib64/nginx normal /usr/lib64/nginx/modules normal /usr/libexec/initscripts/legacy-actions/nginx normal /usr/libexec/initscripts/legacy-actions/nginx/upgrade normal /usr/sbin/nginx normal /usr/sbin/nginx-debug normal /usr/share/doc/nginx-1.10.1 normal /usr/share/doc/nginx-1.10.1/COPYRIGHT normal /usr/share/nginx normal /usr/share/nginx/html normal /usr/share/nginx/html/50x.html normal /usr/share/nginx/html/index.html normal /var/cache/nginx normal /var/log/nginx
nginx.serviceとかlogrotateのファイルを確認しておく。
$ cat /lib/systemd/system/nginx.service [Unit] Description=nginx - high performance web server Documentation=http://nginx.org/en/docs/ After=network.target remote-fs.target nss-lookup.target
--prefix=PATH set installation prefix --sbin-path=PATH set nginx binary pathname --modules-path=PATH set modules path --conf-path=PATH set nginx.conf pathname --error-log-path=PATH set error log pathname --pid-path=PATH set nginx.pid pathname --lock-path=PATH set nginx.lock pathname
--user=USER set non-privileged user for worker processes --group=GROUP set non-privileged group for worker processes
--build=NAME set build name --builddir=DIR set build directory (...)
./configure: error: the HTTP rewrite module requires the PCRE library. You can either disable the module by using --without-http_rewrite_module option, or install the PCRE library into the system, or build the PCRE library statically from the source with nginx by using --with-pcre=<path> option.
$ yum install pcre-devel -y
./configure: error: SSL modules require the OpenSSL library. You can either do not enable the modules, or install the OpenSSL library into the system, or build the OpenSSL library statically from the source with nginx by using --with-openssl=<path> option.
$ yum install openssl-devel -y
./configure: error: the HTTP gzip module requires the zlib library. You can either disable the module by using --without-http_gzip_module option, or install the zlib library into the system, or build the zlib library statically from the source with nginx by using --with-zlib=<path> option.
$ yum install zlib-devel -y
設定と起動
./configureで設定した内容に合わせてserviceファイルを編集する。
nginx.confはデフォルトのまま使う。
$ cat /lib/systemd/system/nginx.service [Unit] Description=The NGINX HTTP and reverse proxy server After=syslog.target network.target remote-fs.target nss-lookup.target
make uninstallが無いのでnginx -Vで./configureで指定したディレクトリを調べてファイルを全て削除する。
$ make uninstall make: *** No rule to make target `uninstall'. Stop. $ nginx -V nginx version: nginx/1.11.4 built by gcc 4.8.5 20150623 (Red Hat 4.8.5-4) (GCC) built with OpenSSL 1.0.1e-fips 11 Feb 2013 TLS SNI support enabled configure arguments: --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-は省略