: This article mainly introduces the Nginx startup prompt that port 80 is occupied by other services (Apache and Tomcat). If you are interested in the PHP Tutorial, refer to it. Problem:
When Nginx is started, port 80 is prompted to be in use and thus cannot be started.
Description analysis:
After Nginx1.6.2 is installed on CentOS where Apache (listening for non-port 80) and Tomcat (listening for port 80) are installed, the system prompts that port 80 is in use and the service cannot be started. But check nginx. after conf, it is found that the listen of each server is not 80. In addition, you can see the welcome page after stopping tomact and then starting nginx. This indicates that nginx should listen to port 80 somewhere, and return to the welco page. This problem is clarified. find the configuration file for listening to port 80, modify it to a non-port 80, or comment out its response.
Solution:
View the configuration directories in the nginx installation directory. first, view the default configuration directories, such as conf. the conf file with the default character under the d Directory. mine is conf. d. default. in the conf file, the default configuration of nginx is displayed, including the welcome page displayed when nginx is started. modify port 80 to another port, for example, 82, save and then start nginx.
The above introduces the Nginx startup prompt that port 80 is occupied by other services (Apache and Tomcat), including content, and hope to be helpful to friends who are interested in PHP tutorials.