LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Request: Apache 2.4 with lua support (https://www.linuxquestions.org/questions/slackware-14/request-apache-2-4-with-lua-support-4175469593/)

codeguy 07-14-2013 08:29 AM

Request: Apache 2.4 with lua support
 
Currently our apache 2.4 does not include lua support. We do have a lua package on slackbuilds.org however. And if you install that, then recompile the httpd package from source, it works!

Would it be possible to get the lua (and maybe even luajit) package into core, and rebuild apache?

Pretty please?

-Andy

willysr 07-14-2013 08:37 AM

what advantage does we get by adding lua support?

codeguy 07-14-2013 08:39 AM

... we can write web pages in lua.

ponce 07-14-2013 08:43 AM

https://httpd.apache.org/docs/trunk/mod/mod_lua.html
other examples
http://www.admin-magazine.com/Articles/Lua-for-Apache

@codeguy: note this block
Code:

mod_lua is still in experimental state. Until it is declared stable, usage and behavior
may change at any time, even between stable releases of the 2.4.x series. Be sure to check
the CHANGES file before upgrading.

Warning

This module holds a great deal of power over httpd, which is both a strength and a
potential security risk. It is not recommended that you use this module on a server
that is shared with users you do not trust, as it can be abused to change
the internal workings of httpd.

IMHO, also in case lua-5.1 (5.2 is still incompatible with most of the things out there) will be included in Slackware (I got nothing against this in particular, on the opposite I would like to see it in :) ) and httpd will be rebuilt over it, it's still better to leave mod_lua commented out by default in httpd.conf and add a big fat warning for who wants to enable it.

maybe having to rebuild httpd specifically for having a mod_lua (like it's ATM) is not that bad as even more n00b-safe (one has to do it knowingly).

codeguy 07-14-2013 08:56 AM

Agreed. I haven't written a lick of lua code yet. (Well, for apache/web. I've written quite a bit in other projects).

I'd like to get it in now so I can play with it, and see if it'll be awesome.

I already have to rebuild my own php-pgsql-client every freeking time there is a php update, because there is no Postgresql client (so no php support) in core. Its really annoying. So before I go any further w/lua, I wanna make sure it'll be supported.

-Andy

ponce 07-14-2013 09:18 AM

Quote:

Originally Posted by ponce (Post 4990107)
maybe having to rebuild httpd specifically for having a mod_lua (like it's ATM) is not that bad as even more n00b-safe (one has to do it knowingly).

maybe you missed this edit.
rebuilding httpd for an additional feature is not like rebuilding php: it needs just an handful of minutes even on slow hardware and it won't get updated as often as php...

Quote:

Originally Posted by codeguy (Post 4990109)
I'd like to get it in now so I can play with it, and see if it'll be awesome.

but as you just rebuilt apache you actually can do already all the tests that you want. ;)

Quote:

Originally Posted by codeguy (Post 4990109)
So before I go any further w/lua, I wanna make sure it'll be supported.

it's still considered experimental by the apache developers theirselves...

TommyC7 07-14-2013 09:52 AM

Quote:

ponce:
(5.2 is still incompatible with most of the things out there)
Indeed. vlc is one which won't build (both 2.0.7 and 2.1.0-pre) against the new lua-5.2.2. However, with that said I wouldn't mind seeing lua in Slackware whether it's solely for httpd or not.

ponce 07-14-2013 10:05 AM

best would be in a way that it can be parallel installable to the 5.2.x version (the scripts on SBo don't allow that): gotta still see if I find something to do this cleanly (the build scripts by its devs seemingly are not much of help for this)...

Humbedooh 08-02-2013 02:50 AM

Quote:

Originally Posted by ponce (Post 4990118)
it's still considered experimental by the apache developers theirselves...

Just a note from one of the core developers on this module; By "experimental" we do not mean "it doesn't work and is unsupported", what we mean is; It's still being worked on actively, and new features may enter into play at any given time. Some internal mechanisms may get upgraded, some default directive values may change, but your scripts/usage would stay largely unaffected by this. If you write a script do to X, then you can rest assured that it'll still do X in the next version of httpd, there just may be another way of doing X, or it may be recommended/preferred to do Y instead at that point. I've used mod_lua since the birth of httpd 2.4, and I haven't had to change or invalidate my scripts since that time, I've ever only had the pleasure of upgrading scripts to take advantage of new features as they became available (the database interface for example). On a few occasions, I've had to change minor bits and bobs in my code, but that has usually been because we found a more clever way of writing a function (for instance, changing a return value from an int to a float, or accepting more arguments in a regex function).

To put this into perspective; We at Apache use mod_lua for quite a bit of sites, including (but not limited to) our modules database, our paste bin, our online commenting system and so on. All these sites are freely available under the ALv2 license in our subversion repositories, and we're quite comfortable using this on production servers.

To sum up; We quite like (working with/on) this module, it's just as safe to use on production servers as any other language module, we're actively working on enhancing it, and we'd love to answer any questions (whether it be tech support or just how to use it) on either IRC (#httpd on Freenode) or on one of our mailing lists.

Gerard Lally 08-02-2013 04:25 AM

Quote:

Originally Posted by Humbedooh (Post 5001435)
Just a note from one of the core developers on this module; By "experimental" we do not mean "it doesn't work and is unsupported", what we mean is; It's still being worked on actively, and new features may enter into play at any given time.

< snip >

Forgive me for derailing this thread slightly: I have recently been wondering whether or not to take up Lua, and I was wondering if it can replace PHP for database-driven websites. Reading this thread (and prescinding from reliability and security issues), am I right to conclude it can?

Humbedooh 08-02-2013 04:30 AM

Quote:

Originally Posted by gezley (Post 5001481)
Forgive me for derailing this thread slightly: I have recently been wondering whether or not to take up Lua, and I was wondering if it can replace PHP for database-driven websites. Reading this thread (and prescinding from reliability and security issues), am I right to conclude it can?

Short answer: Yes, it can.

Long answer: You can natively use mySQL, PostgreSQL (pgsql driver seems broken at the moment), FreeTDS, ODBC, SQLite and Oracle with mod_lua. For more details on working with databases, see http://httpd.apache.org/docs/current...html#databases If you choose to give it a spin, Always use prepared statements when you can - you don't want to risk little Bobby Tables ruining your work :)

Gerard Lally 08-02-2013 05:45 AM

Quote:

Originally Posted by Humbedooh (Post 5001486)
Short answer: Yes, it can.

Interesting. Thanks.


All times are GMT -5. The time now is 07:06 PM.