Nginx Installation and Basic configuration

Source: Internet
Author: User

1. Official website

http://nginx.org/

2.nginx Installation

2.1cd/user/local/software directory (if not, create)

2.2 Upload Nginx Package and high-availability package to this directory

nginx-1.6.2. tar.gzkeepalived-1.2.18.tar.gz

2.3 Unzip to/usr/local

TAR-ZXF nginx-1.6.2.tar.gz/usr/local

2.4 Download the dependent library files required for the lock:

        yum Install pcre        yum install pcre-devel        yum install zlib        yum install zlib-devel

2.5 For Configure configuration:

CD nginx-1.6.2 &&/configure--prefix=/usr/local/nginx  

Represents success

See if you have an error:

Error 1:ERROR:C compiler cc is not found

Solution:

Install gcc-c++-y install gcc-c++-y: All queries are selected Yes

2.6 Compiling the installation (CD to/usr/local/nginx-1.6.2 directory)

Make && make install

2.7 Start Nginx

cd/usr/local/Nginx Directory: see the following 4 directories .... conf configuration file ...   HTML Web page file ... logs  log file ...  sbin  primary binary program

Start command: (/usr/local/nginx/sbin/nginx-s start)

/usr/local/nginx/sbin/nginx

To see if it started successfully: (Netstat-ano | grep 80) or as follows:

Ps-ef|grep Nginx

Close command: (/usr/local/nginx/sbin/nginx-s stop)

/usr/local/nginx/sbin/nginx-s stop

Restart command: (/usr/local/nginx/sbin/nginx-s reload)

/usr/local/nginx/sbin/nginx-s Reload

Browser Access address: (see Welcome page)

Http://192.168.0.100:80

If it fails: it may be 80 ports occupied and so on.

LSOF-I:80 View the process PID and then kill-9 the PID

Nginx Installation and Basic configuration

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.