Skip to content

Instantly share code, notes, and snippets.

@salaros
Created February 11, 2019 19:57
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 salaros/114ce38821c3a227ff0584033126c80d to your computer and use it in GitHub Desktop.
Save salaros/114ce38821c3a227ff0584033126c80d to your computer and use it in GitHub Desktop.
cd /usr/src
## Download DAV Ext NGINX module
## !! Remove this if you don't need dav ext module or replace with modules _you_ need
wget https://github.com/arut/nginx-dav-ext-module/archive/v3.0.0.tar.gz
tar xzvf v3.0.0.tar.gz
apt-get install -qy tar wget dpkg-dev \
libssl-dev libgd-dev libgeoip-dev libhiredis-dev libluajit-5.1-dev \
libmhash-dev libpam0g-dev libperl-dev libxslt1-dev
bash <(curl -f -L -sS https://ngxpagespeed.com/install) \
--nginx-version latest
--prefix=/etc/nginx --conf-path=/etc/nginx/nginx.conf \
--sbin-path=/usr/sbin/nginx --modules-path=/usr/lib/nginx/modules \
--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=www-data --group=www-data --with-http_ssl_module --with-http_v2_module --with-http_dav_module \
--add-module=/usr/src/nginx-dav-ext-module-3.0.0
mkdir -pv /var/cache/nginx/client_temp
rm -rfv /etc/init.d/nginx
systemctl unmask nginx.service
nano /lib/systemd/system/nginx.service
systemctl enable nginx
systemctl start nginx
[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/sbin/nginx -t
ExecStart=/usr/sbin/nginx
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s QUIT $MAINPID
PrivateTmp=true
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment