首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >启动nginx -命令未找到

启动nginx -命令未找到
EN

Unix & Linux用户
提问于 2017-12-08 17:24:10
回答 1查看 8.1K关注 0票数 2

因为某种原因我不能启动nginx。

服务器是OpenSUSE;我完成了以下操作:

  1. 安装http://nginx.org/download/nginx-1.0.5.tar.gz
  2. 解压文件夹
  3. 运行/配置
  4. 制作
  5. 制造安装

nginx已经被提取到/usr/local/ nginx /sbin,在这里我可以看到nginx。但是当我试图运行任何命令时,它会说“命令没有找到”。

在运行时。/配置它说;

代码语言:javascript
复制
Configuration summary
  + using system PCRE library
  + OpenSSL library is not used
  + using system zlib library

  nginx path prefix: "/usr/local/nginx"
  nginx binary file: "/usr/local/nginx/sbin/nginx"
  nginx modules path: "/usr/local/nginx/modules"
  nginx configuration prefix: "/usr/local/nginx/conf"
  nginx configuration file: "/usr/local/nginx/conf/nginx.conf"
  nginx pid file: "/usr/local/nginx/logs/nginx.pid"
  nginx error log file: "/usr/local/nginx/logs/error.log"
  nginx http access log file: "/usr/local/nginx/logs/access.log"
  nginx http client request body temporary files: "client_body_temp"
  nginx http proxy temporary files: "proxy_temp"
  nginx http fastcgi temporary files: "fastcgi_temp"
  nginx http uwsgi temporary files: "uwsgi_temp"
  nginx http scgi temporary files: "scgi_temp"

我想这很好,即使在日志里写着一些东西没有找到,但我不认为这是必要的?

跑步时要:

代码语言:javascript
复制
-ldl -lpthread -lcrypt -lpcre -lz \
-Wl,-E
sed -e "s|%%PREFIX%%|/usr/local/nginx|" \
    -e "s|%%PID_PATH%%|/usr/local/nginx/logs/nginx.pid|" \
    -e "s|%%CONF_PATH%%|/usr/local/nginx/conf/nginx.conf|" \
    -e "s|%%ERROR_LOG_PATH%%|/usr/local/nginx/logs/error.log|" \
    < man/nginx.8 > objs/nginx.8
make[1]: Leaving directory '/usr/local/src/nginx/nginx-1.12.2'

when running echo $PATH  it says;

    /usr/sbin/:/usr/sbin/:/sbin:/usr/sbin:/usr/local/sbin:/root/bin:/usr/local/bin:/usr/bin:/bin:/usr/games

不过,我能在垃圾桶里看到它吗?

EN

回答 1

Unix & Linux用户

发布于 2017-12-08 17:35:45

您能验证nginx可执行文件所在的路径吗?它看起来像是两条不同的路径:

/usr/local/sbin/ (path) /usr/local/nginx/sbin/ (nginx可执行文件)

仅仅因为它们都有/usr/local//sbin/,并不能使它们相同,/usr/local/sbin//usr/local/nginx/是不同的路径。根据您提供的路径,正在检查/usr/local/sbin/,但不检查/usr/local/nginx/sbin。您希望/需要执行已移动的可执行文件,或将/usr/local/nginx/sbin添加到路径中。

票数 3
EN
页面原文内容由Unix & Linux提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://unix.stackexchange.com/questions/409784

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档