CGILua on Apache

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

CGILua on Apache

David Haley
Hi,

I've been having trouble getting CGILua to work on Apache 2.0. I downloaded the Kepler Project source, and edited the config file to use CGILUA_LAUNCHER = mod2, in addition to setting the paths as needed.

Compilation works fine, as does installation. This is where I'm not sure what needs to happen.

I tried putting the contents of launcher/mod2/mod2.conf into my Apache configuration.

At this point, if I do "apachectl configtest", I get the following:

# apachectl configtest
Syntax error on line 196 of /etc/httpd/conf/httpd.conf:
Cannot load /etc/httpd/modules/mod_lua.so into server: /etc/httpd/modules/mod_lua.so: undefined symbol: luaopen_base

(This problem goes away if I manually edit the mod2 makefile to statically link in liblualib)

But in any case, when I actually go to start Apache, it simply fails to start. No error messages anywhere that I can see.

I'm wondering if there's anything else I should be doing. The documentation is fairly sparse on how to get it working with Apache. I'd be more than happy to contribute to the documentation once I get this figured out.

Thanks!
Best,
David
Reply | Threaded
Open this post in threaded view
|

Re: CGILua on Apache

Tomas-14
  Hi David,

> # apachectl configtest
> Syntax error on line 196 of /etc/httpd/conf/httpd.conf:
> Cannot load /etc/httpd/modules/mod_lua.so into server:
> /etc/httpd/modules/mod_lua.so: undefined symbol: luaopen_base
>
> (This problem goes away if I manually edit the mod2 makefile to statically
> link in liblualib)
  Have you installed LuaBinaries Release 2?  It seems you're
using stock Lua distribution and in this case you could have a library
not correctly configured to Kepler.

> But in any case, when I actually go to start Apache, it simply fails to
> start. No error messages anywhere that I can see.
  Have you looked at the error logs?

  Regards,
  Tomas
Reply | Threaded
Open this post in threaded view
|

Re: CGILua on Apache

David Haley

Hi Tomas,

On this day of 2-8-2006 6:00 AM, Tomas saw fit to scribe:
>     Have you installed LuaBinaries Release 2?  It seems you're
> using stock Lua distribution and in this case you could have a library
> not correctly configured to Kepler.

I installed them, and now the configtest works. I think the problem was
that I wasn't building stock shared libraries, only static (didn't know
I needed shared). But I still can't start Apache -- see below.

>> But in any case, when I actually go to start Apache, it simply fails to
>> start. No error messages anywhere that I can see.
>     Have you looked at the error logs?

I'm not sure where to look. Nothing in /var/log/httpd is helpful;
error.log contains nothing useful.

I'm not sure exactly what needs to be done to set this up. For instance,
I'm not sure where mod2.lua is supposed to be. At the moment, it's in
$(LUA_DIR)/cgilua/mod2.lua which appears to be the default. I modified
the mod2 makefile to use liblua50.a from LuaBinaries R2 (as liblua.a is
the stock distribution).

The question is somewhat newbieish but I wish I knew how to see why
Apache is failing to start. Is there another log I should know about?

If necessary I will just go install Xavante and use that on a different
port to handle my Lua requests, but I'd rather just have Apache taking
care of everything since that's what's already set up. I need Apache at
the moment for its WebDAV support.

Thanks for your help, and sorry again for the newbieness...
- David


--
~David-Haley
http://david.the-haleys.org


Reply | Threaded
Open this post in threaded view
|

Re: CGILua on Apache

Tomas-14
  Hi David

> I'm not sure where to look. Nothing in /var/log/httpd is helpful; error.log
> contains nothing useful.
>
> I'm not sure exactly what needs to be done to set this up. For instance, I'm
> not sure where mod2.lua is supposed to be. At the moment, it's in
> $(LUA_DIR)/cgilua/mod2.lua which appears to be the default.
  mod2.lua is loaded mod_lua.so.  This file can be included in
the mod_lua.c if INCLUDE_LUA is defined (check the config file in Kepler's
root directory).  If it is not included, you should indicate where it is
located with LuaMain Apache directive (note that this directory is only
available if INCLUDE_LUA was NOT defined while compiling the module).
  If you have not included mod2.lua, you can put some code in it
to be sure it is being loaded (like opening a file or writting to stderr,
which should write to the default Apache log file -- not the log file
defined in VIrtualHost's).

> I modified the
> mod2 makefile to use liblua50.a from LuaBinaries R2 (as liblua.a is the stock
> distribution).
  I think we had problems trying to link to a static library
but I can't remember if it was on Linux or on MacOS X (I think it was on
MacOS X)...

  Hope it helps,
  Tomas
Reply | Threaded
Open this post in threaded view
|

Re: CGILua on Apache

David Haley

Hi Tomas,

On this day of 2-9-2006 4:38 AM, Tomas saw fit to scribe:

>> I'm not sure where to look. Nothing in /var/log/httpd is helpful;
>> error.log contains nothing useful.
>>
>> I'm not sure exactly what needs to be done to set this up. For
>> instance, I'm not sure where mod2.lua is supposed to be. At the
>> moment, it's in $(LUA_DIR)/cgilua/mod2.lua which appears to be the
>> default.
>     mod2.lua is loaded mod_lua.so.  This file can be included in
> the mod_lua.c if INCLUDE_LUA is defined (check the config file in
> Kepler's
> root directory).  If it is not included, you should indicate where it is
> located with LuaMain Apache directive (note that this directory is only
> available if INCLUDE_LUA was NOT defined while compiling the module).
>     If you have not included mod2.lua, you can put some code in it
> to be sure it is being loaded (like opening a file or writting to stderr,
> which should write to the default Apache log file -- not the log file
> defined in VIrtualHost's).

I tried adding Lua code for both writing to a file, and writing to
stderr -- both with INCLUDE_LUA and without. As far as I can tell,
Apache is not making it to that point.

For that matter, nothing *at all* gets printed to /var/log/httpd/error_log.

Could it be that Apache is not finding the shared Lua library? I
wouldn't see why: I have /usr/local/lib/liblua50.so.

It probably doesn't matter, but I'm using Fedora 4 on x86.

Thanks again for your help.
- David

--
~David-Haley
http://david.the-haleys.org