[Linux Nginx] Command collection used for initial setting of Web server

Firewall settings


HTTP(Open TCP port 80)Use (change current settings and save)
[user@host]$ sudo firewall-cmd --add-service http
[user@host]$ sudo firewall-cmd --add-service http --permanent
success

HTTPS(Open TCP port 443)Use (change current settings and save)
[user@host]$ sudo firewall-cmd --add-service https
[user@host]$ sudo firewall-cmd --add-service https --permanent
success

Introducing nginx


Installation
sudo yum install nginx
Answer y because there are the following questions on the way
Total download size: 4.3 M
Installed size: 14 M
Is this ok [y/d/N]: y

nginx operation


start
[user@host]$ sudo systemctl start nginx
End
[user@host]$ sudo systemctl stop nginx
Reboot
[user@host]$ sudo systemctl restart nginx
Reload configuration file
[user@host]$ sudo systemctl reload nginx
Status display
[user@host]$ sudo systemctl status nginx -l

location of nginx error log

/var/log/nginx/error.log

nginx config file comment out

Like the shell script, you can comment out with "#".

reference

Recommended Posts

[Linux Nginx] Command collection used for initial setting of Web server
Linux server command
Linux command collection
[Linux command] A memorandum of frequently used commands
A collection of commands frequently used in server management
[Linux] Basics of authority setting by chmod for beginners
Linux command for self-collection
linux command error collection 1
Check the memory status of the server with the Linux free command
Initial setting of environment using Docker-compose + Django + MySQL + Nginx + uwsgi
Check the operating status of the server with the Linux top command
[Linux] [Initial Settings] Table of Contents for Development Environment Setup
Linux Command Dictionary (for myself)
[Note] Useful linux command collection
Linux command memorandum [for beginners]
[Linux] [Initial Settings] Table of Contents
[Infrastructure] Linux command, shell script collection
Completion of docker command on Linux
A collection of one-liner web servers
Raspberry pi initial setting (for myself)
Frequently used Linux commands (for beginners)
[Must-see for beginners] Basics of Linux
List of frequently used Linux commands
Initial setting of Jupyter Notebook for Vim lovers ・ Exit with jj (jupyter-vim-binding)