Skip to content

Instantly share code, notes, and snippets.

@YasinKuralay
Created May 6, 2021 22:23
Show Gist options
  • Save YasinKuralay/b96882f58fe49e5d21a00def76d57d0f to your computer and use it in GitHub Desktop.
Save YasinKuralay/b96882f58fe49e5d21a00def76d57d0f to your computer and use it in GitHub Desktop.
nginx custom install
(ubuntu)
apt-get update
[https://nginx.org/en/download.html] choose url from here and do: wget [url]
tar -zxvf nginx-...tar.gz
cd nginx... [non-tar version]
./configure
(after error) apt-get install build-essential
./configure [works except for missing modules]
apt-get install libpcre3 libpcre3-dev zlib1g [zlib is for gzipping later] zlib1g-dev libssl-dev [libssl is for https support later (connected to --with-http_ssl_module]
./configure
# FLAGS
[Documentation, 'Building nginx from Sources' shows the necessary flags]
./configure
--sbin-path=/usr/bin/nginx [location of nginx executable, used for starting and stopping the service]
--conf-path=/etc/nginx/nginx.conf
--error-log-path=/var/log/nginx/error.log
--http-log-path=/var/log/nginx/access.log
--with-pcre [telling nginx to use the system's pcre library for regular expressions]
--pid-path=/var/run/nginx.pid [process id path, which we'll need to know when configuring an nginx system's servers(?'s) later on]
--with-http_ssl_module
[compile the configuration source by running:] make
[install the compiled source with:] make install
[check the configuration file exists in that location we configured:] ls -l /etc/nginx
[test if we have the nginx executable aswell by:] nginx -V
[start nginx:] ngin [no errors]
[check the process is running:] ps aux | grep nginx [3 lines of response]
connect to server ip from browser [nginx welcome page]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment