When using Nginx as a Web server, I encountered the following problems: 1. Failed to start nginx systemctl start nginx.service Failed to start nginx, the error message is as follows:
This is usually because SELinux is enabled. Use the getenforce command to view the SELinux status. If the output is enforcing, it means it is enabled. Close with: Temporarily disable selinux setenforce 0 ##Set SELinux to permissive mode setenforce 1 ##Set SELinux to enforcing mode Permanently disable selinux Modify the /etc/selinux/config file 2. 403 Forbidden Error After nginx is configured, a 403 Forbidden error appears when accessing the page. You can check the error log to determine the cause of the problem. The error log file name is specified in the /etc/nginx/nginx.conf file. The default is /var/log/nginx/error.log. Use the command tail /var/log/nginx/error.log Check. If you find information like index.html failed (13: Permission denied), it is usually because the user permissions of nginx and the website directory files are inconsistent (because the user who owns the website directory files is usually xxx or root, and the default working process user of nginx is nginx, which can be modified in /etc/nginx/nginx.conf). My solution is not to modify nginx.conf, but to log in as the root user and put the website directory files under /usr/share/nginx/xxx (make sure that the user who owns all files is root), then restart nginx and you can access it normally. This is the end of this article about several error handling methods for Nginx startup failure. For more relevant content about Nginx startup failure, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: MySQL functional index optimization solution
>>: The principle and implementation of js drag effect
background The popularity of Docker is closely re...
When it comes to databases, one of the most frequ...
1. Background Use LDAP to centrally manage operat...
Preface During the development process, you will ...
1. Press win + R and type cmd to enter the DOS wi...
When using a cloud server, we sometimes connect t...
If people have been idle for too long, they will ...
There are two situations 1. Start time and end ti...
I just finished installing MySQL 5.7.19 in the ea...
Say it in advance We all know that Docker can ach...
Moore's Law no longer applies Starting with F...
Create a new table CREATE TABLE `person` ( `id` i...
Today, I encountered a little problem when I was ...
What is a table? Table is an Html table, a carrie...
Table of contents 1. Determine the entity type be...