oneinstack 安装 Nginx 失败 No such file or directory

nginx: [error] open() “/run/nginx.pid“ failed (2: No such file or directory) nginx.pid文件,在刚安装的时候就是没有,其实在启动 nginx 时自动生成,里面存放的是 当前 nginx 住进程的PID ,nginx相关操作都与要调用这个文件。 阅读详情

oneinstack 安装 Nginx 失败原因排查

问题描述

今天在复现尚硅谷Nginx教学的过程中,需要试用oneinstack安装ECS的环境。链接: 尚硅谷Nginx

oneinstack自动安装命令:

wget -c http://mirrors.oneinstack.com/oneinstack.tar.gz && tar xzf oneinstack.tar.gz && ./oneinstack/install.sh --nginx_option 1 --php_option 9 --db_option 2 --dbinstallmethod 1 --dbrootpwd oneinstack --firewall  --reboot 

在安装过程Nginx启动失败。
/usr/local下无nginx相关目录。
重新试用oneinstack命令安装:

./oneinstack/install.sh --nginx_option 1

发现报错信息:

Nginx installed successfully!
mv: cannot stat ‘/usr/local/nginx/conf/nginx.conf’: No such file or directory
/bin/cp: cannot create regular file ‘/usr/local/nginx/conf/nginx.conf’: No such file or directory
include/nginx.sh: line 60: /usr/local/nginx/conf/proxy.conf: No such file or directory
sed: can't read /usr/local/nginx/conf/nginx.conf: No such file or directory
sed: can't read /usr/local/nginx/conf/nginx.conf: No such file or directory
sed: can't read /usr/local/nginx/conf/nginx.conf: No such file or directory
Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details.

问题原因

在/oneinstack/include/nginx.sh脚本处发现:

  ./configure --prefix=${nginx_install_dir} --user=${run_user} --group=${run_group} --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-http_ssl_module --with-stream --with-stream_ssl_preread_module --with-stream_ssl_module --with-http_gzip_static_module --with-http_realip_module --with-http_flv_module --with-http_mp4_module --with-openssl=../openssl-${openssl11_ver} --with-pcre=../pcre-${pcre_ver} --with-pcre-jit --with-ld-opt='-ljemalloc' ${nginx_modules_options}
  make -j ${THREAD} && make install
  if [ -e "${nginx_install_dir}/conf/nginx.conf" ]; then
    popd > /dev/null
    # 问题原因:安装成功后仍然删除 ${nginx_install_dir}* 下的所有内容!
    rm -rf pcre-${pcre_ver}* openssl-${openssl11_ver}* nginx-${nginx_ver}* ${nginx_install_dir}*
    echo "${CSUCCESS}Nginx installed successfully! ${CEND}"
  else
    rm -rf pcre-${pcre_ver}* openssl-${openssl11_ver}* nginx-${nginx_ver}* ${nginx_install_dir}*
    echo "${CFAILURE}Nginx install failed, Please Contact the author! ${CEND}"
    kill -9 $$; exit 1;
  fi

nginx_install_dir 的配置可以在/oneinstack/options.conf l里可以找到

nginx_install_dir=/usr/local/nginx

正是我们习惯安装的nginx目录。

因此断定问题原因:安装成功后仍然删除 ${nginx_install_dir}* 下的所有内容!导致后续脚本执行失败,找不到文件!严重怀疑作者摸鱼粘错了!没有检验!

解决方案

手动将安装脚本/oneinstack/include/nginx.sh的错误行更换为:

rm -rf pcre-${pcre_ver}* openssl-${openssl11_ver}* nginx-${nginx_ver}*

取消目录的删除即可!
更换后重新执行:

./oneinstack/install.sh --nginx_option 1

安装成功!

总结

还是比较坑的!感觉像在帮作者改bug!作为一个这么多人知道的开源项目实在不应该犯这种错误,这增加了好多人的排错时间。官网上没有预留提问和反馈窗口!在这里先记录了,希望作者能知道或者有人能转告一下!毕竟还是挺花费时间的!选择oneinstack就是图省事,结果还花大量时间排错实在是南辕北辙!

数据科学常见模型总结(二)-倾向性得分匹配模型 PSM的核心思想是从未受干预的用户群体中,找到和干预对象一模一样的用户,这样就可以把因果效应归因到干预上。 阅读详情

相关推荐

5分钟搞定三网话费余额查询:手把手教你用PHP+HTML搭建查询系统(含API调用避坑指南)

本文详细介绍了如何使用PHP+HTML快速搭建三网话费余额查询系统,涵盖API调用避坑指南、前端UI设计及性能优化。通过统一处理移动、电信、联通三大运营商接口差异,实现高可用查询功能,并提供安全防护与生产部署建议,帮助开发者高效构建稳定可靠的话费查询工具。

weixin_29016833的博客 259

nginx按照传统方式启动时找不到nginx文件(No such file or directory)

将host.access.log这个日志文档删除之后,再使用./nginx启动便可以了。分析错误发现,可能是log目录下的host.access.log日志文档的问题。然后我想到了使用./nginx命令启动试试。然而使用ls命令时却发现是有nginx的。具体原因先暂时留在此处,之后再另作调查。出现该报错,提示没有此文件或者目录。在log目录中找到这个文件。使用该命令启动nginx。...

m0_63297028的博客 9361

手把手教你用Simulink搭建单相全桥逆变器(附单电流闭环控制仿真文件)

本文详细介绍了如何在Simulink中搭建单相全桥逆变器并实现单电流闭环控制。从功率主电路建模、核心器件参数设置,到控制系统的PI调节与前馈补偿,提供了完整的仿真步骤与调试技巧。文章旨在通过动手实践,帮助读者跨越理论与仿真的鸿沟,深入理解电力电子闭环控制的核心原理。

d6e7f8g9h的博客 316

解决nginx出现 No such file or directory问题

[root@localhost /]# cd /usr/local/nginx/sbin/ [root@localhost sbin]# ./nginx ngx_http_fastdfs_set pid=10802 [root@localhost sbin]# nginx: [emerg] open() "/var/run/nginx/nginx.pid" failed (2: No such file or directory) ^C [root@localhost sbin]# cd /va...

am的博客 1万+

蓝桥杯单片机省一经验分享1:基础篇.含详细代码与应试技巧

含详细代码、驱动修改与应试技巧

qq_53529450的博客 1万+

2025.06.17【WGS】|多样品VCF文件中每个样品SNP数统计方法详解(含代码与注释)

摘要:本文介绍了一种从合并后的VCF文件中统计每个样品SNP数目的方法。通过解析VCF文件中的GT字段,排除纯合参考(0/0)和缺失(./.)的基因型,准确计算各样本的SNP位点数。文中提供了完整的Python脚本,利用bcftools工具高效处理大规模VCF文件,并支持输出SNP统计结果。该方法适用于群体遗传学和RAD-seq等高通量测序数据分析的质控环节,还可扩展为统计杂合/纯合SNP等进阶需求。脚本使用简单,只需输入VCF文件即可生成样本-SNP数目的统计报表。

1698

nginx启动报错:nginx: [error] open() “/var/run/nginx/nginx.pid“ failed (2: No such file or directory) 的解决

问题:   重启虚拟机后,再次重启nginx会报错:nginx: [error] open() "/var/run/nginx/nginx.pid" failed (2: No such file or directory) 问题原因:   提示信息说明在/var/run/nginx/目录下找不到nginx.pid文件,解决方式有两种:     第一种方式:创建默认目录/var/run/nginx/;     第二种方式:修改nginx.conf文件,指定pid文件所在目录...

qq_39244882的博客 2万+

LM Studio Bionic:本地AI智能体从部署到实战完整指南

AI智能体作为能够自主规划、执行多步任务的人工智能系统,其核心原理在于结合大语言模型的推理能力与工具调用机制。通过状态保持和任务分解算法,智能体实现了从单次问答到持续协作的技术跃迁。在工程实践中,这种架构显著降低了复杂任务自动化的门槛,特别适用于数据敏感场景和定制化需求。以Tesla V100等专业硬件为例,本地部署能充分发挥其大显存优势,支持更高精度的模型量化格式。在实际应用层面,智能体可无缝集成到代码审查、文档生成等开发工作流中,而LM Studio Bionic通过统一界面整合了模型服务、任务规划器等

weixin_29053695的博客 650

nginx启动时报错,No such file or directory

今天运行nginx时,突然报这个错,感到很疑惑: 查了资料后,发现原因是: 没有nginx.pid 这个文件。 每次当我们停止nginx时(nginx -s stop) ,nginx 会把 /usr/local/var/run/ 路径下名为nginx.pid 的文件删掉 解决方案: 直接启动nginx,重新生成nginx.pid就可以了: nginx 以配置文件的方式启动(查看配置文件路径): $ nginx -t nginx -c /etc/nginx/nginx.conf ...

qq_39380155的博客 2万+

IsaacLab 从入门到精通(一) 环境配置和依赖安装

本系列文章将针对机器人操作任务中的强化学习平台IsaacLab提供较为全面的教程

DejaWu33的博客 1万+

基于RK3588平台的高分辨率多摄像头系统深度优化:从48M单摄到双摄分时复用的完整解决方案

本文深入解析了RK3588平台的高分辨率摄像头实现方案。重点介绍了:1)RK3588的MIPI PHY硬件架构,包括DCPHY和DPHY的资源配置及工作模式;2)双ISP合成技术,通过并行处理提升48M高分辨率图像的处理能力;3)以OV50C40传感器为例,详细展示了48M单摄系统的硬件连接、I2C设备配置和关键参数设置。文章为开发者提供了从硬件连接到软件配置的完整技术方案,有助于实现高性能嵌入式视觉系统。

FJN110的博客 675

oneinstack在配置ssl的时候nginx: [error] open() "/var/run/nginx.pid" failed (2: No such file or directory)

在配置HTTPS的时候:Do you want to redirect all HTTP requests to HTTPS? [y/n]: y 输入了y,出现了 nginx: [error] open() "/var/run/nginx.pid" failed (2: No such file or directory) 遇到这个问题进入nginx.conf的文件目录下运行语句:nginx...

Fall_In_Love_With的博客 582

2025华为od机试真题B卷【停车场费用统计】Python实现

2025华为od机试真题B卷【停车场费用统计】Python实现

MISAYAONE的博客 536

nginx日志报错:No such file or directory

no such file or directory

LiGuogang 4573

SIMATIC S7-1200, S7-1500 PID 控制[手册]

SIMATIC S7-1200, S7-1500 PID 控制[手册]

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

nginx: [error] open() “/var/run/nginx/nginx.pid“ failed (2: No such file or directory)

2. 如果您在启动 Nginx 时遇到该错误消息,可能是因为 `/usr/local/nginx/logs/` 目录不存在。您可以尝试手动创建该目录,并确保其拥有适当的权限。在 Nginx 配置文件中查找 `error_log` 和 `pid` 配置指令,并检查路径是否正确。请注意,上述命令的用户和组可能因您的系统而异。如果不确定,请参考您的 Nginx 配置文件中的用户和组设置。请尝试上述方法来解决这个问题。3. 如果找不到 pid 文件,您可以尝试在命令行中指定一个自定义的 pid 文件路径。

javaxueba的博客 9868

ssm框架搭建

这个是一个在idea上成功跑起来的ssm框架项目,保存在这里方便以后使用直接下载

nginx 启动报错“var/run/nginx/nginx.pid" no such file or directory解决方法

        今天刚搭建的nginx服务器启动时,报错“var/run/nginx/nginx.pid" no such file or directory,按照他的意思我在var/run/新建了一个文件夹nginx,重新启动,启动成功。 但是当我虚拟机重启后依然报错“var/run/nginx/nginx.pid" no such file or directory,进入var/run/下的...

搬砖刘疯狂 1万+

NTscan扫描工具

ntscan是一个扫描器,可以扫描没有密码和弱密码的共享,先到配置文件中填写猜测的用户名和密码,扫描过程中右侧出现的是扫描日志。

Nginx的下载和使用,安装到Linux出现-bash: ./nginx: No such file or directory解决办法

Windows本地: Linux服务器: whereis nginx 找到目录 比如我的显示 /usr/local/nginx/ cd /usr/local/nginx/ 进入这个目录 ./nginx 执行nginx 这就是启动了 4 查看nginx 的状态 ps -ef | grep nginx 出现master 则启动成功 5 关闭nginx 命令 kill -9 8725(进程号 上面的) 则关闭nginx 停止 nginx 命令: ./nginx -s stop 7.重启nginx

LongKai_G 1万+

解决nginx: [error] open() “/usr/local/nginx/logs/nginx.pid“ failed (2: No such file or directory)错误

则kill掉占用进程即可。然后重启Nginx即可。

xinxian1768的博客 5476

nginx: [error] open() “/usr/local/nginx/logs/nginx.pid“ failed (2: No such file or directory)

启动Nginx时候报错:nginx: [error] open() “/usr/local/nginx/logs/nginx.pid” failed (2: No such file or directory) 解决方案 每次遇到还都不一样,这里我遇到了两种,在此分享 情况一:nginx.conf的nginx.pid被注释了 进入nginx.conf目录编辑 sudo vi /usr/local/nginx/conf/nginx.conf 把注释取消掉,再重新启动Nginx就OK了 sudo nginx

流楚丶格念的博客 3万+

nginx(No such file or directory与invalid PID number)

1.启动 /usr/local/nginx/sbin/nginx 2.重启 /usr/local/nginx/sbin/nginx -s reload 3.关闭 /usr/local/nginx/sbin/nginx -s stop 4.检验配置文件 /usr/local/nginx/sbin/nginx -t 5.再启动nginx服务时,无法正常启动,报错误信息如下 [root@localhost nginx]# /usr/local/nginx/sbin/nginx

kali_yao的博客 1720

nginx: [error] open() "/run/nginx.pid" failed (2: No such file or directory)

1.安装完nginx后,执行/usr/sbin/nginx -s reload 报错: nginx: [error] open() "/run/nginx.pid" failed (2: No such file or directory) 2.原因:由于没有nginx.pid 文件,当每一次安装或每次当我们停止nginx时(nginx -s stop) ,nginx 会把 /usr/local...

zhang20080528yeahnet的专栏 1万+

报错:nginx [emerg] open() etcnginxnginx.conf failed (2 No such file or directory)

我需要保证与etc/nginx路径对应的挂载路径存有nginx.conf配置文件,我才能将对应的宿主机目录挂载到容器的etc/nginx路径。:这里很奇怪,我需要挂载的是容器中的/etc/nginx/路径,是一个目录。,报错信息如下:“/etc/nginx/mime.types” failed (2: No such file or directory) in /etc/nginx/nginx.conf:15,意思是找不到mime.types文件…挂载到容器/etc/nginx路径下。

m0_70484213的博客 3518

Nginx(1) 安装Nginx的2种方式(阿里云CentOS7.3服务器)

首先来了解一下Nginx是什么?为什么我们要选择它? Nginx是俄罗斯人编写的十分轻量级的HTTP服务器,是一个高性能的 Web 和反向代理服务器, 它具有有很多非常优越的特性: 作为 Web 服务器:相比 Apache,Nginx 使用更少的资源,支持更多的并发连接,体现更高的效率,这点使 Nginx 尤其受到虚拟主机提供商的欢迎。能够支持高达 50,000 个并发连接数的响应,感谢 Ngin...

郑清 773

linux卸载oneinstack,centos中安装oneinstack遇到的问题总结

安装oneinstack时,在进行到Nginx安装的过程中出现错误make[2]: Leaving directory `/oneinstack/oneinstack/src/openssl-1.1.1g’make[1]: Leaving directory `/oneinstack/oneinstack/src/nginx-1.18.0′make: *** [build] Error 2Ngin...

weixin_42510900的博客 796

针对Nginx启动报错“nginx: [error] open() ‘/var/run/nginx.pid‘ failed (2: No such file or directory)“的排查与解决过

该案例表明,处理PID文件缺失类故障时,需优先锁定配置文件变更记录,其次排查目录权限和路径有效性。直接修改nginx.conf中pid指令指向稳定存储区域(如logs目录),可避免因临时目录清空导致的重复故障。

m0_64295612的博客 2465
上一篇: 多线程经典问题:生产者-消费者
下一篇: vmware虚拟机占用C盘问题
Sweetbreads
博客等级 码龄10年 29粉丝 7原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值