Installation of the Linux Nginx

Source: Internet
Author: User

First, install Nginx
1, download a package on the official Nginx website, is: http://nginx.org/en/download.html
2. WinSCP (FTP Upload tool). exe FTP upload tool uploaded to CentOS
3, I was first to build a directory, the use of the installation package to put together.
#mkdir/home/
#tar ZXF nginx-1.4.1.tar.gz
#cd nginx-1.4.1
4. Install PCRE Development Kit
#yum install-y Pcre-devel
5. If the installation appears in the following error, the compilation environment is missing. Install the tools and libraries needed to compile the source code
./configure:error:c compiler cc is not found
#yum install gcc gcc-c++ ncurses-devel perl
6, install CMake, download the source code from http://www.cmake.org and compile the installation
#yum-y install make gcc gcc-c++ ncurses-devel
#yum-y install zlib zlib-devel
7. The OpenSSL library is required if SSL function is required
#yum-y Install OpenSSL openssl--devel
8. Installing Nginx
#cd nginx-1.4.1
#./configure--prefix=/opt/nginx
#make
#make Install
9. Start the service
#/opt/nginx/sbin/nginx-c/opt/nginx/conf/nginx.conf
10. Stop the Service
#/opt/nginx/sbin/nginx-s stop
11. Check Port occupancy
#netstat-TUNLP
12. If other machines are inaccessible, the workaround is as follows:
#/sbin/iptables-i input-p TCP--dport 80-j ACCEPT
Then Save:
#/etc/rc.d/init.d/iptables Save
Restarting the firewall
#/etc/init.d/iptables restart

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.