From the course: Linux System Engineer: Web Servers and DNS Using Apache, NGINX, and BIND
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Create a server block with NGINX - Red Hat Enterprise Linux Tutorial
From the course: Linux System Engineer: Web Servers and DNS Using Apache, NGINX, and BIND
Create a server block with NGINX
- [Instructor] When a Apache to host more than one website, we create virtual hosts. The equivalent in NGINX is called a server block. In this exercise we'll disable Apache, start NGINX, and create a new server block. You'll want to be logged into rhhost1 with the terminal open. We'll begin by stopping the Apache service, and disabling it so won't start on boot. In the terminal type in sudu systemctl stop httpd. Type in your password if prompted. Then bring your line back and change stop to disable. (typing on keyboard) Now let's start NGINX and enable it. Type in sudu systemctl start nginx and hit Enter. Then bring your line back and change start to enable. To make sure this is working, use Firefox to view local host. Type in clear and then type in firefox localhost. If you see the NGINX welcome page, then you're on the track. Close Firefox now. NGINX stores its main configuration file on /etc/nginx/nginx.conf It also has additional configuration files just like Apache at…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.