CentOS Installation Nginx Server environment method

Source: Internet
Author: User
Tags centos iptables nginx server

#CentOS Install Nginx Server #

1, if not installed GCC development tools, please install first: Yum groupinstall-y "Development Tools"

2, download the new version of the nginx:http://nginx.org/en/download.html,
Download to Local: wget http://nginx.org/download/nginx-1.4.3.tar.gz

3, Extract source package: Tar zxvf nginx-1.4.3.tar.gz

4, into the extracted source folder: CD nginx-1.4.3

5. Configure Nginx:./configure

6, when the installation of error:./configure:error:the HTTP Rewrite module requires the PCRE library.
Input command: Yum install-y pcre-devel

7, when the installation of error:./configure:error:the HTTP gzip module requires the Zlib library.
Input command: Yum install-y zlib-devel

8, compile Nginx: input command: Make

9, installation nginx: Input command: Make install

10, start Nginx:
Since Nginx is installed by default on/usr/local/nginx, enter at startup:/usr/local/nginx/sbin/nginx

11, Stops Nginx:/usr/local/nginx/sbin/nginx-s stop

12. Heavy Duty Nginx:/usr/local/nginx/sbin/nginx-s Reload

A workaround that cannot be accessed via IP after #配置 Nginx #

The native or local area network cannot access the Nginx server via IP because of the CentOS firewall problem, which is handled as follows:

/sbin/iptables-i input-p tcp–dport 80-j ACCEPT
/etc/init.d/iptables Save
/etc/init.d/iptables restart

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.