You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2020/07/24 07:40:18 UTC

[GitHub] [incubator-apisix] poidl commented on issue #1893: Documentation on listening to port 80?

poidl commented on issue #1893:
URL: https://github.com/apache/incubator-apisix/issues/1893#issuecomment-663389954


   Thanks for your help! To make it more reproducible I re-installed and attached an install script below. This installs to an unpriviliged user's home directory (note the `configure --prefix` for `openresty` and `luarocks` in the install script).
   
   This works without error:
   ```
   ./bin/apisix start
   ```
   
   But
   ```
   sudo ./bin/apisix start
   ```
   results in (`cat logs/error.log`)
   ```
   2020/07/24 09:31:03 [error] 11080#0: init_worker_by_lua error: ...er/programs/apache-apisix-1.4-incubating/apisix/init.lua:72: module 'resty.worker.events' not found:
           no field package.preload['resty.worker.events']
           no file '/home/labuser/programs/apache-apisix-1.4-incubating//deps/share/lua/5.1/resty/worker/events.lua'
           no file '/home/labuser/programs/apache-apisix-1.4-incubating//deps/share/lua/5.1/resty/worker/events/init.lua'
           no file '/home/labuser/programs/apache-apisix-1.4-incubating/resty/worker/events.lua'
           no file '/home/labuser/programs/apache-apisix-1.4-incubating/resty/worker/events/init.lua'
           no file '/home/labuser/programs/openresty_install/site/lualib/resty/worker/events.ljbc'
           no file '/home/labuser/programs/openresty_install/site/lualib/resty/worker/events/init.ljbc'
           no file '/home/labuser/programs/openresty_install/lualib/resty/worker/events.ljbc'
           no file '/home/labuser/programs/openresty_install/lualib/resty/worker/events/init.ljbc'
           no file '/home/labuser/programs/openresty_install/site/lualib/resty/worker/events.lua'
           no file '/home/labuser/programs/openresty_install/site/lualib/resty/worker/events/init.lua'
           no file '/home/labuser/programs/openresty_install/lualib/resty/worker/events.lua'
           no file '/home/labuser/programs/openresty_install/lualib/resty/worker/events/init.lua'
           no file './resty/worker/events.lua'
           no file '/home/labuser/programs/openresty_install/luajit/share/luajit-2.1.0-beta3/resty/worker/events.lua'
           no file '/usr/local/share/lua/5.1/resty/worker/events.lua'
           no file '/usr/local/share/lua/5.1/resty/worker/events/init.lua'
           no file '/home/labuser/programs/openresty_install/luajit/share/lua/5.1/resty/worker/events.lua'
           no file '/home/labuser/programs/openresty_install/luajit/share/lua/5.1/resty/worker/events/init.lua'
           no file '/usr/share/lua/5.3/resty/worker/events.lua'
           no file '/usr/share/lua/5.3/resty/worker/events/init.lua'
           no file '/usr/lib/lua/5.3/resty/worker/events.lua'
           no file '/usr/lib/lua/5.3/resty/worker/events/init.lua'
           no file './resty/worker/events.lua'
           no file './resty/worker/events/init.lua'
           no file '/home/labuser/programs/apache-apisix-1.4-incubating//deps/lib64/lua/5.1/resty/worker/events.so'
           no file '/home/labuser/programs/apache-apisix-1.4-incubating//deps/lib/lua/5.1/resty/worker/events.so'
           no file '/home/labuser/programs/openresty_install/site/lualib/resty/worker/events.so'
           no file '/home/labuser/programs/openresty_install/lualib/resty/worker/events.so'
           no file './resty/worker/events.so'
           no file '/usr/local/lib/lua/5.1/resty/worker/events.so'
           no file '/home/labuser/programs/openresty_install/luajit/lib/lua/5.1/resty/worker/events.so'
           no file '/usr/local/lib/lua/5.1/loadall.so'
           no file '/usr/lib/lua/5.3/resty/worker/events.so'
           no file '/usr/lib/lua/5.3/loadall.so'
           no file './resty/worker/events.so'
           no file '/home/labuser/programs/apache-apisix-1.4-incubating//deps/lib64/lua/5.1/resty.so'
           no file '/home/labuser/programs/apache-apisix-1.4-incubating//deps/lib/lua/5.1/resty.so'
           no file '/home/labuser/programs/openresty_install/site/lualib/resty.so'
           no file '/home/labuser/programs/openresty_install/lualib/resty.so'
           no file './resty.so'
           no file '/usr/local/lib/lua/5.1/resty.so'
           no file '/home/labuser/programs/openresty_install/luajit/lib/lua/5.1/resty.so'
           no file '/usr/local/lib/lua/5.1/loadall.so'
           no file '/usr/lib/lua/5.3/resty.so'
           no file '/usr/lib/lua/5.3/loadall.so'
           no file './resty.so'
   stack traceback:
           [C]: in function 'require'
           ...er/programs/apache-apisix-1.4-incubating/apisix/init.lua:72: in function 'http_init_worker'
           init_worker_by_lua:2: in main chunk
   ```
   In the github issue referenced above, a user said that nginx is `nobody` when apisix is started with sudo, and so it doesn't have permissions to read the lua configuration (if I understand correctly).
   
   Install script:
   ```
   #!/bin/bash -e
   
   # dependencies include: wget make gcc lua unzip which git
   
   BASE=/home/labuser/programs
   cd ~/programs
   
   REL=openresty-1.15.8.3
   
   wget -nc https://openresty.org/download/$REL.tar.gz
   tar -xzf $REL.tar.gz
   rm -r openresty_install ||:
   mkdir openresty_install
   cd $REL/ 
   ./configure -j2 --prefix=$BASE/openresty_install \
      --with-file-aio \
       --with-http_dav_module \
       --with-http_gzip_static_module \
       --with-http_realip_module \
       --with-http_ssl_module \
       --with-http_stub_status_module \
       --with-mail \
       --with-mail_ssl_module \
       --with-luajit \
       --with-pcre-jit \
       --with-http_v2_module \
       --with-stream \
       --with-stream_ssl_module \
       --with-http_iconv_module 
   make -j2
   sudo make install
   
   cd ..
   
   ################################################
   
   REL=luarocks-3.3.1
   
   wget -nc https://luarocks.org/releases/$REL.tar.gz
   tar zxpf $REL.tar.gz
   rm -r luarocks_install ||:
   mkdir luarocks_install
   cd $REL 
   ./configure --prefix=$BASE/luarocks_install
   make
   sudo make install
   
   cd ..
   
   # #####################################################################
   cd $BASE
   wget -nc http://www.apache.org/dist/incubator/apisix/1.4/apache-apisix-1.4-incubating-src.tar.gz
   tar zxvf apache-apisix-1.4-incubating-src.tar.gz
   cd apache-apisix-1.4-incubating
   make deps
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org