@@ -23,109 +23,36 @@ To compile nginx with this module, use an `--add-module` option to `configure`
23
23
./configure --add-module=path/to/this/module/directory
24
24
```
25
25
26
- # All commands
27
- Here's a list of all of the commands I used on a fresh CentOS VM to get this up and running
26
+ # Full ubuntu install example
28
27
29
28
```
30
- yum update
31
- yum -y groupinstall 'Development Tools'
32
- yum -y install unzip zip gunzip wget httpd-devel pcre perl pcre-devel zlib zlib-devel GeoIP GeoIP-devel openssl openssl-devel cmake git
33
- cd
34
- mkdir dl
35
- cd dl
36
- wget https://github.com/akheron/jansson/archive/2.8.zip
37
- unzip 2.8.zip
38
- ln -sf jansson-2.8 jansson
39
- cd jansson
40
- cmake .
41
- make
42
- make install
43
- cd ~/dl
44
- wget https://github.com/benmcollins/libjwt/archive/master.zip
45
- unzip master.zip
46
- ln -sf libjwt-master libjwt
47
- cd libjwt
48
- ```
49
-
50
- To compile libjwt on my mac I had to edit the ` CMakeLists.txt ` file and add this line at the top:
51
-
52
- ```
53
- include_directories(/usr/local/Cellar/openssl/1.0.2h_1/include/)
54
- ```
55
-
56
- To compile libjwt on my CentOS VM I had to edit the ` CMakeLists.txt ` file and add this flag to the list of ` CMAKE_C_FLAGS ` :
29
+ apt-get -y install curl wget git-core build-essential libjansson-dev libssl-dev libsslcommon2-dev libpcre3-dev software-properties-common openssl libjansson-dev autoconf libgeoip-dev
57
30
58
- ```
59
- -std=gnu99
60
- ```
61
- more commands...
62
-
63
- ```
64
- vi include/jwt.h
65
- vi libjwt/jwt.c
66
- vi CMakeLists.txt
67
- cmake .
68
- make jwt_static
69
-
70
- cd ~/dl
71
- git clone https://github.com/TeslaGov/ngx-http-auth-jwt-module
72
-
73
- cd ~/dl
74
- wget http://nginx.org/download/nginx-1.10.1.tar.gz
75
- tar -xzf nginx-1.10.1.tar.gz
76
- ln -sf nginx-1.10.1 nginx
77
- cd nginx
78
- ```
79
-
80
- You may need to change this configure line to support your needs
31
+ git clone https://github.com/benmcollins/libjwt
32
+ cd libjwt
33
+ autoreconf -i
34
+ ./configure --prefix=/usr --mandir=\${prefix}/share/man --infodir=\${prefix}/share/info
35
+ make all
36
+ make install
81
37
82
- ```
83
- ./configure
84
- --user=nginx \
85
- --group=nginx \
38
+ curl -s http://nginx.org/download/nginx-1.11.10.tar.gz | tar -zxf -
39
+ git clone https://github.com/freman/ngx-http-auth-jwt-module
40
+ cd nginx-1.11.10
41
+ ./configure \
42
+ --user=www-data \
43
+ --group=www-data \
86
44
--prefix=/etc/nginx \
87
45
--sbin-path=/usr/sbin/nginx \
88
46
--conf-path=/etc/nginx/nginx.conf \
89
47
--pid-path=/var/run/nginx.pid \
90
48
--lock-path=/var/run/nginx.lock \
91
49
--error-log-path=/var/log/nginx/error.log \
92
50
--http-log-path=/var/log/nginx/access.log \
51
+ --with-http_addition_module \
52
+ --with-http_geoip_module \
93
53
--with-http_gzip_static_module \
94
54
--with-http_stub_status_module \
95
55
--with-http_ssl_module \
96
56
--with-pcre \
97
- --add-module=/root/dl/ngx-http-auth-jwt-module/src
98
- ```
99
-
100
- At this point I needed to edit the Makefile. I couldn't figure out how to link in the dependent libraries via the configure command so I added them in by hand.
101
-
102
- I appended this to my CLFAGS line:
103
-
104
- ```
105
- -I /root/dl/libjwt/include -I /root/dl/jansson/src -std=gnu99
106
- ```
107
-
108
- I added these lines to objs/nginx list:
109
-
110
- ```
111
- objs/addon/ngx_http_auth_jwt_module/ngx_http_auth_jwt_module.o \
112
- /root/dl/libjwt/lib/libjwt.a \
113
- /usr/local/lib/libjansson.a
114
- ```
115
-
116
- I added these lines to the link command:
117
-
118
- ```
119
- objs/addon/ngx_http_auth_jwt_module/ngx_http_auth_jwt_module.o \
120
- -L /root/dl/libjwt/lib \
121
- -L /usr/local/lib \
122
- -ldl -lpthread -lcrypt -lpcre -lssl -lcrypto -ldl -lz -ljwt -ljansson \
123
- -Wl,-E
124
- ```
125
-
126
- ```
127
- vi Makefile
128
- make
129
- make install
130
- /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
131
- ```
57
+ --add-module=../ngx-http-auth-jwt-module
58
+ ```
0 commit comments