Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 11 of 11
  1. #1
    Join Date
    Aug 2004
    Location
    Rio de Janeiro, Brasil
    Posts
    62

    Lightbulb Lua 5.1.2 on Apache 2.2.11, with PHP 5.2.8 and mySQL 5.1.30

    A painless pre-installed and ready to use pack of Apache 2.2.11, Lua 5.1.2, PHP 5.2.8 and mySQL 5.1.30.

    - no messing with config files or services under any Win32 environment
    - works fine in pendrives.
    - only 4.63MB

    Download:
    Apache_2.2.11.0_+_PHP_5.2.8_+_mySQL_5.1.30_+_PHPMi niAdmin_+_Lua_5.1.2_+_Kepler.zip

    Details in Portuguese:
    WAMP com Lua instalada: apache + lua (+ kepler) + php + mysql, para windows - download


    []'s,

    Mikhail Miguel

  2. #2
    Join Date
    May 2006
    Posts
    1,443
    what does this , could you explain

    or this runs a lua script on web server..?

  3. #3
    Join Date
    Aug 2004
    Location
    Rio de Janeiro, Brasil
    Posts
    62

    Post win32 wamp server to crerate dynamic pages with Lua

    Quote Originally Posted by reteset View Post
    what does this , could you explain
    Hi! This is a WAMP with Kepler and LUA CGI installed and ready to use.

    Quote Originally Posted by reteset View Post
    this runs a lua script on web server..?
    Yes, you can run lua scripts (.lua files, 100% lua) and Lua pages (.lp files, HTML with <?lua ?> tags) to crerate dynamic pages like PHP.

  4. #4
    Join Date
    Aug 2004
    Location
    Rio de Janeiro, Brasil
    Posts
    62

    Post Lua Scripts

    Lua Scripts

    Lua Scripts are text files containing valid Lua code. This style of usage adopts a more "raw" form of web programming, where a program is responsible for the entire generation of the resulting page. Lua Scripts have a default .lua extension.

    To generate a valid web document (HTML, XML, WML, CSS etc) the Lua Script must follow the expected HTTP order to produce its output, first sending the correct headers and then sending the actual document contents.

    CGILua offers some functions to ease these tasks, such as cgilua.htmlheader to produce the header for a HTML document and cgilua.put to send the document contents (or part of it).

    For example, a HTML document which displays the sentence "Hello World!" can be generated with the following Lua Script:

    Code:
    cgilua.htmlheader()
    cgilua.put([[
    <html>
    <head>
      <title>Hello World</title>
    </head>
    <body>
      <strong>Hello World!</strong>
    </body>
    </html>]])
    It should be noted that the above example generates a "fixed" page: even though the page is generated at execution time there is no "variable" information. That means that the very same document could be generated directly with a simple static HTML file. However, Lua Scripts become especially useful when the document contains information which is not known beforehand or changes according to passed parameters, and it is necessary to generate a "dynamic" page.

    Another easy example can be shown, this time using a Lua control structure, variables, and the concatenation operator:

    Code:
    cgilua.htmlheader()  
    
    if cgilua.QUERY.language == 'english' then
      greeting = 'Hello World!'
    elseif cgilua.QUERY.language == 'portuguese' then
      greeting = 'Olá Mundo!'
    else
      greeting = '[unknown language]'
    end
    
    cgilua.put('<html>')  
    cgilua.put('<head>')
    cgilua.put('  <title>'..greeting..'</title>')
    cgilua.put('</head>')
    cgilua.put('<body>')
    cgilua.put('  <strong>'..greeting..'</strong>')
    cgilua.put('</body>')
    cgilua.put('</html>')
    In the above example the use of cgilua.QUERY.language indicates that language was passed to the Lua Script as a CGILua parameter, coming from the URL used to activate it (via GET). If you were using a form, the parameter would be available in cgilua.POST.language. CGILua automatically decodes such QUERY and POST parameters so you can use them at will on your Lua Scripts and Lua Pages.

  5. #5
    Join Date
    Aug 2004
    Location
    Rio de Janeiro, Brasil
    Posts
    62

    Post Lua Pages .lp

    Lua Pages

    A Lua Page is a text template file which will be processed by CGILua before the HTTP server sends it to the client. CGILua does not process the text itself but look for some special markups that include Lua code into the file. After all those markups are processed and merged with the template file, the results are sent to the client.

    Lua Pages have a default .lp extension. They are a simpler way to make a dynamic page because there is no need to send the HTTP headers. Usually Lua Pages are HTML pages so CGILua sends the HTML header automatically.

    Since there are some restrictions on the uses of HTTP headers sometimes a Lua Script will have to be used instead of a Lua Page.

    The fundamental Lua Page markups are:

    <?lua chunk ?>
    Processes and merges the Lua chunk execution results where the markup is located in the template. The alternative form <% chunk %> can also be used.
    <?lua= expression ?>
    Processes and merges the Lua expression evaluation where the markup is located in the template. The alternative form <%= expression %> can also be used.

    Note that the ending mark could not appear inside a Lua chunk or Lua expression even inside quotes. The Lua Pages pre-processor just makes global substitutions on the template, searching for a matching pair of markups and generating the corresponding Lua code to achieve the same result as the equivalent Lua Script.

    The second example on the previous section could be written using a Lua Page like:

    Code:
    <html>
    <?lua
    if cgilua.QUERY.language == 'english' then
      greeting = 'Hello World!'
    elseif cgilua.QUERY.language == 'portuguese' then
      greeting = 'Olá Mundo!'
    else
      greeting = '[unknown language]'
    end
    ?>
    <head>
      <title><%= greeting %></title>
    </head>
    <body>
      <strong><%= greeting %></strong>
    </body>
    </html>
    HTML tags and Lua Page tags can be freely intermixed. However, as on other template languages, it's considered a best practice to not use explicit Lua logic on templates. The recommended aproach is to use only function calls that returns content chunks, so in this example, assuming that function getGreeting was definied in file functions.lua as follows:

    Code:
    function getGreeting()
      local greeting
      if cgilua.QUERY.language == 'english' then
        greeting = 'Hello World!'
      elseif cgilua.QUERY.language == 'portuguese' then
        greeting = 'Olá Mundo!'
      else
        greeting = '[unknown language]'
      end
      return greeting
    end
    
    the Lua Page could be rewriten as:
    
    <?lua
    assert (loadfile"functions.lua")()
    ?>
    <html>
    <head>
      <title><%= getGreeting() %></title>
    </head>
    <body>
      <strong><%= getGreeting() %></strong>
    </body>
    </html>
    Another interesting feature of Lua Pages is the intermixing of Lua and HTML. It is very usual to have a list of values in a table, iterate over the list and show the items on the page.

    A Lua Script could do that using a loop like:

    Code:
    cgilua.put("<ul>")
    for i, item in ipairs(list) do
        cgilua.put("<li>"..item.."</li>")
    end
    cgilua.put("</ul>")
    The equivalent loop in Lua Page would be:

    Code:
    <ul>
        <% for i, item in ipairs(list) do %>
        <li><%= item %></li>
        <% end %>
    </ul>

  6. #6
    Join Date
    Apr 2007
    Location
    Raalte, OV, Netherlands
    Posts
    3,287
    That is looking good. Thanks for this great lesson.
    Bas Groothedde
    Imagine Programming :: Blog :: Familiar people here

    My AMS Plugins:

  7. #7
    Join Date
    Aug 2004
    Location
    Rio de Janeiro, Brasil
    Posts
    62

    Arrow UPDATED: Lua/5.1 + Apache/2.2.17 + MySQL/5.5.8 + PHP/5.3.4

    Updated:
    http://underpop.free.fr/x/xoopserver/xoopserver.zip

    # Size: only 5,93 MB (6.220.709 bytes)
    # Apache/2.2.17 (Win32)
    # Lua/5.1 (just for testing)
    # MySQL/5.5.8 (user: root, password: blank)
    # PHP/5.3.4


    Notes:

    - All old/ugly icons used by Apache was replaced: \usr\share\apache\icons\
    - Lua was not very well installed and will be removed from the next version.
    - PhpMyAdmin was replaced by Adminer 3.0.1 < http://127.0.0.1/mysqladmin/ >
    - Compressed with WinRK


    []'s,

    Mikhail Miguel

  8. #8
    Join Date
    Apr 2010
    Posts
    529
    Mikhail,

    Is this like the XAMPP release from the folks in Germany? I don't know anything about it (Lua on the web) yet (apart from a brief explanation by IP/Bas), but I imagine that having Lua installed on a local web server in this way would be good for testing Lua web code?

    Cheers,
    dean

  9. #9
    Join Date
    Nov 2009
    Location
    UK
    Posts
    1,634
    Quote Originally Posted by Mikhail View Post
    Updated:
    http://underpop.free.fr/x/xoopserver/xoopserver.zip

    # Size: only 5,93 MB (6.220.709 bytes)
    # Apache/2.2.17 (Win32)
    # Lua/5.1 (just for testing)
    # MySQL/5.5.8 (user: root, password: blank)
    # PHP/5.3.4


    Notes:

    - All old/ugly icons used by Apache was replaced: \usr\share\apache\icons\
    - Lua was not very well installed and will be removed from the next version.
    - PhpMyAdmin was replaced by Adminer 3.0.1 < http://127.0.0.1/mysqladmin/ >
    - Compressed with WinRK


    []'s,

    Mikhail Miguel
    Your new download triggers Avast to be a malware a file with _sfx that is the problem.

  10. #10
    Join Date
    Oct 2004
    Location
    East, South & West Asia
    Posts
    1,020
    Hi,

    I have 2 important questions:

    ->> Is the latest Apache in Web Hosting providers have mod_lua installed?

    ->> Do you know any dynamic sample sites fully run with LUA & MySQL?
    Newbie Examples
    ------> AMS 7.5 : amstudio.azman.info
    ----> AMS 6 & 5: www.azman.info/ams/
    ----> FB: facebook.com/GuideToWealth

    ----> Content Development Blog: www.AZMAN.asia

  11. #11
    Join Date
    Apr 2007
    Location
    Raalte, OV, Netherlands
    Posts
    3,287
    Quote Originally Posted by azmanar View Post
    Hi,

    I have 2 important questions:

    ->> Is the latest Apache in Web Hosting providers have mod_lua installed?

    ->> Do you know any dynamic sample sites fully run with LUA & MySQL?
    1) No, but I think they are thinking about including it by default.
    2) No, but there are a few I think. You could mask out the *.lua by using the .htaccess (mod_rewrite), so there might be quite a few.
    Bas Groothedde
    Imagine Programming :: Blog :: Familiar people here

    My AMS Plugins:

  12. #12
    Join Date
    Nov 2009
    Location
    UK
    Posts
    1,634
    Still flagging a AV wonting dude can you rename or compress another way so my AV want stop the download it lol thanks man.

  13. #13
    Join Date
    Oct 2009
    Location
    Merton, United Kingdom
    Posts
    684
    Quote Originally Posted by sim View Post
    Still flagging a AV wonting dude can you rename or compress another way so my AV want stop the download it lol thanks man.
    Since I don't use an anti-virus (too hardcore) I decompressed and re-archived using WinRAR.

    http://shadiku.com/tmp/xoopserver.rar

    Have fun.

  14. #14
    Join Date
    Nov 2009
    Location
    UK
    Posts
    1,634
    That did the trick thanks man.

Similar Threads

  1. PHP mySQL result into LUA table?
    By sdfsf93924554234fjfjf in forum AutoPlay Media Studio 7.5
    Replies: 0
    Last Post: 03-16-2008, 08:02 AM
  2. Apache, php, MySQL check
    By edit in forum Setup Factory 6.0
    Replies: 3
    Last Post: 01-08-2004, 12:17 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts