Press "Enter" to skip to content

Nginx安装

yum安装:
配置yum源
cat /etc/yum.repos.d/nginx.repo
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/6/\$basearch/
gpgcheck=0
enabled=1
安装nginnx
yum install -y nginx
设置nginx开机启动
chkconfig nginx on
默认路径:
/etc/nginx/nginx.conf 配置文件默认目录
/var/log/nginx 日志默认目录
/usr/sbin/nginx 启动路径
此安装方法可直接service启动nginx

编译安装:
cd /home/app
wget http://nginx.org/download/nginx-1.11.5.tar.gz #下载nginx源码
tar zxvf nginx-1.11.5.tar.gz #解压
cd nginx-1.11.5
yum install gcc make gd-devel libjpeg-devel libpng-devel libxml2-devel bzip2-dev pcre-devel gcc-c++ #安装依赖
./configure --prefix=/home/app/nginx --with-http_stub_status_module --with-pcre
make
make install

Be First to Comment

发表评论

电子邮件地址不会被公开。 必填项已用*标注