Install Nginx with source code

Source: Internet
Author: User

Install Nginx with source code

In my previous work, I felt very high when I used Apache reverse proxy for a few Tomcat servers.
Today, my colleague said it was outdated.
Fortunately, I am not familiar with Apache. Let's start from scratch.

Source code:
Http://nginx.org/en/download.html
Http://nginx.org/download/nginx-1.6.2.tar.gz

Create an nginx user and decompress the source code
[Root @ slaveOne ~] # Useradd-m nginx
[Root @ slaveOne ~] # Cp nginx-1.6.2.tar.gz/home/nginx/
[Root @ slaveOne ~] # Cd/home/nginx/
[Root @ slaveOne nginx] # tar-zxvf nginx-1.6.2.tar.gz
Nginx-1.6.2/
Nginx-1.6.2/auto/
Nginx-1.6.2/conf/

......

Install dependency packages
Yum-y install gcc automake autoconf libtool make gcc-c ++ pcre * zlib openssl-devel

Rename the source directory (because I want to make the compiled directory A nginx-1.6.2)
[Root @ slaveOne nginx] # ls
Nginx-1.6.2 nginx-1.6.2.tar.gz
[Root @ slaveOne nginx] # Music nginx-1.6.2 nginx

Go to the source code directory
[Root @ slaveOne nginx] # cd nginx
[Root @ slaveOne nginx] # ls
Auto CHANGES CHANGES.ru conf configure contrib html LICENSE man README src

Run the following command with the root account:
./Configure \
-- Prefix =/home/nginx/nginx-1.6.2 \
-- Sbin-path =/home/nginx/nginx-1.6.2/nginx \
-- Conf-path =/home/nginx/nginx-1.6.2/nginx. conf \
-- Pid-path =/home/nginx/nginx-1.6.2/nginx. pid \
With-http_ssl_module

Multi-thread compilation and Installation
Make-j 'cat/proc/cpuinfo | grep processor | wc-l' & make install

Installation is complete. view the target file.

Modify the nginx. conf configuration file
User nginx;

View Processes
[Root @ slaveOne nginx-1.6.2] # ps-ef | grep nginx

Root 8792 1 0 :45? 00:00:00 nginx: master process./nginx
Nginx 8793 8792 0? 00:00:00 nginx: worker process

-------------------------------------- Split line --------------------------------------

Deployment of Nginx + MySQL + PHP in CentOS 6.2

Build a WEB server using Nginx

Build a Web server based on Linux6.3 + Nginx1.2 + PHP5 + MySQL5.5

Performance Tuning for Nginx in CentOS 6.3

Configure Nginx to load the ngx_pagespeed module in CentOS 6.3

Install and configure Nginx + Pcre + php-fpm in CentOS 6.4

Nginx installation and configuration instructions

Nginx log filtering using ngx_log_if does not record specific logs

-------------------------------------- Split line --------------------------------------

Nginx details: click here
Nginx: click here

This article permanently updates the link address:

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.