CentOS 6.5 Install Nginx 1.7.8 Tutorial

Nginx is a lightweight web server/reverse proxy server and email (IMAP/POP3) proxy server, developed by Russian programmer Igor Sysoev, which is characterized by less memory occupation and strong concurrency capability. The public version 0.1.0 was released on October 4, 2004, and the latest version is 1.7.8 released on December 2, 2014.

Today, I learned the installation method of Nginx on the ttlsa website, tested it in the virtual machine, and then installed it on the server again. I will summarize the installation process below.

Linux system: Centos 6.5  x64
Nginx version: 1.7.8

1. Install prce ( redirection support ) and openssl ( https support, if you do not need https, you can not install it. )

  1. yum -y install pcre*
  1. yum -y install openssl*
When I installed CentOS 6.5, I chose "Basic Server". By default, these two packages are not fully installed, so both of them can be installed.

2. Download nginx 1.7.8

  1. wget http://nginx.org/download/nginx-1.7.8.tar.gz
3. Unzip, compile and install

  1. tar -zxvf nginx-1.7.8.tar.gz
Then enter the directory to compile and install
  1. cd nginx-1.7.8
  1. ./configure --prefix=/usr/local/nginx-1.5.1 \
  2. --with-http_ssl_module --with-http_spdy_module \
  3. --with-http_stub_status_module --with-pcre
If there is no error message, you can perform the following installation:
  1. make
  2. make install
4. Start the nginx process

  1. /usr/local/nginx-1.7.8/sbin/nginx
Restart or shut down the process:
  1. /usr/local/nginx-1.7.8/sbin/nginx -s reload
  2. /usr/local/nginx-1.7.8/sbin/nginx -s stop
5. Turn off the firewall, or add firewall rules to test.

  1. service iptables stop
Or edit the configuration file:

  1. vi /etc/sysconfig/iptables
Add such a rule to open port 80 and save it:

  1. -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
Just restart the service:

  1. service iptables restart
ok, it can be accessed by browser.

Welcome to nginx!

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326835834&siteId=291194637