I am using Ubuntu 13.04. I've installed Nginx and configured it with ISPConfig. Then, I wanted to install the passenger module. Because Nginx doesn't allow dynamic modules, I had it compiled from source.

First, I uninstalled Nginx (with apt-get remove --purge nginx nginx-full nginx-common) and started a new Nginx installation. I then used passenger advanced mod where I added some directives to .configure option as it was installed via apt-get (/usr/share.., /etc/nginx, /var/log location etc..)

NOTE: I grabbed the compile info from nginx -V). It successfully installed and then I ran the command:

root@webserver:/# /usr/share/nginx/sbin/nginx

but it throws this error:

nginx: [emerg] mkdir() "/var/lib/nginx/body" failed (2: No such file or directory)

What's wrong?

I didn't believe the solution would be so simple because I've been playing with it all day; mkdir nginx does work.

  • 5
    If you've solved your issue please write it up as an answer to your own question and then accept it. – slm Aug 29 '13 at 18:56

In my case, I created new directories:

mkdir -p /var/lib/nginx
mkdir -p /var/lib/nginx/body
mkdir -p /var/lib/nginx/fastcgi

That worked for me.

  • bash oneliner: mkdir -p /var/lib/nginx/{body,fastcgi} – diachedelic Sep 21 '18 at 8:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.