Nginx Windows Build process: Nginx cannot start

Source: Internet
Author: User

Content List: Brief introduction to download installation configuration test

First, a brief introduction

Nginx ("Engine X") is a high-performance HTTP and reverse proxy server and a IMAP/POP3/SMTP proxy server. Nginx was developed by Igor Sysoev, the second rambler.ru site for Russian visits, and the first public version of 0.1.0 was released on October 4, 2004. It publishes the source code in the form of a BSD-like license, which is known for its stability, rich feature sets, sample configuration files, and low system resource consumption. June 1, 2011, Nginx 1.0.4 released.

Nginx as a load balancing server: Nginx can directly support Rails and PHP programs externally, and can support external services as an HTTP proxy server. Nginx use C to write, whether it is the system resource cost or CPU efficiency is much better than Perlbal.

As a mail proxy server: Nginx is also a very good mail proxy server (one of the first to develop this product is also as a mail proxy server), last. FM describes a successful and wonderful use of experience.

Nginx is a very simple installation, the configuration file is very concise (also able to support Perl syntax), Bugs very few servers: Nginx startup is particularly easy, and can almost do 7*24 non-stop operation, even if run for several months does not require a reboot. You are also able to upgrade the software version without interruption of service.

(More about the reference encyclopedia, more use of reference to Google, advertise)

Second, download and install

We use the nginx-1.7.2 version, download the decompression and put to the C:\nginx-1.7.2 question)

Run Cmd.exe to

There are mistakes ah, do not know to start success did not, to see the log bar.

There are two log files in the logs Access.log,error.log, open the Error.log open to the following prompts

2011/06/16 15:23:55 [Emerg] 7136#4040:bind () to 0.0.0.0:80 failed (10013:an attempt is made to access a socket in a way Forbidden by it access permissions)
2011/06/16 15:24:14 [Emerg] 6336#7052:bind () to 0.0.0.0:80 failed (10013:an at Tempt is made to access a socket in a way forbidden through its access permissions)

Went to Nginx website search for a reason: View Code

3 reasons:

1. The firewall is open (it is true that my WIN7 Windows Firewall is open, but it is not able to start nginx after it is turned off)

2.80 Port is occupied (do have a default site with 80 ports, shut down and then start Nginx Normal, the nginx default configuration. You need to modify the nginx.conf in the nginx-1.7.2\conf directory. will be inside the

server {
Listen 80;//changed to other numbers.

How to look out of the normal, look at the logs below is not more than a nginx.pid file, cmd window entered

C:\nginx-1.0.4>tasklist/fi "imagename eq nginx.exe"
The results are as follows:

The instructions are now successful, with two processes. According to the official explanation, Nginx is a daemon, one of which is to handle the event waiting, and when an event is triggered, another process is initiated to process the request.

Open the browser and enter HTTP://127.0.0.1/. If you have changed the port number above, suppose 3000, then enter Http://127.0.0.1:3000/here

After successful access can be logs under the Access.log see Access to the site request Information View Code

If you do not succeed, you can then view the error.log reason under logs, and here are the other operations commands

Nginx-s stop Quick exit
Nginx-s quit Graceful quit
Nginx-s Reload Changing configuration, starting a new worker, quitting an old worker gracefully
Nginx-s Reopen Reopening log files

Third, the configuration test

We run the Nginx under CMD.

Startup success, error, you can query the log (log path is specified by the configuration file, you can modify the save to another location)

Close all Nginx all processes: taskkill/im/f QQ.exe. This command works well, and the following two commands sometimes fail to close nginx.
Close the Nginx process: Nginx-s stop/nginx-s quit

Loading the specified configuration file

C:\server\nginx-1.7.2>start nginx.exe-c conf/default.conf


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.