In this video, get familiar with directories and files that were created during the NGINX install.
- Now that we know our NGINX installation is working, the next thing to do is get familiar with some of the files and directories that are key to running NGINX on a Linux system. These will be the directories and files you're mostly likely to interact with as you're coming up to speed with NGINX. Let's start with /etc/nginx. The /etc/nginx directory holds the configuration for the entire NGINX installation. Inside this directory, you'll find the files that control the way the web server runs along with the files that define the websites being served.
The main configuration file is /etc/nginx nginx.conf. Also inside the /etc/nginx directory, we find the conf.d, sites-available, and sites-enabled directories. These locations are where we'll store our server configuration files. If you're familiar with the term virtual host or vhost, NGINX's server configuration files are very similar in function to Apache's vhost files. In fact, you'll see the term vhost and server configuration used interchangeably when discussing NGINX.
An example configuration is stored in /etc/nginx/sites-available default. This configuration sets up the welcome to NGINX page that we use to confirm the server was installed and running correctly. Two other directories that I want to mention are outside of the main /etc/nginx directory. These are /var/log/nginx and /var/www. /var/log/nginx is the directory where NGINX stores log files.
With an out-of-the-box installation, you'll find the access log and error log files in this directory. The access log records any accesses that the web servers process, along with details like the time the access occurred, the IP address of the requester, and the file that was requested. NGINX uses the error log to record any problems with the web server and other operational details. And finally, there's var/www. This location is used to store the actual files that get served to a client, including html, images, and any other documents that are stored on the server.
The default directory for this is var/www/html. However, as we create and define new server configurations in vhost, we'll be creating our own directories in /var/www to accommodate the files that get served.
- Installing NGINX on Linux
- Configuring a virtual host
- Installing PHP and MariaDB for the LEMP stack
- Securing sites with NGINX
- Creating SSL certificates
- Reverse proxies
- Load balancing