如何在linux下安装nginx
1个回答
展开全部
有2种方法:
1、rpm包安装:
[root@localhost ~]# vim /etc/yum.repos.d/nginx.repo
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/rhel/6/$basearch/
gpgcheck=0
enabled=1
[root@localhost ~]# yum -y install nginx
2、源码安装:
[root@localhost ~]# yum -y install pcre-devel zlib-devel
[root@localhost ~]# useradd -M -s /sbin/nologin nginx
[root@localhost ~]# tar zxf nginx-1.8.1.tar.gz
[root@localhost ~]# cd nginx-1.8.1
[root@localhost nginx-1.8.1]# ./configure \
--prefix=/usr/local/nginx \
--user=nginx \
--group=nginx \
--with-http_stub_status_module
[root@localhost nginx-1.8.1]# make
[root@localhost nginx-1.8.1]# make install
1、rpm包安装:
[root@localhost ~]# vim /etc/yum.repos.d/nginx.repo
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/rhel/6/$basearch/
gpgcheck=0
enabled=1
[root@localhost ~]# yum -y install nginx
2、源码安装:
[root@localhost ~]# yum -y install pcre-devel zlib-devel
[root@localhost ~]# useradd -M -s /sbin/nologin nginx
[root@localhost ~]# tar zxf nginx-1.8.1.tar.gz
[root@localhost ~]# cd nginx-1.8.1
[root@localhost nginx-1.8.1]# ./configure \
--prefix=/usr/local/nginx \
--user=nginx \
--group=nginx \
--with-http_stub_status_module
[root@localhost nginx-1.8.1]# make
[root@localhost nginx-1.8.1]# make install
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询