IT忍者神龟之RHEL / Centos 6: Install Nginx Using Yum Command 翻译
来源:互联网 发布:php的数组函数 编辑:程序博客网 时间:2024/05/29 15:42
How can I install Nginx web server On CentOS Linux 6 or Red Hat Enterprise Linux 6 using yum command?
怎么用yun源方式安装Nginx到 web server centOs 和Red hat 6linux系统。
Step #1: Install nginx repo
Type the following wget command to install nginx yum configuration file:# cd /tmp
CentOS Linux v6.x user type the following command:# wget http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm
# rpm -ivh nginx-release-centos-6-0.el6.ngx.noarch.rpm
RHEL v6.x user type the following command:# wget http://nginx.org/packages/rhel/6/noarch/RPMS/nginx-release-rhel-6-0.el6.ngx.noarch.rpm
# rpm -ivh nginx-release-rhel-6-0.el6.ngx.noarch.rpm
Sample outputs:
warning: nginx-release-rhel-6-0.el6.ngx.noarch.rpm: Header V4 RSA/SHA1 Signature, key ID 7bd9bf62: NOKEYPreparing... ########################################### [100%] 1:nginx-release-rhel ###########################################
Step #2: Install nginx web-server
Type the following yum command to install nginx web-server:# yum install nginx
Sample outputs:
Step #3: Turn on nginx service
Type the following command:# chkconfig nginx on
How do I start / stop / restart nginx web-server?
Type the following commands:# service nginx start
# service nginx stop
# service nginx restart
# service nginx status
# service nginx reload
Step #4: Configuration files
- Default configuration directory: /etc/nginx/ nginx的目录
- Default SSL and vhost config directory: /etc/nginx/conf.d/ SSL协议 和 虚拟机
- Default log file directory: /var/log/nginx/ 日志目录
- Default document root directory: /usr/share/nginx/html 默认的首页
- Default configuration file: /etc/nginx/nginx.conf nginx的配置文件
- Default server access log file: /var/log/nginx/access.log nginx的访问日志
- Default server access log file: /var/log/nginx/error.log nginx的错误日志
To edit the nginx configuration file, enter:# vi /etc/nginx/nginx.conf
根据你的系统的cpu数量设置 worker_processes 数量
Set or update worker_processes as follows (this must be set to CPU(s) in your system. Use the lscpu | grep ‘^CPU(s)’ command to list the number of CPUs in the server)
worker_processes 2;
Turn on gzip support:
gzip on;
Save and close the file. Edit the file /etc/nginx/conf.d/default.conf, enter:# vi /etc/nginx/conf.d/default.conf
Set IP address and TCP port number:
listen 202.54.1.1.1:80;
Set server name:
server_name www.cyberciti.biz;
Save and close the file. Start the server:# service nginx start
# netstat -tulpn | grep :80
# ps aux | grep nginx
Edit the file /etc/sysconfig/iptables, enter:# vi /etc/sysconfig/iptables
Add the following lines, ensuring that they appear before the final LOG and DROP lines for the INPUT chain to open port 80:
Save and close the file. Finally, restart the firewall:# service iptables restart
- IT忍者神龟之RHEL / Centos 6: Install Nginx Using Yum Command 翻译
- RHEL / Centos 6: Install Nginx Using Yum Command
- RHEL / Centos 6: Install Nginx Using Yum Command
- RHEL / Centos 6: Install Nginx Using Yum Command
- How To Install nginx on CentOS 6 with yum
- How To Install nginx on CentOS 6 with yum
- How to Install Ruby 2.1.1 on CentOS & RHEL 6 using RVM
- CentOS直接yum install nginx 办法
- IT忍者神龟之Redis+Tomcat+Nginx集群实现Session共享
- rhel 安装Centos yum
- centos yum install nginx No package nginx available
- Install yum On RHEL 4
- 二:2.How To Install nginx on CentOS 6 with yum
- Install LEMP (Linux, Nginx, MySQL 5.5.29, PHP 5.4.11) on RHEL/CentOS 5-6 & Fedora 18-12
- centos 6 install nginx php
- RHEL / CentOS 7 install MongoDB
- IT忍者神龟之Html规范
- IT忍者神龟之css规范
- iOS 最简单的资料
- 一次配置ssh 密钥互相登陆的troubeshooting
- mysql移植到arm11的嵌入式linux系统上
- VR室内定位系统小结
- 【find】文件查找
- IT忍者神龟之RHEL / Centos 6: Install Nginx Using Yum Command 翻译
- hdu 1078 FatMouse and Cheese(记忆化搜索)
- 华为OJ 坐标移动
- Android动画——Tween动画之Set
- ajax跨域访问的问题解决
- Spring Aop详尽教程
- visio UML图 视频学习
- Hadoop Core、HBase 、ZooKeeper
- 查找-顺序表查找