(Original) 1. Install nginx in cenos Linux

Source: Internet
Author: User
Tags install openssl openssl library

1. Install nginx
1. Download a package on the official nginx website, is: http://nginx.org/en/download.html
2、winscp(ftpupload tool: cmd.exe FTP upload tool uploaded to centos
3. I first created a directory and put the installation package to be used together.
# Mkdir/home/
# 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 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 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 =/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. view port usage
# Netstat-tunlp
12. If other machines cannot be accessed, the solution is as follows:
#/Sbin/iptables-I input-P TCP -- dport 80-J accept
Then save:
#/Etc/rc. d/init. d/iptables save
Restart Firewall
#/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.