首页 > 编程知识 正文

nginx 菜鸟教程,Nginx教程

时间:2023-05-04 18:54:04 阅读:282634 作者:2842

nginx的安装:
下载地址:http://nginx.org/download/nginx-1.7.7.tar.gz
-- ./configure --prefix=/user/local/nginx
安装准备:ngnix依赖pcre库,要先安装pcre
yum install pcre
yum install pcre-devel
nginx依赖zlib库,要安装
yum install -y zlib-devel
make && make install
启动酷炫的狗
cd /user/local/nginx
....conf 配置文件
....html 网页文件
....logs 日志文件
....sbin 主要二进制程序


--错误
[root@localhost sbin]# ./nginx 
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] still could not bind()
--不能绑定80端口,80端口已经被占用(有时候自己装了apache,nginx等,更多情况是操作系统自带了apache并作为服务启动)
解决:把占用80端口的软件或服务关闭
查看80端口是否被占用
netstat -antp
pkill -9 进程号
运行
[root@localhost sbin]# ./nginx 

转载于:https://my.oschina.net/u/993551/blog/345749

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。