2.安裝nginx
nginx搭建、查看nginx相關信息
yum list | grep nginx
collectd-nginx.x86_64 4.10.9-1.el6 epel
munin-nginx.noarch 2.0.25-2.el6 epel
nginx.x86_64 1.0.15-11.el6 epel
nginx-filesystem.noarch 1.0.15-11.el6 epel
owncloud-nginx.noarch 7.0.5-2.el6 epel
yum info nginx
Loaded plugins: security
Available Packages
Name : nginx
Arch : x86_64
Version : 1.0.15
Release : 11.el6
Size : 404 k
Repo : epel
Summary : A high performance web server and reverse proxy server
URL : http://nginx.org/
License : BSD
Description : Nginx is a web server and a reverse proxy server for HTTP, SMTP, POP3 and
: IMAP protocols, with a strong focus on high concurrency, performance and
: low memory usage.
發現版本很低,于是追加 nginx 的 yum 倉庫,創建一個文件 /etc/yum.repos.d/nginx.repo,并將下面的內容復制進去
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=0
enabled=1
編輯并保存/etc/yum.repos.d/nginx.repo文件后,在命令行下執行
yum list | grep nginx
collectd-nginx.x86_64 4.10.9-1.el6 epel
munin-nginx.noarch 2.0.25-2.el6 epel
nginx.x86_64 1.6.3-1.el6.ngx nginx
nginx-debug.x86_64 1.6.3-1.el6.ngx nginx
nginx-debuginfo.x86_64 1.6.3-1.el6.ngx nginx
nginx-filesystem.noarch 1.0.15-11.el6 epel
nginx-nr-agent.noarch 2.0.0-7.el6.ngx nginx
owncloud-nginx.noarch 7.0.5-2.el6 epel
發現最新的穩定版1.6.3,于是直接執行
yum install nginx -y
安裝完成,下面直接就可以啟動Nginx了:
/etc/init.d/nginx start
Starting nginx: [ OK ]
現在Nginx已經啟動了,直接訪問服務器就能看到Nginx歡迎頁面了的。
Nginx的命令以及配置文件位置:
/etc/init.d/nginx start # 啟動Nginx服務
/etc/init.d/nginx stop # 停止Nginx服務
/etc/nginx/nginx.conf # Nginx配置文件位置
版权声明:本站所有资料均为网友推荐收集整理而来,仅供学习和研究交流使用。
工作时间:8:00-18:00
客服电话
电子邮件
admin@qq.com
扫码二维码
获取最新动态