Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am using CentOS 5.

I am trying using Mod_Security which requires liblua. I was not able to find lua on the default repos. I prefer not to use any third party repos. This in mind, I downloaded the lua source from the offical site. After compiling the only file even close is liblua.a. I need a liblua-5.1(.4).so file for Apache.

How do I make a .so file for liblua?

share|improve this question

3 Answers 3

up vote 2 down vote accepted

Grab a similar-enough SRPM and rebuild it, preferably with mock.

EDIT:

Oh great, now you've done it. See what happens when I get bored?

share|improve this answer
    
Can you clarify? I haven't used mock, I take it you recommended it for testing the install first? I attempted a rpm -i [rpm name] but it complained the MD5 sum did not match for file lua-5.1.4-autotoolize.patch. –  Joshua Enfield May 12 '10 at 21:22
    
lol thank you much. –  Joshua Enfield May 12 '10 at 21:43

Desiring to compile from source rather than enable a 3rd party repository is an anti-pattern.

share|improve this answer

For future reads of this, to do this from source you do the following:

Download Lua source from site.
yum install curses-devel readline-devel
make linux (you may need to get a few other devel libraries if the above fails)
cd /usr/local/lib
gcc -shared -o liblua.5.1.3.so /usr/local/lib/liblua.a
mv liblua.5.1.3.so liblua.5.1.3.so /usr/lib/

Note to load this, and libxml2 into mod_security you need to use LoadFile not LoadModule.
LoadFile /usr/lib/libxml2.so
LoadFile /usr/lib/liblua.5.1.3.so
share|improve this answer
2  
You should really get out of the habit of copying these to /usr/lib/, leave that for the RPM supplied .so files. Keep them in /usr/local/lib/ where they belong and be a good sysadmin. :) –  troyengel Jun 7 '10 at 4:58

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.