网站首页 > 技术教程 正文
Linux版本:CentOS7 64位
在安装nginx前首先要确认系统中安装了gcc、pcre-devel、zlib-devel、openssl-devel。
Linux下检查是否安装过某软件包
安装命令:
yum -y install gcc pcre-devel zlib-devel openssl openssl-devel
下载“nginx-1.9.9.tar.gz”,移动到/usr/local/下。
## 解压
tar -zxvf nginx-1.9.9.tar.gz
##进入nginx目录
cd nginx-1.9.9
## 配置
./configure --prefix=/usr/local/nginx
# make
make
make install
OK,现在可以执行make 了。
\
执行make、make install命令
测试是否安装成功
# cd到刚才配置的安装目录/usr/loca/nginx/
./sbin/nginx -t
错误信息:
nginx: [alert] could not open error log file: open() "/usr/local/nginx/logs/error.log" failed (2: No such file or directory)
2016/09/13 19:08:56 [emerg] 6996#0: open() "/usr/local/nginx/logs/access.log" failed (2: No such file or directory)
原因分析:nginx/目录下没有logs文件夹
解决方法:
mkdir logs
chmod 700 logs
正常情况的信息输出:
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
启动nginx
cd /usr/local/nginx/sbin
./nginx //启动nginx
在浏览器中输入服务器的ip地址,如:192.168.1.12
如果打不开,可能是80端口防火墙未开放
猜你喜欢
- 2024-10-10 Linux下Docker部署Nginx并配置IPv6,实现公网访问
- 2024-10-10 nginx-linux服务器内核参数的优化
- 2024-09-12 如何在 LINUX 虚拟机上安装 NGINX Web 服务器
- 2024-09-12 【linux】Nginx 反向代理与负载均衡
- 2024-09-12 linux 安装nginx(linux安装nginx1.8)
- 2024-09-12 Linux下Nginx相关常用操作(linux+nginx)
- 2024-09-12 Linux搭建nginx,在window环境中访问
- 2024-09-12 nginx在linux下如何安装(linux怎么安装nginx)
- 2024-09-12 linux服务器下Nginx的搭建和部署(linux服务器nginx集群搭建)
- 2024-09-12 Linux运维笔记——Nginx详细安装部署
你 发表评论:
欢迎- 最近发表
- 标签列表
-
- 下划线是什么 (87)
- 精美网站 (58)
- qq登录界面 (90)
- nginx 命令 (82)
- nginx .http (73)
- nginx lua (70)
- nginx 重定向 (68)
- Nginx超时 (65)
- nginx 监控 (57)
- odbc (59)
- rar密码破解工具 (62)
- annotation (71)
- 红黑树 (57)
- 智力题 (62)
- php空间申请 (61)
- 按键精灵 注册码 (69)
- 软件测试报告 (59)
- ntcreatefile (64)
- 闪动文字 (56)
- guid (66)
- abap (63)
- mpeg 2 (65)
- column (63)
- dreamweaver教程 (57)
- excel行列转换 (56)
本文暂时没有评论,来添加一个吧(●'◡'●)