Home >Backend Development >PHP Tutorial >CENTOS 65 configure YUM to install NGINX

CENTOS 65 configure YUM to install NGINX

WBOY
WBOYOriginal
2016-08-08 09:21:26894browse

The first step is to create a source configuration file nginx.repo: ?

1

23

cd

/etc/yum

.repos.d/

vim nginx.repo

Fill in the following:

?

1

2

3

4

5

[nginx]

name=nginx repo

baseurl=http://nginx.org/packages/centos/$releasever/$basearch/

gpgcheck=0

enabled=1

Save, a /etc/yum.repos.d/nginx.repo file will be generated. Just execute the following command to automatically install Nginx:

?

1

yum install nginx-y

After the installation is complete, you can start Nginx directly:

?

1

/etc/init .d/nginx start

Now that Nginx has been started, you can see the Nginx welcome page by directly accessing the server. If you still cannot access it, you need to configure the Linux firewall.

?

1

2

3

4

5

iptabl es -I INPUT 5 -i eth0 -p tcp --dport 80 - m state --state NEW,ESTABLISHED -j ACCEPT

service iptables save

service iptables restart

Nginx command and configuration file location:

?

1

2

3

4

5

/etc/ init.d/nginx start # Start Nginx service

/etc/init.d/nginx stop # Stop Nginx service

/etc/nginx/nginx.conf # Nginx configuration file location

At this point, Nginx has been fully configured and installed.
http://my.oschina.net/VincentJiang/blog/224993

The above introduces how to configure YUM to install NGINX on CENTOS 65, including the relevant aspects. 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