-
Notifications
You must be signed in to change notification settings - Fork 182
/
Copy pathNOTES_Install_NGINX_Centos.txt
24 lines (20 loc) · 1.14 KB
/
NOTES_Install_NGINX_Centos.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#Add the NGINX Repository
sudo yum install epel-release
#install NGINX
sudo yum install nginx
# Start NGINX
sudo systemctl start nginx
# Before doing so, edit the port so that it does not clash with Apache
# IF running a firewall,
# sudo firewall-cmd --permanent --zone=public --add-service=http
# sudo firewall-cmd --permanent --zone=public --add-service=https
# sudo firewall-cmd --reload
# Note if you are using iptables instead of firealld, adapt accordingly..
# to make NGINX start on boot
sudo systemctl enable nginx
#Make it start on different boot levels
sudo chkconfig --levels 235 nginx on
********* Default Server Root
The default server root directory is /usr/share/nginx/html. Files that are placed in there will be served on your web server. This location is specified in the default server block configuration file that ships with Nginx, which is located at /etc/nginx/conf.d/default.conf.
************* Server Block Configuration
Any additional server blocks, known as Virtual Hosts in Apache, can be added by creating new configuration files in /etc/nginx/conf.d. Files that end with .conf in that directory will be loaded when Nginx is started.