Configure nginx for CentOS-6.4 Installation

Source: Internet
Author: User
Before installing nginx, make sure that the system has installed G ++, GCC, OpenSSL-devel, PCRE-devel, and zlib-devel. Install required software:
[[Email protected]/] # Yum install gcc-C ++
Yum-y install zlib-devel OpenSSL -- devel PCRE-devel

Check the nginx installed by the system:

[[Email protected] local] # Find-name nginx

Uninstall the original nginx

[[Email protected]/] # Yum remove nginx
Install

Upload the installation package file to/usr/local and perform the following operations:

[[Email protected] SRC] # tar-zxv-F nginx-1.6.2.tar.gz
[[Email protected] nginx-1.6.2] #./configure
[[Email protected] nginx-1.6.2] # Make
[[Email protected] nginx-1.6.2] # make install

Configuration

# Modify the Firewall Configuration:
[[Email protected] nginx-1.6.2] # vi +/etc/sysconfig/iptables
# Add configuration items
-A input-M state -- state new-m tcp-p tcp -- dport 80-J accept
# Restarting the Firewall
[[Email protected] nginx-1.6.2] # service iptables restart
Start
# Method 1
[[Email protected] nginx-1.6.2] #/usr/local/nginx/sbin/nginx-C/usr/local/nginx/CONF/nginx. conf
# Method 2
[[Email protected] nginx-1.2.6] # cd/usr/local/nginx/sbin
[[Email protected] sbin] #./nginx
Stop
# Querying the nginx master process number
PS-Ef | grep nginx
# Stop a process
Kill-Quit master process number
# Quick Stop
Kill-term master process number
# Force stop
Pkill-9 nginx
Restart
[[Email protected] local] #/usr/local/nginx/sbin/nginx-s reload
Test

# Test Port
Netstat-Na | grep 80
# Testing in the browser
Http: // ip: 80

Configure nginx for CentOS-6.4 Installation

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.