Commit 90410f66 authored by Vladimir Bashkirtsev's avatar Vladimir Bashkirtsev

Initial commit

parents
all: nginx-service nginx-logrotate
tar xf openresty-1.19.3.1.tar.gz
cd openresty-1.19.3.1 && ./configure --prefix=/usr --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/run/nginx.pid --lock-path=/var/log/nginx.lock --http-client-body-temp-path=/tmp/nginx-client-body --http-proxy-temp-path=/tmp/nginx-proxy-temp --without-http_fastcgi_module --without-http_uwsgi_module --without-http_scgi_module --with-http_ssl_module --with-http_v2_module --with-http_stub_status_module --with-http_auth_request_module
$(MAKE) -C openresty-1.19.3.1
$(MAKE) -C openresty-1.19.3.1 install
@echo "$$NGINX_LOGROTATE" > /etc/logrotate.d/nginx
@echo "$$NGINX_SERVICE" > /lib/systemd/system/nginx.service
systemctl enable nginx.service
mv /usr/nginx/html /srv/www
rm /etc/nginx/fastcgi.conf
rm /etc/nginx/fastcgi.conf.default
rm /etc/nginx/fastcgi_params
rm /etc/nginx/fastcgi_params.default
rm /etc/nginx/mime.types.default
rm /etc/nginx/nginx.conf.default
rm /etc/nginx/scgi_params
rm /etc/nginx/scgi_params.default
rm /etc/nginx/uwsgi_params
rm /etc/nginx/uwsgi_params.default
rm -rf openresty-1.19.3.1
nginx-service:
define NGINX_SERVICE
[Unit]
Description=The NGINX HTTP and reverse proxy server
After=syslog.target network.target remote-fs.target nss-lookup.target
[Service]
Type=forking
PIDFile=/run/nginx.pid
ExecStartPre=/usr/nginx/sbin/nginx -t
ExecStart=/usr/nginx/sbin/nginx
ExecReload=/usr/nginx/sbin/nginx -s reload
ExecStop=/bin/kill -s QUIT $$MAINPID
PrivateTmp=true
[Install]
WantedBy=multi-user.target
endef
export NGINX_SERVICE
nginx-logrotate:
define NGINX_LOGROTATE
/var/log/nginx/*access.log {
weekly
rotate 3
missingok
sharedscripts
compress
postrotate
/bin/kill -USR1 `cat /run/nginx.pid 2>/dev/null` 2> /dev/null || true
endscript
}
/var/log/nginx/*error.log {
weekly
rotate 3
missingok
sharedscripts
compress
postrotate
/bin/kill -USR1 `cat /run/nginx.pid 2>/dev/null` 2> /dev/null || true
endscript
}
endef
export NGINX_LOGROTATE
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment