网站首页 > 博客文章 正文
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-05 Nginx + FastCGI 程序(C/C++) 搭建高性能web service
- 2024-10-05 Docker使用Nginx制作静态文件服务器
- 2024-10-05 使用nginx将服务器升级为https(nginx代理服务器配置)
- 2024-10-05 vue项目打包后部署到nginx(vue打包 nginx)
- 2024-10-05 Nginx Windows详细安装部署教程(nginx安装及配置教程)
- 2024-10-05 Vue实战091:Vue项目部署到nginx服务器
- 2024-10-05 Zabbix4.0企业级搭建实战(1)LNMP之Nginx服务器编译安装
- 2024-10-05 Linux上安装Nginx服务器(linux安装nginx详细步骤)
- 2024-10-05 Nginx 整合 FastDFS 实现文件服务器
- 2024-10-05 Linux中如何简单快速安装nginx以及如何配置
你 发表评论:
欢迎- 最近发表
- 标签列表
-
- ifneq (61)
- 字符串长度在线 (61)
- googlecloud (64)
- messagesource (56)
- promise.race (63)
- 2019cad序列号和密钥激活码 (62)
- window.performance (66)
- qt删除文件夹 (72)
- mysqlcaching_sha2_password (64)
- ubuntu升级gcc (58)
- nacos启动失败 (64)
- ssh-add (70)
- jwt漏洞 (58)
- macos14下载 (58)
- yarnnode (62)
- abstractqueuedsynchronizer (64)
- source~/.bashrc没有那个文件或目录 (65)
- springboot整合activiti工作流 (70)
- jmeter插件下载 (61)
- 抓包分析 (60)
- idea创建mavenweb项目 (65)
- vue回到顶部 (57)
- qcombobox样式表 (68)
- tomcatundertow (58)
- pastemac (61)
本文暂时没有评论,来添加一个吧(●'◡'●)