Installing NGINX from the Official Repository

install | source | nginx | advanced | analyze | php | redirect

install

official repo for debian

point to the official repository

apt install curl ca-certificates gnupg1 lsb-release
# gnupg2
ls -lF /usr/share/keyrings/nginx.gpg # no exist
curl -fsSL https://nginx.org/keys/nginx_signing.key \
    | gpg1 --dearmor > /usr/share/keyrings/nginx.gpg
ls -lF /etc/apt/sources.list.d/nginx.list # no exist
cat > /etc/apt/sources.list.d/nginx.list <<EOF
deb [signed-by=/usr/share/keyrings/nginx.gpg] http://nginx.org/packages/mainline/debian `lsb_release -cs` nginx
EOF
apt update
apt install nginx
nginx -v

fix the default root directory and welcome page

mkdir -p /var/www/
mv /usr/share/nginx/html/ /var/www/
rm -f /var/www/html/*
echo '<p>nothing here' > /var/www/html/index.html

slackware

    slackpkg install fontconfig libXpm libX11 libxcb libXau libXdmcp

    sbopkg -r
    NGINXUSER=nginx NGINXGROUP=nginx sbopkg -i nginx
    chmod +x /etc/rc.d/rc.nginx

we are good already

    ls -alF /var/www/html/
rm -f /var/www/html/*
echo '<p>nothing here' > /var/www/html/index.html

ready to go

what user will run the process?

# debian package
grep ^www-data /etc/passwd
grep ^www-data /etc/group

# official package
grep ^nginx /etc/passwd
grep ^nginx /etc/group

make sure the daemon goes up with dummy config

systemctl status nginx # enabled but down
systemctl restart nginx

pgrep -a nginx
netstat -lntup | grep nginx

you can now proceed with the setup


HOME | GUIDES | LECTURES | LAB | SMTP HEALTH | HTML5 | CONTACT
Copyright © 2024 Pierre-Philipp Braun