Installation and configuration of Nginx under Linux __linux

Source: Internet
Author: User

This is my own in the installation and configuration of Nginx to do some of the records, may be written in some places not detailed.

Nginx relies on the following software libraries to ensure that these repositories are installed prior to installation, including: Gcc,openssl,zlib,pcre (can be queried by the RPM-Q command), where the first three libraries can be installed through the system disk, just to mention the Pcre installation:

Download Pcre to/home directory, the version selected here is pcre-8.10, do the following after downloading

1.[root@localhost home]# tar zxvf pcre-8.10.tar.gz   //decompression
2.[ Root@localhost home]# CD pcre-8.10                //switch to this directory
3.[ Root@localhost pcre-8.10]#./configure            //Configuration
4.[ Root@localhost pcre-8.10] #make  
5.[ Root@localhost pcre-8.10] #make install           //Installation


Install Nginx

Download the stable version from Nginx's official website, where the version number is nginx-1.0.2. By default, a compiled installation of Nginx contains most of the available modules, and you can use the "./configure--help" option to set the usage of each module, such as for unwanted Http_ssi modules, by "--without-http_ssi_ Module parameter closes this module, and if the "Http_perl" module is required, you can install it through the "--with-http_perl_module" parameter. Perform the following actions to install

1.[root@localhost home]# tar zxvf nginx-1.0.2.tar.gz  
2.[ Root@localhost home] #cd nginx-1.0.2  
3.[ Root@localhostnginx-1.0.2]#./configure--with-> Http_stub_status_module--prefix=/usr/local/nginx  
4.[ Root@localhost nginx-1.0.2] #make  
5.[ Root@localhost nginx-1.0.2] #make Install

Use the "With-http_stub_status_module" parameter to enable the Nginxstatus feature of Nginx to monitor the current state of the Nginx when configured.

Verify that the installation is successful after the installation is complete:

CD  /usr/local/nginx/sbin

The results show:
Nginx:the configuration file/usr/local/nginx/conf/nginx.conf syntax is OK
Nginx:configuration file/usr/local/nginx/conf/nginx.conf Test is successful
At this point, the installation of Nginx has completed successfully.

Start Nginx
Cd/usr/local/nginx/sbin
./nginx/Start Nginx
Enter in Browser: http://localhost Verify Nginx is started successfully

Stop Nginx
Pkill-9 Nginx

For a nginx configuration, see another 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.