Linux-install nginx

Source: Internet
Author: User
Tags openssl library centos server
: This article describes how to install nginx in Linux. if you are interested in the PHP Tutorial, refer to it. Zookeeper

1. install nginx
1. download a package on the official nginx website, is: http://nginx.org/en/download.html


2. upload the file over ftp to the CentOS server


3. first create a directory and put together the installation packages to be used.
# Mkdir/data/kkweb
# Tar zxf nginx-1.4.1.tar.gz
# Cd nginx-1.4.1


4. install the pcre Development Kit
# Yum install-y pcre-devel


5. if the following error occurs during installation, the compilation environment is missing. Install the tools and libraries required for compiling source code
./Configure: error: C compiler cc is not found
# Yum install gcc-c ++ ncurses-devel perl


6. install cmake, download the source code from the http://www.cmake.org and compile and install
# Yum-y install make gcc-c ++ ncurses-devel
# Yum-y install zlib-devel


7. openssl library is required for ssl functions
# Yum-y install openssl -- devel


8. install nginx
# Cd nginx-1.4.1
#./Configure -- prefix =/data/kkweb/nginx
# Make
# Make install


9. start the service
#/Data/kkweb/nginx/sbin/nginx


10. stop the service
#/Data/kkweb/nginx/sbin/nginx-s stop


11. view port usage
# Netstat-tunlp


12. if other machines cannot be accessed, the solution is as follows:

Check whether port 80 is enabled. If no

# Vi/etc/sysconfig/iptables
Added:-a input-m tcp-p tcp -- dport 80-j ACCEPT

Save: wq!
Restart firewall
# Service iptables start


Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

The above describes how to install nginx in Linux, including some content. if you are interested in the PHP Tutorial.

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.