centos下yum安装nginx

在/etc/yum.repos.d/目录下建立一个源配置文件nginx.reponginx

cd   /etc/yum.repos.d/web

vim  nginx.repovim

填写以下内容:centos

【nginx】tcp

name=nginx   repourl

baseurl=http://nginx.org/packages/centos/6/$basearch/ip

gpgcheck=0登录

enabled=1配置

保存。service

yum   install  nginx      ---安装nginx

service    nginx   start    -启动nginx

Starting nginx: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)

解决:使用命令关闭占用80端口的程序

sudo   fuser   -k   80/tcp        ---关闭占用80端口

netstat  -anpt |grep nginx     ---查看nginx是否已存在

find    /  -name  nginx.conf      ---查看nginx.conf配置文件保存在哪一个路径下

修改配置文件以前,先登陆web网页查看下nginx是否已启动成功

http:ip地址:80

相关文章
相关标签/搜索