Jump to content

Web-based AutoIt! - New with AuCGI!


theguy0000
 Share

Recommended Posts

Ok, I really do not feel like reading though 24 pages of posts, so I'll just ask, does anyone have a mirror for the AuCGI.exe and Web.au3? This could prove slightly useful, and very entertaining for quite a bit of time, and I'm sure I could use something like this farm more effectively than PHP...because I know almost no PHP :D

Link to comment
Share on other sites

Learn to dig through posts. It will build character.

If you're too lazy to find it yourself, why should anyone else bother?

Apparently wraithdu is nicer than me.

Edited by JRowe
Link to comment
Share on other sites

I posted a small update to v1.2 which fixes a problem if the source file were to end with an au3 script section.

I'm sure you can still break stuff, for example don't do this: echol("<?au3 blah ?> uh oh")

You can probably use the Chr() function to get around that one though.

Link to comment
Share on other sites

Thanks a ton wraithdu, I checked page 23 but I guess I was not looking hard enough, I was looking for the name "theman0000" :D

And no thanks JRowe, I had just got through reading page 8, did not see anything of great value, just old posts of people talking about new features that the latest release already has now, and figured most of it was just that, and that it would probably help more if I just asked. I had already tried messaging theman0000 about it but apparently his inbox is full.

Link to comment
Share on other sites

I was just irritated that what you were asking for was 6 posts before your question. That's right out in the open... literally on the same page as your question. Generally, when searching for updated scripts, etc, you'll find them or references to them in the latter pages of the thread.

Link to comment
Share on other sites

  • 4 weeks later...

Does anyone know how to set things up to run <?au3 ?> inside a .html, rather than a .au3 or .auw?

I'm using lighttpd and the latest auCGI/web.au3 .

Link to comment
Share on other sites

I think this is the block in lighttpd-inc.conf you have to change:

cgi.assign                  = ( ".php" => "C:/progra~1/PHP/php-cgi.exe",
                                ".pl"  => "Perl/perl.exe",
                                ".au3"  => "C:/LightTPD/AU3/AuCGI.exe",
                                ".auw"  => "C:/LightTPD/AU3/AuCGI.exe",
                                ".cgi" => "Perl/perl.exe" )

You would have to add .html to the list, assigned to AuCGI.exe. Not sure what kind of problems or performance hit this might incur though, as you'd be running every web page through the cgi handler.

Edited by wraithdu
Link to comment
Share on other sites

It "server error 500's" when I do that, that's when I decided to ask here. I remember embedding working with Abyss, but I'm not sure how or even if that applies to lighttpd. Anyway, I've decided to stick with a ".web" extension. I've got it up and running fairly well. For a simple sqlite request, it takes about .008 seconds, so the performance isn't bad at all. With a little tweaking, I'm sure I could set up the AUcgi to handle the sqlite connections, so you could skip loading and reloading the dll and databases on each page serve(instead having the databases connected on a per site basis, with pages requesting site specified databases,) which might significantly increase performance.

http://www.autoit.me/sqlite.web serves a small request, and takes about .008 seconds on average.

#include <SQLite.au3>
#include <SQLite.dll.au3>
$result = 0
_SQLite_Startup ()
$db = _SQLite_Open ("database")
_SQLite_QuerySingleRow($db, "SELECT content FROM sections WHERE section = 1", $result)
        echo("<br></br>")
        echo("This is an example of a dynamic webpage - Using SQLite")
        echo("<br></br>")
        echo($result[0])
_SQLite_Close()
_SQLite_Shutdown()

Definitely not a bad start. I've been thinking about how I want to go about real world web applications, and I've decided on the embedded snippets approach... regular html documents populated by database requests and au3 snippets, instead of generating html dynamically. I think this should maximize performance and make it easier to build dynamic sites. I've done enough joomla and phpnuke sites to know that the simpler you keep the framework, the more flexibility you'll have, and that flexibility is king in web design. Each site has its own unique demands.

AJAX is easy enough to add in, and graceful degradation to static html is even easier with the snippet approach, simply requiring an if/then switch serverside to determine what content to serve. jQuery is probably the easiest and most ubiquitous js framework to use.

Edited by JRowe
Link to comment
Share on other sites

@JRowe

Good to see that you are still using the AuCGI and LightTD, after I introduced it a few years ago.

I still think it is a strong combination.

But the downside is that there isn't much of development done on the windows version.

Which version are you runnning an where did you pick it up ?

Rgds,

ptrex

Link to comment
Share on other sites

1.4.22-1. I got it in december, and I think I have the source for that build as well. I recently reformatted one disk and upgraded another to win7, I'll have to hunt things down. The Lighttpd for windows site disappeared last week. There are instructions for building lighttpd on windows around, I'll see if those work or if there are a whole lot of dependencies (I deal with those no better than most amateurs unfamiliar with linux ports, but I'll at least report back.)

Link to comment
Share on other sites

Sexy. And full of win. This addresses a particularly serious issue. So yeah, download like the man says. :mellow:

Link to comment
Share on other sites

Thanks for the update. Wouldn't it be wiser to simply start a new topic with the first post in the topic containing every thing that is needed (since the original author has not updated it in years)? that way, noobs (like me) wont get lost.

[Not using this account any more. Using "iShafayet" instead]

Link to comment
Share on other sites

A new topic would be good. I'll leave it to wraithdu, I think, since he's the most active in maintaining this. I'm going through and getting rid of extraneous functions, separating out what should be core functionality from situational fluff. I'm trying to get this down to as sleek and slim as I can.

So, here begins the butchery. Note: this is not criticism of the stellar work that has been done, or indeed, criticism at all. I simply want to progress this UDF to the next level. It's ready for the big leagues. What follows is opinion, conjecture, and probably no dearth of mistakes.

Things like ActiveX and the WebApp composition, using shebang, are not ideal. _StringBetween is added directly when it's now a part of the standard au3 distribution. Things like the RSS feed should be separated from the standard include. I recall reading that variable length can affect size of an executable, which in turn impacts performance. There are environment variables which are gotten dynamically when they could be set on a per user basis using an external configuration tool. Array.au3 is included. Cookie handling and sessions are dependent on the webapp specification, when they should be a little more elegant, imo. This also shouldn't be doing html construction of any sort. That should be externalized. Also, there are Global declarations all over the place. Are they necessary? (Re: Valik's enlightening stance on global variables, I have to question this.)

The fact that scripts are constructed on the fly means that they should simply be shells, without having an include added by default.

Another thing to discuss would be versioning.

What functionality is required and desirable to be left in, and what should go to secondary includes? Also, since this works under Wine on linux, can we create a standalone container and specification for au3 use on Linux servers? IIRC, Wine handles everything AutoIt very nicely except for the windows specific control handles and things of that nature. Since we're preprocessing the scripts, adding a Wine compliance specification would be possible.

More shortly.

Link to comment
Share on other sites

I welcome the help chopping this thing up and getting it into shape. I've only really touched the core of it, the CGI handler and the basics in Web.au3. Things like rss, session management, and cookies, I have hardly looked at. Most of those specs I'm not familiar with, so I've stuck to improving the core functionality.

I think _StringBetween was somewhat customized, which is why it was added separately.

This also shouldn't be doing html construction of any sort.

What are you referring to specifically?

Yes, globals are ugly currently. There are things like this, and the parsing in general, that I still want to look at.

Link to comment
Share on other sites

  • 4 months later...

Not sure if anyone cares, but I got this working on IIS 7 under Win2008.

Screenshot:

Posted Image

If you want to do this, it requires a modified AuCGI.au3. IIS passes the calling script over the the handler via environment variables. Change this:

If $CmdLine[0] < 1 Then error("what are you trying to do???")
Global $sourcescript = $CmdLine[1]

To this:

If StringRight(EnvGet("PATH_TRANSLATED"), 3) <> "au3" And StringRight(EnvGet("PATH_TRANSLATED"), 3) <> "auw" Then error(EnvGet("PATH_TRANSLATED") & ": Not a .au3 or .auw script file!")
Global $sourcescript = EnvGet("PATH_TRANSLATED")

Create a web application and add the AuCGI handler mapping to your web application under the IIS Manager to handle *.auw and/or *.au3 files.

Seems to work pretty well! I've been dying to use AutoIt to handle HTTP boot scripts for gPXE, and /this/ is just what I've been looking for =)

Thanks for the great work!

___

Also, I was thinking it would probably be prudent to pass the other environment variables down to the actual Au3 code, but I'm not sure. I'm not really a web programmer :blink:

Wikipedia has the full list here.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...