The following is: centos6.5 install nginx through yum
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
Here is nginx The currently used configuration file
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:
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!