Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to install nginx and no matter what I do, nginx can't seem to find my openssl path. It looks like it's searching for files that don't exist in any of the openssl directories. Below is my make output. I've tried to specify various paths for nginx to look in for openssl.

[root@server nginx-0.8.54]# make
make -f objs/Makefile
make[1]: Entering directory `/root/nginx-0.8.54'
cd /usr/local/ssl \
        && make clean \
        && ./config --prefix=/usr/local/ssl/.openssl no-shared  no-threads \
        && make \
        && make install LIBDIR=lib
make[2]: Entering directory `/usr/local/ssl'
make[2]: *** No rule to make target `clean'.  Stop.
make[2]: Leaving directory `/usr/local/ssl'
make[1]: *** [/usr/local/ssl/.openssl/include/openssl/ssl.h] Error 2
make[1]: Leaving directory `/root/nginx-0.8.54'
make: *** [build] Error 2

Anyone have any thoughts on this?

share|improve this question

migrated from stackoverflow.com Nov 2 '11 at 5:54

This question came from our site for professional and enthusiast programmers.

This can also occur when your nginx configure uses relative paths. It finds the libraries much more reliably if full paths from / are used instead.

Doesn't work: ./configure --with-openssl=../openssl-source

Works: ./configure --with-openssl=/home/build/src/openssl-source

share|improve this answer
Great, worked for me. I was using ~/src/openssl-1.0.1 and it was failing. Using /home/me/src/openssl-1.0.1 fixed it. – jaygooby Jun 27 '14 at 10:44
up vote 1 down vote accepted

I can't quite recall exactly what the issue was here, but I'm assuming that a symlink to /usr/local/ssl (or openssl?) to wherever openssl actually resides would solve the issue. I haven't had any problems installing nginx with SSL support in Ubuntu 10.04 with the default OpenSSL. So I would recommend anyone struggling with this to try that out.

Also, you probably need the correct dev packages installed. Here is what I typically installing prior to install nginx..

2  apt-get update
3  apt-get install gcc
4  apt-get install g++
5  wget http://www.python.org/ftp/python/2.7/Python-2.7.tgz
6  wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.12.tar.gz
7  wget http://zlib.net/zlib-1.2.5.tar.gz
8  ls
9  gzip -d pcre-8.12.tar.gz 
10  gzip -d zlib-1.2.5.tar.gz 
11  gzip -d Python-2.7.tgz 
12  tar -xvf zlib-1.2.5.tar 
13  cd zlib-1.2.5
14  ./configure 
15  make
16  ls
17  Makefile
18  ls
19  ./configure 
20  make
21  sudo apt-get install build-essential
22  make
23  make install
24  cd ..
25  ls
26  tar -xvf pcre-8.12.tar 
27  cd pcre-8.12
28  ./configure --prefix=/usr --enable-unicode-properties
29  make
30  make install
31  cd ..
32  ls
33  tar -xvf Python-2.7.tar 
34  apt-get install openssl
35  cd Python-2.7
36  apt-get install libssl-dev
37  apt-get install libperl-dev
38  ./configure --help
39  ./configure --enable-ipv6
40  make
41  make install
share|improve this answer

openssl headers are usually provided by libssl-dev on Ubuntu. There's also a --with-openssl=DIR ./configure option for nginx that lets you manually specify the path to openssl sources. Any reason why you're building it from source instead of using your package manager?

share|improve this answer
package managers aren't the latest versions. I'd rather upgrade everything myself. I'm running on CentOS 5.5 though. I'm using the --with-openssl=DIR option, but it's looking for files in my openssl path that don't exist. – Chris Mar 11 '11 at 2:03
You'll need libssl-devel on CentOS. – mech-hisui Mar 11 '11 at 2:04
thank you, i'll try that. – Chris Mar 11 '11 at 2:05
The package is named differently than that on CentOS.. I ended up switching to Ubuntu and got everything working. Thanks for the help though. – Chris Mar 13 '11 at 8:25
In current Ubuntu the command is ./configure --with-openssl=/usr/include/openssl/ – Nathan V Sep 21 '15 at 19:48

Running "yum install openssl-devel" seems lot easier than switching to ubuntu.

Had the same issue as the OP. I had openssl installed but nginx could find it when compil but the pointer to libssl-devel helped me

share|improve this answer

For Zlib

untar the zlib tar file and then configure it

Path - /opt/app/workload/nginx-test/nginx-1.8.0/zlib/zlib-1.2.8

./configure --prefix=/opt/app/workload/nginx-test/nginx-1.8.0/zlib/zlib-1.2.8
make install


Untar PCRE file then configure it

Path - /opt/app/workload/nginx-test/nginx-1.8.0/pcre/pcre-8.36

./configure --prefix=/opt/app/workload/nginx-test/nginx-1.8.0/pcre/pcre-8.36

make install

Just untar the file no need to configure it, Nginx will use it by it self

for openssl

Path - /opt/app/workload/nginx-test/nginx-1.8.0/openssl-1.0.1l

For Nginx

./configure --prefix=/opt/app/workload/nginx-test/nginx-1.8.0/nginx --with-pcre=/opt/app/workload/nginx-test/nginx-1.8.0/pcre/pcre-8.36 --with-zlib=/opt/app/workload/nginx-test/nginx-1.8.0/zlib/zlib-1.2.8 --with-http_ssl_module --with-openssl=/opt/app/workload/nginx-test/nginx-1.8.0/openssl-1.0.1l
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.