Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unknown directive "ssl_certificate_by_lua" #400

Closed
dirkmoors opened this issue Jul 15, 2015 · 12 comments
Closed

unknown directive "ssl_certificate_by_lua" #400

dirkmoors opened this issue Jul 15, 2015 · 12 comments

Comments

@dirkmoors
Copy link

Hello,

I'm trying to get the master branch working, but I'm running into the following issue:

......
cassandra_1 | INFO  09:52:38 Binding thrift service to /0.0.0.0:9160
cassandra_1 | INFO  09:52:38 Listening for thrift clients...
kong_1      | nginx: [emerg] unknown directive "ssl_certificate_by_lua" in /usr/local/kong/nginx.conf:75
kong_1      | [INFO] Using configuration: /etc/kong/kong.yml
kong_1      | [INFO] Kong version.......0.4.0
kong_1      |        Proxy HTTP port....8000
kong_1      |        Proxy HTTPS port...8443
kong_1      |        Admin API port.....8001
kong_1      |        dnsmasq port.......8053
kong_1      |        Database...........cassandra keepalive=60000 port=9042 timeout=1000 hosts=cassandra keyspace=kong
kong_1      | [INFO] Connecting to the database...
kong_1      | [INFO] dnsmasq started
kong_1      | [INFO] dnsmasq stopped
kong_1      | [ERR] Could not start Kong
kong_kong_1 exited with code 1
Gracefully stopping... (press Ctrl+C again to force)

How can I solve that?

Thanks in advance!

@subnetmarco
Copy link
Member

What OS are you using?

@subnetmarco
Copy link
Member

Before cloning master, can you actually install Kong version 0.3.2 first from the website? Then after installing it, run:

rm -rf /etc/kong/

And master should work.

@dirkmoors
Copy link
Author

@thefosk Thanks, I'll give it a try and I'll report back here. I'm trying to build Kong (from master branch) inside docker, and integrate it into a docker-compose setup with dockerfile mashape/cassandra.

@dirkmoors
Copy link
Author

@thefosk I've attempted to run the following command before continuing and building the source from the master branch:

set -x \
    && apt-get update \
    && apt-get install -y --no-install-recommends sudo wget ca-certificates netcat lua5.1 openssl libpcre3 dnsmasq \
    && cd /tmp/ \
    && wget https://github.com/Mashape/kong/releases/download/0.3.2/kong-0.3.2.jessie_all.deb \
    && dpkg -i kong-0.3.2.*.deb \
    && rm -rf /etc/kong/

Unfortunatly, I got the same output when continuing:

...
cassandra_1 | INFO  11:51:10 Starting listening for CQL clients on /0.0.0.0:9042...
cassandra_1 | INFO  11:51:10 Binding thrift service to /0.0.0.0:9160
cassandra_1 | INFO  11:51:10 Listening for thrift clients...
kong_1      | nginx: [emerg] unknown directive "ssl_certificate_by_lua" in /usr/local/kong/nginx.conf:75
kong_1      | [INFO] Using configuration: /etc/kong/kong.yml
kong_1      | [INFO] Kong version.......0.4.0
kong_1      |        Proxy HTTP port....8000
kong_1      |        Proxy HTTPS port...8443
kong_1      |        Admin API port.....8001
kong_1      |        dnsmasq port.......8053
kong_1      |        Database...........cassandra keepalive=60000 port=9042 timeout=1000 hosts=cassandra keyspace=kong
kong_1      | [INFO] Connecting to the database...
kong_1      | [INFO] dnsmasq started
kong_1      | [INFO] dnsmasq stopped
kong_1      | [ERR] Could not start Kong
kong_kong_1 exited with code 1
Gracefully stopping... (press Ctrl+C again to force)
Stopping kong_cassandra_1...

P.s. I'm using debian:jessie as baseimage for my Dockerfile

@dirkmoors
Copy link
Author

@thefosk I've created a gist that illustrates more what I currently have: https://gist.github.com/dirkmoors/b466461b0a7ee9d45fc0

@ghost
Copy link

ghost commented Jul 15, 2015

I received the same error when using an unpatched version of OpenResty. When I patched and installed OpenResty then the error went away.

@dirkmoors
Copy link
Author

@jasonmotylinski-dowjones What do you mean by 'patched' vs 'unpatched'? Could you elaborate more on how you fixed it?

@ghost
Copy link

ghost commented Jul 16, 2015

@dirkmoors Here in the packaging scripts OpenResty source code is downloaded, patched, and built:

https://github.com/Mashape/kong/blob/master/distributions/.build-package-script.sh#L159-L182

These commands will output OpenResty to /tmp/build/out which isn't quite what you need to build and run from the source code.

I submitted a pull request for creating a Vagrant box. In this diff OpenResty is built and install into it's default location which solved the problem for me:

https://github.com/Mashape/kong/pull/396/files#diff-b870d96f4620ca5a0a12ef59aeab7b6e

@subnetmarco
Copy link
Member

Instead of manually patching OpenResty (it's an option), you can take the following steps:

  1. Download the latest released version of Kong, and install it on your development machine. This will install all the required dependencies.
  2. Execute sudo rm -rf /etc/kong/
  3. Clone the repo, and make the repo your working directory
  4. Execute sudo make install
  5. Execute kong start

@ghost
Copy link

ghost commented Jul 16, 2015

+1

@dirkmoors
Copy link
Author

@thefosk & @jasonmotylinski-dowjones thanks! That seems to have worked!

@dirkmoors
Copy link
Author

@thefosk The complete solution I came up with:
https://github.com/vikingco/docker-kong

I've also created a proposal to integrate my approach into your docker-kong repo:
Kong/docker-kong#8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants