Linux下nginx安装
2016-01-22 15:01
567 查看
centos直接yum安装nginx
Ubuntu下安装nginx,直接apt-get install nginx就行了,很方便。1.rpm -ivh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm
2.查看yum的nginx信息
yum info nginx
3,安装并启动nignx
[root@server ~]# yum install nginx
[root@server ~]# service nginx start
Starting nginx: [ OK ]
4,然后进入浏览器,输入http://192.168.0.161/测试,如果看到
service nginx reload
nginx -s reload
nginx -t -c /usr/nginx/conf/nginx.conf
或者
nginx -t (推荐)
或
/usr/nginx/sbin/nginx -t
==============================
[html] view plaincopy
自动安装选择最快的源
[root@localhost ~]# yum install yum-fastestmirror
这里 我已经安装过,运行结果如下
[html] view plaincopy
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
* base: ftp.riken.jp
* epel: mirrors.zju.edu.cn
* extras: ftp.riken.jp
* updates: ftp.riken.jp
Setting up Install Process
Package yum-plugin-fastestmirror-1.1.30-30.el6.noarch already installed and latest version
安装nginx
yum install nginx
[html] view plaincopy
[root@localhost ~]# yum install nginx
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
* base: ftp.riken.jp
* epel: mirrors.opencas.cn
* extras: ftp.riken.jp
* updates: ftp.riken.jp
Setting up Install Process
Package nginx-1.8.0-1.el6.ngx.x86_64 already installed and latest version
平滑升级
yum update nginx
执行命令前,首先配置nginx 源
[html] view plaincopy
[root@localhost ~]# vim /etc/yum.repos.d/nginx.repo
[html] view plaincopy
#nginx.repo
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/6/$basearch/
gpgcheck=0
enabled=1
执行:yum update nginx
Complete!
[root@localhost ~]# service nginx stop
停止 nginx: [确定]
[root@localhost ~]# service nginx start
正在启动 nginx: [确定]
[root@localhost ~]# nginx -v
nginx version: nginx/1.8.0
相关文章推荐
- dokuwiki在nginx的配置
- ubuntu编译安装nginx
- linux下nginx负载均衡部署
- zabbix 监控 nginx
- nginx windows版本 1024限制
- 解决NGINX+PHP-FPM failed to ptrace(PEEKDATA) Input/output error出错问题
- 解决NGINX+PHP-FPM failed to ptrace(PEEKDATA) Input/output error出错问题
- nginx
- Nginx配置文件nginx.conf 总结
- Linux中为flask框架网站配置uwsgi+nginx服务器
- nginx启动不了
- 配置 nginx 支持 f4v视频格式播放
- Nginx负载均衡(主备)+Keepalived
- 负载均衡之Nginx的安装
- Ubuntu中Nginx的安装与配置
- 通过Nginx服务器获取大文件MD5值的配置方法
- nginx配置虚拟主机
- 关于Nginx+Gunicorn+uwsgi+后端框架到app架构梳理和思考
- ubuntu+web.py+fastcgi+nginx
- windows+web.py+fastcgi+nginx