Home Backend Development PHP Tutorial Install nginx via rpm under linux

Install nginx via rpm under linux

Jul 29, 2016 am 09:07 AM
centos nginx release

1. Download the rpm package of nginx

[root@chen ~]# wget http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm
--2015-12-31 23:05:21--  http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm
正在解析主机 nginx.org... 206.251.255.63, 95.211.80.227, 2001:1af8:4060:a004:21::e3
正在连接 nginx.org|206.251.255.63|:80... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:4311 (4.2K) [application/x-redhat-package-manager]
正在保存至: “nginx-release-centos-6-0.el6.ngx.noarch.rpm”
 
100%[================================================>] 4,311       --.-K/s   in 0s     
 
2015-12-31 23:05:25 (39.1 MB/s) - 已保存 “nginx-release-centos-6-0.el6.ngx.noarch.rpm” [4311/4311])
Copy after login

2. Unzip the rpm package
[root@chen ~]# 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, key ID 7bd9bf62: NOKEY
Preparing...                ########################################### [100%]
   1:nginx-release-centos   ########################################### [100%]
Copy after login

3. Install nginx
[root@chen ~]# yum install nginx
已加载插件:fastestmirror, security
设置安装进程
Determining fastest mirrors
* base: mirrors.skyshe.cn
* extras: mirrors.skyshe.cn
* updates: mirrors.opencas.cn
base                                                               | 3.7 kB     00:00    
base/primary_db                                                    | 3.6 MB     00:05    
file:///mnt/repodata/repomd.xml: [Errno 14] Could not open/read file:///mnt/repodata/repomd.xml
尝试其他镜像。
extras                                                             | 3.4 kB     00:00    
extras/primary_db                                                  |  30 kB     00:00    
nginx                                                              | 2.9 kB     00:00    
nginx/primary_db                                                   | 6.8 kB     00:00    
updates                                                            | 3.4 kB     00:00    
updates/primary_db                                                 | 3.1 MB     00:18    
解决依赖关系
--> 执行事务检查
---> Package nginx.i386 0:1.8.0-1.el6.ngx will be 安装
--> 完成依赖关系计算
 
依赖关系解决
 
==========================================================================================
 软件包            架构             版本                          仓库               大小
==========================================================================================
正在安装:
 nginx             i386             1.8.0-1.el6.ngx               nginx             360 k
 
事务概要
==========================================================================================
Install       1 Package(s)
 
总下载量:360 k
Installed size: 835 k
确定吗?[y/N]:y
下载软件包:
nginx-1.8.0-1.el6.ngx.i386.rpm                                     | 360 kB     00:14    
运行 rpm_check_debug
执行事务测试
事务测试成功
执行事务
Warning: RPMDB altered outside of yum.
  正在安装   : nginx-1.8.0-1.el6.ngx.i386                                             1/1
----------------------------------------------------------------------
 
Thanks for using nginx!
 
Please find the official documentation for nginx here:
* http://nginx.org/en/docs/
 
Commercial subscriptions for nginx are available on:
* http://nginx.com/products/
 
----------------------------------------------------------------------
  Verifying  : nginx-1.8.0-1.el6.ngx.i386                                             1/1
 
已安装:
  nginx.i386 0:1.8.0-1.el6.ngx                                                           
 
完毕!
Copy after login

4. Test
[root@chen ~]# service nginx start
正在启动 nginx:                                           [确定]
[root@chen ~]# service nginx stop
停止 nginx:                                               [确定]
Copy after login

The above introduces the rpm installation of nginx under Linux, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

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)

Hot Topics

Java Tutorial
1653
14
PHP Tutorial
1251
29
C# Tutorial
1224
24
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).

Centos shutdown command line Centos shutdown command line Apr 14, 2025 pm 09:12 PM

The CentOS shutdown command is shutdown, and the syntax is shutdown [Options] Time [Information]. Options include: -h Stop the system immediately; -P Turn off the power after shutdown; -r restart; -t Waiting time. Times can be specified as immediate (now), minutes ( minutes), or a specific time (hh:mm). Added information can be displayed in system messages.

How to start containers by docker How to start containers by docker Apr 15, 2025 pm 12:27 PM

Docker container startup steps: Pull the container image: Run "docker pull [mirror name]". Create a container: Use "docker create [options] [mirror name] [commands and parameters]". Start the container: Execute "docker start [Container name or ID]". Check container status: Verify that the container is running with "docker ps".

How to optimize CentOS HDFS configuration How to optimize CentOS HDFS configuration Apr 14, 2025 pm 07:15 PM

Improve HDFS performance on CentOS: A comprehensive optimization guide to optimize HDFS (Hadoop distributed file system) on CentOS requires comprehensive consideration of hardware, system configuration and network settings. This article provides a series of optimization strategies to help you improve HDFS performance. 1. Hardware upgrade and selection resource expansion: Increase the CPU, memory and storage capacity of the server as much as possible. High-performance hardware: adopts high-performance network cards and switches to improve network throughput. 2. System configuration fine-tuning kernel parameter adjustment: Modify /etc/sysctl.conf file to optimize kernel parameters such as TCP connection number, file handle number and memory management. For example, adjust TCP connection status and buffer size

How to create containers for docker How to create containers for docker Apr 15, 2025 pm 12:18 PM

Create a container in Docker: 1. Pull the image: docker pull [mirror name] 2. Create a container: docker run [Options] [mirror name] [Command] 3. Start the container: docker start [Container name]

Centos configuration IP address Centos configuration IP address Apr 14, 2025 pm 09:06 PM

Steps to configure IP address in CentOS: View the current network configuration: ip addr Edit the network configuration file: sudo vi /etc/sysconfig/network-scripts/ifcfg-eth0 Change IP address: Edit IPADDR= Line changes the subnet mask and gateway (optional): Edit NETMASK= and GATEWAY= Lines Restart the network service: sudo systemctl restart network verification IP address: ip addr

Difference between centos and ubuntu Difference between centos and ubuntu Apr 14, 2025 pm 09:09 PM

The key differences between CentOS and Ubuntu are: origin (CentOS originates from Red Hat, for enterprises; Ubuntu originates from Debian, for individuals), package management (CentOS uses yum, focusing on stability; Ubuntu uses apt, for high update frequency), support cycle (CentOS provides 10 years of support, Ubuntu provides 5 years of LTS support), community support (CentOS focuses on stability, Ubuntu provides a wide range of tutorials and documents), uses (CentOS is biased towards servers, Ubuntu is suitable for servers and desktops), other differences include installation simplicity (CentOS is thin)

What are the common misunderstandings in CentOS HDFS configuration? What are the common misunderstandings in CentOS HDFS configuration? Apr 14, 2025 pm 07:12 PM

Common problems and solutions for Hadoop Distributed File System (HDFS) configuration under CentOS When building a HadoopHDFS cluster on CentOS, some common misconfigurations may lead to performance degradation, data loss and even the cluster cannot start. This article summarizes these common problems and their solutions to help you avoid these pitfalls and ensure the stability and efficient operation of your HDFS cluster. Rack-aware configuration error: Problem: Rack-aware information is not configured correctly, resulting in uneven distribution of data block replicas and increasing network load. Solution: Double check the rack-aware configuration in the hdfs-site.xml file and use hdfsdfsadmin-printTopo

See all articles