How to install nginx through yum in centos6.5

WBOY
Release: 2023-05-19 10:28:06
forward
1317 people have browsed it

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
Copy after login

After installing epel

yum -y install nginx
Copy after login

After the installation is completed

service nginx start 启动nginx
Copy after login

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!

Related labels:
source:yisu.com
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!