The articles on how to install nginx in centos 6.4 are written by ex_net (Zhang jianbo). For more information, see the source.
Http://blog.csdn.net/ex_net/article/details/9860689
Author: Zhang jianbo mailbox: 281451020@qq.com Phone: 13577062679 welcome to exchange calls!
Step 1: Download The centos installation disk (342 MB)
Http://mirrors.grandcloud.cn/centos/6.4/isos/x86_64/CentOS-6.4-x86_64-minimal.iso
I personally prefer a pure version of the system, so I downloaded the smallest version of the installation disk.
By the way, we recommend a recording software:
Http://nchc.dl.sourceforge.net/project/infrarecorder/InfraRecorder/0.53/ir053.exe
Step 2: Install centos
After the disk is started, the next operation is not required. Installation is complete. Wait for 6 minutes and the installation is complete.
Step 3: Modify the NIC Configuration
After centos minimal is installed, the NIC will not start by default.
Go to the/etc/sysconfig/network-scripts/directory and find the corresponding Nic configuration file for modification.
For example:
(1) VI ifcfg-eth0
Change onboot = No to onboot = Yes
(2) restart the network
Service Network restart
Step 4: first update the system Installation Software Package
Yum check-Update
Yum-y install wget
Step 5: Install nginx
(1) download the nginx RPM package
Wget http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm
(2) install the RPM package
Rpm-IVH nginx-release-centos-6-0.el6.ngx.noarch.rpm
(3) install nginx using yum
Yum install nginx
Note: Confirm installation according to Y
Step 6: Modify firewall configurations
VI/etc/sysconfig/iptables
Add Rules
# Firewall configuration written by system-config-firewall# Manual customization of this file is not recommended.*filter:INPUT ACCEPT [0:0]:FORWARD ACCEPT [0:0]:OUTPUT ACCEPT [0:0]-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT-A INPUT -p icmp -j ACCEPT-A INPUT -i lo -j ACCEPT-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT-A INPUT -j REJECT --reject-with icmp-host-prohibited-A FORWARD -j REJECT --reject-with icmp-host-prohibitedCOMMIT
Restart Firewall
Service iptables restart
Restart nginx
Nginx
Step 7: Open ie Test