Инсталляция Nginx 1.X сервера на Ubuntu из пакетов
Делаю:
19.08.2018
$ sudo su -
# apt-get update -y && apt-get upgrade -y
# apt-get install -y vim curl links wget
# cd /tmp/
# wget http://nginx.org/keys/nginx_signing.key
# apt-key add nginx_signing.key
# cd /etc/apt/sources.list.d/
# vi nginx.list
Добавляю в конец файла
Если (Bionic)
deb http://nginx.org/packages/ubuntu/ bionic nginx
deb-src http://nginx.org/packages/ubuntu/ bionic nginx
Если (xenial)
deb http://nginx.org/packages/ubuntu/ xenial nginx
deb-src http://nginx.org/packages/ubuntu/ xenial nginx
# apt-get update
# apt-get install -y nginx
# service nginx restart
# service nginx status
# systemctl enable nginx
# nginx -v
nginx version: nginx/1.14.0
# curl -I http://localhost
HTTP/1.1 200 OK
Server: nginx/1.14.0
Date: Fri, 04 May 2018 02:44:21 GMT
Content-Type: text/html
Content-Length: 612
Last-Modified: Tue, 17 Apr 2018 15:22:36 GMT
Connection: keep-alive
ETag: "5ad6113c-264"
Accept-Ranges: bytes
# links http://localhost
# netstat -aln | grep 80
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN
По умолчанию работает на порту 80. Поменять можно:
# vi /etc/nginx/conf.d/default.conf