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

Failed to start apache24. Undefined symbol "lisp_module" #1

Open
lispstudent opened this issue Dec 8, 2022 · 5 comments
Open

Failed to start apache24. Undefined symbol "lisp_module" #1

lispstudent opened this issue Dec 8, 2022 · 5 comments

Comments

@lispstudent
Copy link

I am trying to install mod_lisp on FreeBSD 13.1, Apache 2.4

  1. I fetch the source
# curl -O https://github.com/mbattyani/mod_lisp/raw/master/mod_lisp2.c
  1. On FreeBSD at least, one needs to add the n switch to apxs, or else we get error,
apxs:Error: Sorry, cannot determine bootstrap symbol name.
apxs:Error: Please specify one with option `-n'.

So,

# apxs -i -c -n lisp_module mod_lisp2.c

/usr/local/share/apr/build-1/libtool --silent --mode=compile cc -prefer-pic -O2 -pipe -DLIBICONV_PLUG -fstack-protector-strong -fno-strict-aliasing    -I/usr/local/include/apache24  -I/usr/local/include/apr-1   -I/usr/local/include/apr-1 -I/usr/include -I/usr/local/include -I/usr/local/include/db5  -c -o mod_lisp2.lo mod_lisp2.c && touch mod_lisp2.slo
/usr/local/share/apr/build-1/libtool --silent --mode=link cc -fstack-protector-strong   -o mod_lisp2.la  -rpath /usr/local/libexec/apache24 -module -avoid-version    mod_lisp2.lo
/usr/local/share/apache24/build/instdso.sh SH_LIBTOOL='/usr/local/share/apr/build-1/libtool' mod_lisp2.la /usr/local/libexec/apache24
/usr/local/share/apr/build-1/libtool --mode=install install mod_lisp2.la /usr/local/libexec/apache24/
libtool: install: install .libs/mod_lisp2.so /usr/local/libexec/apache24/mod_lisp2.so
libtool: install: install .libs/mod_lisp2.lai /usr/local/libexec/apache24/mod_lisp2.la
libtool: install: install .libs/mod_lisp2.a /usr/local/libexec/apache24/mod_lisp2.a
libtool: install: chmod 644 /usr/local/libexec/apache24/mod_lisp2.a
libtool: install: ranlib /usr/local/libexec/apache24/mod_lisp2.a
chmod 755 /usr/local/libexec/apache24/mod_lisp2.so

Then, following README, I add the following directives to httpd.conf,

emacs /usr/local/etc/apache24/httpd.conf

LoadModule lisp_module libexec/apache24/mod_lisp2.so                                                     
ClearModuleList                                                                                          
AddModule mod_lisp.c                                                                                            

But when Apache starts I get Undefined symbol "lisp_module"

# service apache24 start
Performing sanity check on apache24 configuration:
httpd: Syntax error on line 537 of /usr/local/etc/apache24/httpd.conf: Can't locate API module structure `lisp_module' in file /usr/local/libexec/apache24/mod_lisp2.so: Undefined symbol "lisp_module"
Starting apache24.
httpd: Syntax error on line 537 of /usr/local/etc/apache24/httpd.conf: Can't locate API module structure `lisp_module' in file /usr/local/libexec/apache24/mod_lisp2.so: Undefined symbol "lisp_module"
/usr/local/etc/rc.d/apache24: WARNING: failed to start apache24

What am I doing wrong?

How can one fix the Undefined symbol "lisp_module" error?

@lispstudent
Copy link
Author

I am keen in having this fixed, as CGI is still a good approach to me as well to leverage Lisp code.

@svspire
Copy link

svspire commented Feb 2, 2023

Two suggestions:

  1. Make sure the "LoadModule lisp_module ..." line only appears once in your configuration file. Sometimes apxs will insert that line automatically; if you then edit the file and add the line manually then there will be two of them. You didn't use the -a option so this is probably not the issue.
  2. Remove the line starting with "AddModule" (and possibly the "ClearModuleList" line also). That line only makes sense in Apache 1.x, not 2.x.

@lispstudent
Copy link
Author

Thank you very much for looking at this.

  1. I checked, there is only one LoadModule lisp_module line.

  2. I have removed AddModule and ClearModuleList lines

Now I have only this line, added to a default httpd.conf file:

LoadModule lisp_module libexec/apache24/mod_lisp2.so

Error message is still the same, although now it is printed only once. Before it was twice.

# service apache24 restart
Performing sanity check on apache24 configuration:
httpd: Syntax error on line 537 of /usr/local/etc/apache24/httpd.conf: Can't locate API module structure `lisp_module' in file /usr/local/libexec/apache24/mod_lisp2.so: Undefined symbol "lisp_module"

I am seeing this on a freshly installed FreeBSD 13.1, with stock Apache2.4 installed from pkg.

I do not program in c, I would not know how to fix this on my side. Any help, hint, or manual page to look at would be much appreciated.

Thank you again for the advice!

@svspire
Copy link

svspire commented Feb 3, 2023

Look at everything in /usr/local/etc/apache24/ and try to take it back to the original state before you changed anything. The run the apxs command but this time add the -a option. This should automatically change either the httpd.conf file or a file within the ./extra folder (maybe).

Another thing to try is to use sudo to run the apxs command. It may be trying to write files and failing because it doesn't have permission.

I still can't figure out why it keeps telling you to use the -n option. I've never needed to do that. (But then I also don't have FreeBSD.)

@lispstudent
Copy link
Author

Thank you again for your time.

I have been installing apache 2.4 on a freshly installed, bare bone FreeBSD 13.1, using root account.

Just now I have tried to install mod_lisp on a freshly installed Ubuntu server 22.04.

I have followed the README.

Using user root:

  1. apt-get install apache2-dev

  2. curl -O https://github.com/mbattyani/mod_lisp/raw/master/mod_lisp2.c

  3. apxs -i -c mod_lisp2.c

Error message:

/usr/share/apr-1.0/build/libtool  --mode=compile --tag=disable-static x86_64-linux-gnu-gcc -prefer-pic -pipe -g -O2 -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security  -Wdate-time -D_FORTIFY_SOURCE=2   -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/include/apache2  -I/usr/include/apr-1.0   -I/usr/include/apr-1.0 -I/usr/include  -c -o mod_lisp2.lo mod_lisp2.c && touch mod_lisp2.slo
libtool: compile:  x86_64-linux-gnu-gcc -pipe -g -O2 -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -DLINUX -D_REENTRANT -D_GNU_SOURCE -I/usr/include/apache2 -I/usr/include/apr-1.0 -I/usr/include/apr-1.0 -I/usr/include -c mod_lisp2.c  -fPIC -DPIC -o .libs/mod_lisp2.o
/usr/share/apr-1.0/build/libtool  --mode=link --tag=disable-static x86_64-linux-gnu-gcc -Wl,--as-needed -Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects -Wl,-z,relro -Wl,-z,now    -o mod_lisp2.la  -rpath /usr/lib/apache2/modules -module -avoid-version    mod_lisp2.lo
libtool: link: x86_64-linux-gnu-gcc -shared  -fPIC -DPIC  .libs/mod_lisp2.o    -Wl,--as-needed -Wl,-Bsymbolic-functions -flto=auto -Wl,-z -Wl,relro -Wl,-z -Wl,now   -Wl,-soname -Wl,mod_lisp2.so -o .libs/mod_lisp2.so
libtool: link: ( cd ".libs" && rm -f "mod_lisp2.la" && ln -s "../mod_lisp2.la" "mod_lisp2.la" )
apxs:Error: Sorry, cannot determine bootstrap symbol name.
apxs:Error: Please specify one with option `-n'.

It would seem not related to FreeBSD only then?

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

2 participants