Compli mod_lwt on ubuntu 11.10 fail..

50 views
Skip to first unread message

Lee Bowen

unread,
Jan 1, 2012, 8:20:06 PM1/1/12
to Lua Web Tools Discussion
Hi all, first thanks for this good mod of apache , i got some problem
in compli the mod_lwt.
my computer is Ubuntu 11.10 , i386 cpu. apache2,php5.3, below is my
console log

anthony@pc-2694783:~/opt/lua-web-tools$ cd mod_lwt/
anthony@pc-2694783:~/opt/lua-web-tools/mod_lwt$ ls
apache.c apache.h etc httpd.lua Makefile mod_lwt.c samples
template.c template.h util.c util.h wsapi.lua
anthony@pc-2694783:~/opt/lua-web-tools/mod_lwt$ vi Makefile
anthony@pc-2694783:~/opt/lua-web-tools/mod_lwt$ make
/usr/bin/apxs2 -c -Wc,-Wall -I/usr/include/lua5.1 -llua5.1 mod_lwt.c
util.c template.c apache.c
/usr/share/apr-1.0/build/libtool --silent --mode=compile --tag=disable-
static i686-linux-gnu-gcc -prefer-pic -DLINUX=2 -D_FORTIFY_SOURCE=2 -
D_GNU_SOURCE -D_LARGEFILE64_SOURCE -D_REENTRANT -I/usr/include/apr-1.0
-I/usr/include/openssl -I/usr/include/xmltok -pthread -I/usr/
include/apache2 -I/usr/include/apr-1.0 -I/usr/include/apr-1.0 -
Wall -I/usr/include/lua5.1 -c -o mod_lwt.lo mod_lwt.c && touch
mod_lwt.slo
/usr/share/apr-1.0/build/libtool --silent --mode=compile --tag=disable-
static i686-linux-gnu-gcc -prefer-pic -DLINUX=2 -D_FORTIFY_SOURCE=2 -
D_GNU_SOURCE -D_LARGEFILE64_SOURCE -D_REENTRANT -I/usr/include/apr-1.0
-I/usr/include/openssl -I/usr/include/xmltok -pthread -I/usr/
include/apache2 -I/usr/include/apr-1.0 -I/usr/include/apr-1.0 -
Wall -I/usr/include/lua5.1 -c -o util.lo util.c && touch util.slo
/usr/share/apr-1.0/build/libtool --silent --mode=compile --tag=disable-
static i686-linux-gnu-gcc -prefer-pic -DLINUX=2 -D_FORTIFY_SOURCE=2 -
D_GNU_SOURCE -D_LARGEFILE64_SOURCE -D_REENTRANT -I/usr/include/apr-1.0
-I/usr/include/openssl -I/usr/include/xmltok -pthread -I/usr/
include/apache2 -I/usr/include/apr-1.0 -I/usr/include/apr-1.0 -
Wall -I/usr/include/lua5.1 -c -o template.lo template.c && touch
template.slo
/usr/share/apr-1.0/build/libtool --silent --mode=compile --tag=disable-
static i686-linux-gnu-gcc -prefer-pic -DLINUX=2 -D_FORTIFY_SOURCE=2 -
D_GNU_SOURCE -D_LARGEFILE64_SOURCE -D_REENTRANT -I/usr/include/apr-1.0
-I/usr/include/openssl -I/usr/include/xmltok -pthread -I/usr/
include/apache2 -I/usr/include/apr-1.0 -I/usr/include/apr-1.0 -
Wall -I/usr/include/lua5.1 -c -o apache.lo apache.c && touch
apache.slo
/usr/share/apr-1.0/build/libtool --silent --mode=link --tag=disable-
static i686-linux-gnu-gcc -o mod_lwt.la -llua5.1 -rpath /usr/lib/
apache2/modules -module -avoid-version apache.lo template.lo
util.lo mod_lwt.lo
anthony@pc-2694783:~/opt/lua-web-tools/mod_lwt$ sudo make install
/usr/bin/apxs2 -i -a mod_lwt.la
/usr/share/apache2/build/instdso.sh SH_LIBTOOL='/usr/share/apr-1.0/
build/libtool' mod_lwt.la /usr/lib/apache2/modules
/usr/share/apr-1.0/build/libtool --mode=install cp mod_lwt.la /usr/lib/
apache2/modules/
libtool: install: cp .libs/mod_lwt.so /usr/lib/apache2/modules/
mod_lwt.so
libtool: install: cp .libs/mod_lwt.lai /usr/lib/apache2/modules/
mod_lwt.la
libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/
bin:/sbin:/bin:/usr/X11R6/bin:/sbin" ldconfig -n /usr/lib/apache2/
modules
----------------------------------------------------------------------
Libraries have been installed in:
/usr/lib/apache2/modules

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,-rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
chmod 644 /usr/lib/apache2/modules/mod_lwt.so
[preparing module `lwt' in /etc/apache2/mods-available/lwt.load]
Enabling module lwt.
To activate the new configuration, you need to run:
service apache2 restart
mkdir -p /usr/local/share/lua/5.1
cp httpd.lua /usr/local/share/lua/5.1
mkdir -p /usr/local/share/lua/5.1/httpd
cp wsapi.lua /usr/local/share/lua/5.1/httpd
anthony@pc-2694783:~/opt/lua-web-tools/mod_lwt$ sudo service apache2
* Usage: /etc/init.d/apache2 {start|stop|graceful-stop|restart|reload|
force-reload|start-htcacheclean|stop-htcacheclean|status}
anthony@pc-2694783:~/opt/lua-web-tools/mod_lwt$ sudo service apache2
reload
apache2: Syntax error on line 203 of /etc/apache2/apache2.conf: Syntax
error on line 1 of /etc/apache2/mods-enabled/lwt.load: Cannot load /
usr/lib/apache2/modules/mod_lwt.so into server: /usr/lib/apache2/
modules/mod_lwt.so: undefined symbol: clock_gettime
Action 'configtest' failed.
The Apache error log may have more information.
...fail!
anthony@pc-2694783:~/opt/lua-web-tools/mod_lwt$ sudo ldd /usr/lib/
apache2/modules/mod_lwt.so
linux-gate.so.1 => (0x00637000)
liblua5.1.so.0 => /usr/lib/i386-linux-gnu/liblua5.1.so.0
(0x006a0000)
libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0x00c81000)
libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0x00110000)
libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0x00eda000)
/lib/ld-linux.so.2 (0x00b36000)

now i don't know where is going error.

Andre Naef

unread,
Jan 2, 2012, 12:26:55 PM1/2/12
to lua-web-to...@googlegroups.com
The problem would appear to be the following:

apache2: Syntax error on line 203 of /etc/apache2/apache2.conf:
Syntax error on line 1 of /etc/apache2/mods-enabled/lwt.load: Cannot load
/usr/lib/apache2/modules/mod_lwt.so into server:
/usr/lib/apache2/modules/mod_lwt.so: undefined symbol: clock_gettime

clock_gettime is used by mod_lwt for performance diagnostic logging. To
properly use clock_gettime, one must link with librt. This is missing in the
Makefile as explicit linking with librt is not required on Ubuntu 10.04 LTS,
probably due to some other part of Apache HTTP Server already linking with
librt. Anyway, to resolve this problem, please edit mod_lwt/Makefile and
replace the following line:

${APACHE2_BIN}/${APXS} -c -Wc,-Wall -I${LUA_INCLUDE} -llua5.1
mod_lwt.c util.c template.c apache.c

Replacement:

${APACHE2_BIN}/${APXS} -c -Wc,-Wall -I${LUA_INCLUDE} -llua5.1 -lrt
mod_lwt.c util.c template.c apache.c

Please let me know if this resolves the problem.

Also note that in order to use mod_lwt you will need to configure the
module, e.g. by creating or copying /etc/apache2/mods-available/lwt.conf as
per:
http://code.google.com/p/lua-web-tools/wiki/Installation

文佬

unread,
Jan 5, 2012, 3:41:54 AM1/5/12
to lua-web-to...@googlegroups.com
yes!, is working, the problem is resolve, thanks for help.

2012/1/3 Andre Naef <an...@naef.com>
Reply all
Reply to author
Forward
0 new messages