tutorial on installing Nginx servers on Linux and Windows systems _nginx

Source: Internet
Author: User
Tags pkill

1. Install the Nginx on the CentOS system
in the CentOS6 version of the Epel source, the Nginx RPM package has been added, but the RPM package version is lower. If you need an updated version, you can use the official RPM package, or compile the installation using the source package.

You can also use some of the two development enhancements of the Nginx version, such as Taobao's Tengine and openresty are good choices.
1.1 Common compilation parameters

--prefix=path: Specifies the Nginx installation directory
--conf-path=path: Specify nginx.conf Profile Path
Users of the--user=name:nginx worker process
--with-pcre: Turn on support for pcre regular expressions
--with-http_ssl_module: Support for enabling SSL
--with-http_stub_status_module: Used to monitor the status of Nginx
--with-http-realip_module: Allows changing client IP addresses in client request headers
--with-file-aio: Enable file Aio
--add-module=path: Add third party external module

A complete compilation scenario is provided here:

--prefix=/usr/local/nginx \
--conf-path=/etc/nginx/nginx.conf \
--error-log-path=/var/log/nginx/ Error.log \
--http-log-path=/var/log/nginx/access.log \
--http-client-body-temp-path=/var/tmp/nginx/ client_body \
--http-proxy-temp-path=/var/tmp/nginx/proxy \
--http-fastcgi-temp-path=/var/tmp/nginx/ fastcgi \
--http-uwsgi-temp-path=/var/tmp/nginx/uwsgi \
--pid-path=/var/run/nginx.pid \
--lock-path=/ Var/lock/nginx \
--user=nginx \
--group=nginx \
--with-file-aio \
--with-http_ssl_module \
--with-http_realip_module \
--with-http_sub_module \
--with-http_gzip_static_module \--
With-http_stub_status_module \
--with-pcre

Startup and shutdown of 1.2 nginx

Start Nginx:

# nginx-c/etc/nginx/nginx.conf 

Close Nginx

# nginx-s Stop

Reread configuration file

# nginx-s Reload
# pkill-hup Nginx

Reopen the log file

# nginx-s Reopen
# PKILL-USR1 Nginx

You can also download the/etc/init.d/nginx file in the Nginx RPM package and use it after modifying the path:

# service Nginx {start|stop|status|restart|reload|configtest|}

2. Install Nginx on a Windows system
first go to the official website to download nginx1.0.11 version of Windows, website download: http://nginx.org/download/nginx-1.0.11.zip


After downloading to the package, unzip the Nginx-nginx1.0.11.zip package to your favorite root directory and change the directory name to Nginx.

Then, do the following:

CD Nginx

start Nginx


In this way, the Nginx service is started. Open Task Manager, view the Nginx.exe process, there are two processes will show, occupy system resources, that is quite small. Then open the browser, input HTTP://127.0.0.1/will be able to see the Nginx Welcome page, Very friendly
Nginx-s Stop//     stops Nginx
nginx-s reload    //Reload configuration file
Nginx-s quit     //exit Nginx



Related Article

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.