Home Backend Development PHP Tutorial Install Nginx under CentOS65

Install Nginx under CentOS65

Jul 29, 2016 am 09:15 AM
epel nginx package


This demonstration is to install Nginx under CentOS6.5/' target='_blank'>CentOS6.5Operating system:

CentOS6

.5/' target='_blank'> CentOS6.5-x86-64Nginx version: nginx-release-centos-6-0.el6.ngx.noarch.rpm

Nginx download address: http://nginx.org/en/linux_packages .html#stable

Epel version: epel-release-6-8.noarch.rpm

Epel package download address: http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6 -8.noarch.rpm

Epel source mirror address: http://mirrors.ustc.edu.cn/fedora/epel/6/x86_64/

1. Install the EPEL package

Because installing nginx requires configuring the EPEL source. So first install the EPEL rpm package, go to the directory of epel-release-6-8.noarch.rpm, and install EPEL:

[root@localhost tmp]# rpm -ivh epel-release-6-8.noarch.rpm

warning: epel-release-6-8.noarch.rpm: HeaderV3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
Preparing...               ########################################### [100%]
  1:epel-release          ########################################### [100%]
Copy after login

2. Configure the EPEL source

Since this demonstration is not connected to the Internet, nginx needs the EPEL source You need to download the file yourself and configure the source:

[root@localhost tmp]# vi  /etc/yum.repos.d/epel.repo
Copy after login

Modification: (The EPEL source package required here is placed in the /tmp/epel directory)

baseurl=file:///tmp/epel

Note:

#mirrorlist

Attachment: This is the EPEL source file required to install nginx (under the /tmp/epel directory)

(Mirror address: http://mirrors.ustc.edu.cn/fedora/epel/6/x86_64/)

Install Nginx under </p>CentOS6<p>5<strong></strong>3. Install Nginx</p><p>1) Install Nginx rpm package</p><pre name=[root@localhost tmp]# rpm -ivh nginx-release-centos-6-0.el6.ngx.noarch.rpm warning:nginx-release-centos-6-0.el6.ngx.noarch.rpm: Header V4 RSA/SHA1 Signature, keyID 7bd9bf62: NOKEY Preparing... ########################################### [100%] 1:nginx-release-centos ########################################### [100%]</p> <p></p>2) Delete nginx source<br><div class="code" style="position:relative; padding:0px; margin:0px;"><pre name="code">[root@localhost yum.repos.d]# pwd /etc/yum.repos.d [root@localhost yum.repos.d]# rm nginx.repo rm: remove regular file `nginx.repo'? y

Copy after login

3) Install Nginx
[root@localhost yum.repos.d]# yum install nginx

Loaded plugins: fastestmirror, security

Loading mirror speeds from cached hostfile

Setting up Install Process

Resolving Dependencies

--> Running transaction check

---> Package nginx.x86_640:1.0.15-12.el6 will be installed

--> Processing Dependency:nginx-filesystem = 1.0.15-12.el6 for package: nginx-1.0.15-12.el6.x86_64

--> Processing Dependency:nginx-filesystem for package: nginx-1.0.15-12.el6.x86_64

--> Processing Dependency: gd forpackage: nginx-1.0.15-12.el6.x86_64

--> Processing Dependency: GeoIP forpackage: nginx-1.0.15-12.el6.x86_64

--> Processing Dependency:libgd.so.2()(64bit) for package: nginx-1.0.15-12.el6.x86_64

--> Processing Dependency:libGeoIP.so.1()(64bit) for package: nginx-1.0.15-12.el6.x86_64

--> Running transaction check

---> Package GeoIP.x86_64 0:1.6.5-1.el6will be installed

--> Processing Dependency: geoipupdatefor package: GeoIP-1.6.5-1.el6.x86_64

--> Processing Dependency: GeoIP-datafor package: GeoIP-1.6.5-1.el6.x86_64

---> Package gd.x86_64 0:2.0.35-11.el6will be installed

--> Processing Dependency:libXpm.so.4()(64bit) for package: gd-2.0.35-11.el6.x86_64

---> Package nginx-filesystem.noarch0:1.0.15-12.el6 will be installed

--> Running transaction check

---> Package GeoIP-GeoLite-data.noarch0:2015.04-2.el6 will be installed

--> Processing Dependency:GeoIP-GeoLite-data-extra = 2015.04-2.el6 for package:GeoIP-GeoLite-data-2015.04-2.el6.noarch

---> Package geoipupdate.x86_640:2.2.1-2.el6 will be installed

---> Package libXpm.x86_640:3.5.10-2.el6 will be installed

--> Running transaction check

---> PackageGeoIP-GeoLite-data-extra.noarch 0:2015.04-2.el6 will be installed

--> Finished Dependency Resolution

 

Dependencies Resolved

 

================================================================================================

 Package                           Arch            Version                  Repository     Size

================================================================================================

Installing:

 nginx                             x86_64          1.0.15-12.el6            epel          404 k

Installing for dependencies:

 GeoIP                             x86_64          1.6.5-1.el6              epel          113 k

 GeoIP-GeoLite-data                noarch          2015.04-2.el6            epel          343 k

 GeoIP-GeoLite-data-extra          noarch          2015.04-2.el6            epel           23 M

 gd                                x86_64          2.0.35-11.el6            base          142 k

 geoipupdate                       x86_64          2.2.1-2.el6              epel           28 k

 libXpm                            x86_64          3.5.10-2.el6             base           51 k

 nginx-filesystem                  noarch          1.0.15-12.el6            epel          8.1 k

 

Transaction Summary

================================================================================================

Install       8 Package(s)

 

Total download size: 24 M

Installed size: 50 M

Is this ok [y/N]: y

Downloading Packages:

------------------------------------------------------------------------------------------------

Total                                                           61 MB/s |  24 MB     00:00    

warning: rpmts_HdrFromFdno: Header V3RSA/SHA256 Signature, key ID 0608b895: NOKEY

Retrieving key fromfile:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6

Importing GPG key 0x0608B895:

 Userid : EPEL (6)<epel@fedoraproject.org>

 Package: epel-release-6-8.noarch (installed)

 From   :/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6

Is this ok [y/N]: y

Running rpm_check_debug

Running Transaction Test

Transaction Test Succeeded

Running Transaction

Warning: RPMDB altered outside of yum.

 Installing : GeoIP-GeoLite-data-extra-2015.04-2.el6.noarch                                1/8

 Installing : GeoIP-GeoLite-data-2015.04-2.el6.noarch                                      2/8

 Installing : geoipupdate-2.2.1-2.el6.x86_64                                               3/8

 Installing : GeoIP-1.6.5-1.el6.x86_64                                                    4/8

 Installing : libXpm-3.5.10-2.el6.x86_64                                                  5/8

 Installing : gd-2.0.35-11.el6.x86_64                                                     6/8

 Installing : nginx-filesystem-1.0.15-12.el6.noarch                                        7/8

 Installing : nginx-1.0.15-12.el6.x86_64                                                  8/8

  Verifying : nginx-filesystem-1.0.15-12.el6.noarch                                        1/8

 Verifying  :GeoIP-1.6.5-1.el6.x86_64                                                    2/8

 Verifying  :GeoIP-GeoLite-data-2015.04-2.el6.noarch                                     3/8

 Verifying  :libXpm-3.5.10-2.el6.x86_64                                                  4/8

 Verifying  :geoipupdate-2.2.1-2.el6.x86_64                                              5/8

 Verifying  : GeoIP-GeoLite-data-extra-2015.04-2.el6.noarch                                6/8

 Verifying  :nginx-1.0.15-12.el6.x86_64                                                  7/8

 Verifying  :gd-2.0.35-11.el6.x86_64                                                     8/8

 

Installed:

 nginx.x86_64 0:1.0.15-12.el6                                                                 

 

Dependency Installed:

 GeoIP.x86_64 0:1.6.5-1.el6                       GeoIP-GeoLite-data.noarch 0:2015.04-2.el6 

 GeoIP-GeoLite-data-extra.noarch 0:2015.04-2.el6   gd.x86_64 0:2.0.35-11.el6                 

 geoipupdate.x86_64 0:2.2.1-2.el6                  libXpm.x86_640:3.5.10-2.el6              

 nginx-filesystem.noarch 0:1.0.15-12.el6         

 

Complete!
Copy after login

4) Run and check nginx
[root@localhost yum.repos.d]# nginx

 
[root@localhost yum.repos.d]# whereis nginx

nginx: /usr/sbin/nginx /etc/nginx/usr/share/nginx /usr/share/man/man8/nginx.8.gz/usr/share/man/man3/nginx.3pm.gz
Copy after login

5) nginx version
[root@localhost yum.repos.d]# /usr/sbin/nginx -v

nginx version: nginx/1.0.15
Copy after login


4. Log in to view , Successful

Installing Nginx under </p>CentOS6<p>5<strong></strong><br></p><p  >
                
                
                </p>
                    The above introduces the installation of Nginx under CentOS65, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials. </p>
                <p>
                    </p>

Statement of this Website
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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to configure cloud server domain name in nginx How to configure cloud server domain name in nginx Apr 14, 2025 pm 12:18 PM

How to configure an Nginx domain name on a cloud server: Create an A record pointing to the public IP address of the cloud server. Add virtual host blocks in the Nginx configuration file, specifying the listening port, domain name, and website root directory. Restart Nginx to apply the changes. Access the domain name test configuration. Other notes: Install the SSL certificate to enable HTTPS, ensure that the firewall allows port 80 traffic, and wait for DNS resolution to take effect.

How to check nginx version How to check nginx version Apr 14, 2025 am 11:57 AM

The methods that can query the Nginx version are: use the nginx -v command; view the version directive in the nginx.conf file; open the Nginx error page and view the page title.

How to start nginx server How to start nginx server Apr 14, 2025 pm 12:27 PM

Starting an Nginx server requires different steps according to different operating systems: Linux/Unix system: Install the Nginx package (for example, using apt-get or yum). Use systemctl to start an Nginx service (for example, sudo systemctl start nginx). Windows system: Download and install Windows binary files. Start Nginx using the nginx.exe executable (for example, nginx.exe -c conf\nginx.conf). No matter which operating system you use, you can access the server IP

How to check whether nginx is started How to check whether nginx is started Apr 14, 2025 pm 01:03 PM

How to confirm whether Nginx is started: 1. Use the command line: systemctl status nginx (Linux/Unix), netstat -ano | findstr 80 (Windows); 2. Check whether port 80 is open; 3. Check the Nginx startup message in the system log; 4. Use third-party tools, such as Nagios, Zabbix, and Icinga.

How to check the name of the docker container How to check the name of the docker container Apr 15, 2025 pm 12:21 PM

You can query the Docker container name by following the steps: List all containers (docker ps). Filter the container list (using the grep command). Gets the container name (located in the "NAMES" column).

How to configure nginx in Windows How to configure nginx in Windows Apr 14, 2025 pm 12:57 PM

How to configure Nginx in Windows? Install Nginx and create a virtual host configuration. Modify the main configuration file and include the virtual host configuration. Start or reload Nginx. Test the configuration and view the website. Selectively enable SSL and configure SSL certificates. Selectively set the firewall to allow port 80 and 443 traffic.

How to deploy jar program in nginx How to deploy jar program in nginx Apr 14, 2025 pm 12:09 PM

To deploy a JAR program on Nginx, seven steps need to be followed: 1) Install JRE, 2) Install Nginx, 3) Configure Nginx, 4) Deploy JAR, 5) Grant execution permissions, 6) Restart Nginx, 7) Verify deployment.

How to run nginx apache How to run nginx apache Apr 14, 2025 pm 12:33 PM

To get Nginx to run Apache, you need to: 1. Install Nginx and Apache; 2. Configure the Nginx agent; 3. Start Nginx and Apache; 4. Test the configuration to ensure that you can see Apache content after accessing the domain name. In addition, you need to pay attention to other matters such as port number matching, virtual host configuration, and SSL/TLS settings.

See all articles