Home >Backend Development >PHP Tutorial >CentOS 65 Installation Nginx 178 Tutorial

CentOS 65 Installation Nginx 178 Tutorial

WBOY
WBOYOriginal
2016-07-29 09:15:341000browse

Linux system: Centos 6.5 x64
Nginx version: 1.7.8
1. Install prce(redirect support ) and openssl (https support, If you don’t need https, you don’t need to install it.

    When I installed CentOS 6.5, I selected "Basic Server". By default, these two packages are not installed, so just run and install them.
  1. 2. Download nginx 1.7.8
wget http:

    /
  1. /nginx.org
  2. /
download/nginx- 1.
7. 8
.

tar

    .
  1. gz3. Unzip, compile and install tar -zxvf nginx-1.7. 8.tar. gz
Then enter the directory to compile and install

  1. cd nginx-1.7.8
./configure
-

    -
  1. prefix=/usr/local/nginx
  2. -
1.

5

    .
  1. 1 --with-http_ssl_module --with-http_spdy_module --with-http_stub_status_module --with-pcre
  2. If there is no error message, you can perform the following installation: make
  3. make install
  4. 4. Start the nginx process
  5. /usr/
local/nginx
-

1

    .
  1. 7.
    8/sbin/nginx
Restart or shut down Process:

    /usr/
  1. local/nginx-1.7.8/sbin/nginx -s reload
/usr/local
/

nginx

    -
  1. 1.7.8/sbin/nginx -s stop5. Turn off the firewall, or add firewall rules to test.
  2. service iptables stop
  3. or edit the configuration file: vi /etc/sysconfig/iptables
Add such a rule to open port 80 and save it :

  1. -A INPUT
  2. -
m state --
state NEW

-

    m tcp
  1. -p tcp -
-dport 80 -j ACCEPT

  1. Restart the service: service iptables restartok, you can access it through the browser. Welcome to nginx! The above introduces the CentOS 65 installation Nginx 178 tutorial, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn