Home > Backend Development > PHP Tutorial > Installation of nginx under Centos

Installation of nginx under Centos

WBOY
Release: 2016-08-08 09:21:06
Original
984 people have browsed it

Introduction

nginx is a high-performance http and reverse proxy server that is widely used for its stability, rich functionality, and low energy consumption. This article will demonstrate how to configure and install nginx on fedora16, and integrate tomcat for server load balancing configuration.

Installation

In order to make Centos install nginx quickly and simply, the installation mode using Centos yum is used here, that is, you can use yum install nginx installation mode, which is compiled and installed relative to the source code, so The method is relatively simple and easier for beginners to get started.

1. Before installing nginx, you must first configure a repository. Then this configuration is to add a yum installation library file for the service. Centos will automatically go online to find the corresponding installation file

Need to create files / etc/yum.repos.d/nginx.repo , command: vi /etc/yum.repos.d/nginx.repo

After creating the file, the configuration is as follows:

(To edit the file under Linux, Just vi nginx.repo and enter i to enter the editing state. After editing, press esc to exit the editing state, then enter: wq to save and exit

[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=0
enabled=1
Copy after login
save and exit (:wq to save)

2 , enter: yum list nginx The appropriate version of nginx will be displayed, as shown below:

3, enter yum install nginx to complete the installation.

Start and stop nginx

Enter service nginx start to complete the startup

Service nginx stop Stop the service

After the startup is completed: You can enter http://ip/ in the browser to complete the test, the port number The default is 80

Copyright statement: This article is an original article by the blogger and may not be reproduced without the blogger's permission

.

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

Related labels:
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template