Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
up vote 2 down vote accepted

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


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 /usr/local/lib/liblua.a
mv /usr/lib/

Note to load this, and libxml2 into mod_security you need to use LoadFile not LoadModule.
LoadFile /usr/lib/
LoadFile /usr/lib/
share|improve this answer
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


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.