Home  >  Article  >  Operation and Maintenance  >  How to install nginx through yum in centos6.5

How to install nginx through yum in centos6.5

王林
王林forward
2023-05-13 23:16:12927browse

The following is: centos6.5 install nginx through yum

How to install nginx through yum in centos6.5

Prompt no package nginx available You need to install epe first:

yum install epel-release

After installing epel

yum -y install nginx

After the installation is completed

service nginx start 启动nginx

You can see the nginx interface by accessing the machine IP in the browser.

If you cannot access, check the Linux firewall status. Add port 80 access

After nginx starts, we need to modify the configuration file as needed. You can first use ps-ef|grep nginx to view

How to install nginx through yum in centos6.5

Here is nginx The currently used configuration file

How to install nginx through yum in centos6.5

worker_processes is generally set to the number of system cores (check the number of system cores more /proc/cpuinfo |grep "physical id"|grep "0"|wc -l)

/etc/nginx/conf.d/ contains additional configuration files.

Later configure it here, such as the location of some static resources.

For example, if I want all files under /data/html to be accessed through nginx load balancing, simply modify the following configuration:

How to install nginx through yum in centos6.5

The above is the detailed content of How to install nginx through yum in centos6.5. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete