


Nginx startup prompts that port 80 is occupied by other services (Apache, Tomcat)
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.

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

To deploy multiple projects through Tomcat, you need to create a webapp directory for each project and then: Automatic deployment: Place the webapp directory in Tomcat's webapps directory. Manual deployment: Manually deploy the project in Tomcat's manager application. Once the project is deployed, it can be accessed by its deployment name, for example: http://localhost:8080/project1.

The Tomcat website root directory is located in Tomcat's webapps subdirectory and is used to store web application files, static resources, and the WEB-INF directory; it can be found by looking for the docBase attribute in the Tomcat configuration file.

Running projects with different port numbers on the Tomcat server requires the following steps: Modify the server.xml file and add a Connector element to define the port number. Add a Context element to define the application associated with the port number. Create a WAR file and deploy it to the corresponding directory (webapps or webapps/ROOT). Restart Tomcat to apply changes.

Converting an HTML file to a URL requires a web server, which involves the following steps: Obtain a web server. Set up a web server. Upload HTML file. Create a domain name. Route the request.

Tomcat can run HTML and JSP. The method is as follows: copy the HTML file to the corresponding subdirectory of the Tomcat directory and access it in the browser. Copy the JSP file to the corresponding subdirectory of the Tomcat directory, and use the <%@ page %> directive to specify the Java code and access it in the browser.

Reasons for Tomcat garbled characters: 1. Character set mismatch; 2. HTTP response header is not set correctly; 3. Filter or encoder configuration error; 4. Web page encoding is incorrect; 5. Other reasons (including server-side language, database encoding and proxy server issues).

To add a server to Eclipse, follow these steps: Create a server runtime environment Configure the server Create a server instance Select the server runtime environment Configure the server instance Start the server deployment project

Steps to deploy a WAR file using Tomcat: Unzip the WAR file into Tomcat's webapps directory. Create a directory with the same name as the WAR file and move the unzipped files to that directory. Start the Tomcat service. The WAR file is automatically deployed at startup and can be accessed through the browser. The URL format is: http://localhost:8080/WAR_file_directory name/
