Nginx startup prompts that port 80 is occupied by other services (Apache, Tomcat)

WBOY
Release: 2016-08-08 09:32:47
Original
1087 people have browsed it

Problem:

When Nginx starts, it prompts that port 80 is occupied and cannot start.

Description and analysis:

After installing Nginx1.6.2 on CentOS where Apache (listening on non-80 port) and Tomcat (listening on port 80) have been installed, when starting nginx, it prompts that port 80 is occupied, causing the service to fail to start. . But after checking nginx.conf, I found that the listen of each server is not 80. In addition, after stopping tomact and restarting nginx, I can see the welcome page. This means that nginx should be listening to port 80 somewhere and return the welcome page. page. This problem will be clear. Find the configuration file that listens to port 80, change it to a non-80 port, or comment on its response.

Solution:

View each configuration directory in the nginx installation directory. First check its default configuration directory, such as the conf file with the word default in the conf.d directory. Mine is the default in the conf.d directory. .conf file, after opening it, you should find that it contains the default configuration information of nginx, including the welcome page you see when starting nginx. Modify the 80 port to another port, such as 82, save and exit, and then start nginx.

The above has introduced the Nginx startup prompt that port 80 is occupied by other services (Apache, Tomcat), including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template