Accept cookies for analytics, social media, and advertising, or learn more and adjust your preferences. These cookies are on by default for visitors outside the UK and EEA. Privacy Notice.
It is advised you be familiar with installing packages on OpenBSD before proceeding. You can find OpenBSD’s package documentation here.
$ sudo pkg_add -v pcre
Make sure to appropriately substitute the version numbers below:
$ wget http://sysoev.ru/nginx/nginx-X.X.XX.tar.gz
$ tar -xzvf nginx-X.X.XX.tar.gz
$ cd nginx-X.X.XX/
$ ./configure --sbin-path=/usr/local/sbin/nginx \
--conf-path=/etc/nginx/nginx.conf \
--pid-path=/var/run/nginx.pid \
--with-http_ssl_module \
--http-log-path=/var/log/nginx.log \
--error-log-path=/var/log/nginx-error.log \
--http-fastcgi-temp-path=/var/tmp/fastcgi_tmp \
--http-proxy-temp-path=/var/tmp/proxy_tmp \
--http-client-body-temp-path=/var/tmp/client_body_temp \
--with-http_stub_status_module \
--user=www --group=www
$ make && sudo make install
After NGINX has been installed, make sure to edit /etc/nginx/nginx.conf
according to your needs.
By default, NGINX saves its logs as /var/log/nginx.log
and /var/log/nginx-error.log
. You may wish to configure NGINX so that it saves its logs on a per-host basis.
$ sudo /usr/local/sbin/nginx
$ lynx http://localhost
$ sudo kill -HUP $(head -1 /var/run/nginx.pid)
$ sudo kill -QUIT $(cat /var/run/nginx.pid)
The initial motivation for this article was a rapid introduction to install and setup NGINX on OpenBSD.
Currently exist a port under /usr/ports/www/nginx
. It can be the best way to install and handle new NGINX versions on this Operating System.
Whenever it article is nice and functional.