课程: Building an Ubuntu Server

免费学习该课程!

今天就开通帐号,24,700 门业界名师课程任您挑!

Web hosting with NGINX

Web hosting with NGINX

- [Instructor] Nginx is a popular Web server. In this video, we'll take a brief look at installing it and using it. Here on Ubuntu Server, we can install it with apt install nginx. Nginx, by default, serves up a site on port 80 from the directory var/ww/html. To make sure network peers can see the site, we'll need to open up that port on the firewall with ufw allow 80/tcp. I've already done that for the previous video, but it doesn't hurt anything to do it again here. I also have a site from the previous video already stored in var/www/html, so when I visit the server's address, I see that being provided to me. Nginx's configuration is kept in var/nginx/nginx.conf, and its sites are defined in the etc/nginx/sites-available directory. We can take a look at the definition for this default site, the one running on port 80, called default. Here, we can see where the port is defined, where the site's files are stored, and so…

内容