2

I can't start nginx for some reason.

The server is OpenSUSE; I have done the following:

  1. Installed http://nginx.org/download/nginx-1.0.5.tar.gz
  2. extracted the folder
  3. run ./configure
  4. make
  5. make install

The nginx have been extracted to /usr/local/nginx/sbin where I can see the nginx. But when I try to run any commands it says "command not found".

When running ./configure it says;

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"

which I guess is fine, even though in the log it says some stuff not found, but I don't think this is essential?

When running make:

-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

I can see the nginx, though, in sbin?

11
  • which system are you using?
    – vfbsilva
    Dec 8, 2017 at 17:27
  • I am using opensuse
    – StrawHat
    Dec 8, 2017 at 17:28
  • try systemctl start nginx
    – vfbsilva
    Dec 8, 2017 at 17:30
  • I did, it said Job for nginx.service failed. See "systemctl status nginx.service" and "journalctl -xn" for details.
    – StrawHat
    Dec 8, 2017 at 17:30
  • output of journal ctl plz
    – vfbsilva
    Dec 8, 2017 at 17:31

1 Answer 1

3

Could you verify the path the nginx executable is located at? It looks like two different paths:

/usr/local/sbin/ (path)

/usr/local/nginx/sbin/ (nginx executable)

Just because they both have /usr/local/ and /sbin/ in them doesn't make them the same, /usr/local/sbin/ is a different path than /usr/local/nginx/. Based on the paths you provided, /usr/local/sbin/ is being checked, but not /usr/local/nginx/sbin. You would want/need to executable moved, or add /usr/local/nginx/sbin to your path.

2
  • How do I add the path?
    – StrawHat
    Dec 8, 2017 at 17:37
  • If you just want to add it to your path, see this article: stackoverflow.com/a/14638025/5670331 As that answer mentions, you might be better off just creating a symlink as a more global/permanent solution.
    – Jason Rush
    Dec 8, 2017 at 17:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .