1. EUPHORIA CGI + Apache

I've set up a simple page of instructions for getting
Apache to serve EUPHORIA-generated HTML pages. Please
check it out and let me know if there's anything I missed.

I just set up Apache and EUPHORIA on my PC here at work.
We were using IIS, but with the recent outbreak of
IIS-targeting worms, I've decided to go with something... better. ;)

Anyway, let me know!!!

http://www.cklester.com/euphoria/

I am planning on putting up a simple tutorial for IIS, also,
or maybe not. If you think I should, lemme know.

Rob, you can add this to the EUPHORIA web pages section of
the RDS home page, if ya want. :)

-=ck
"Programming in a state of EUPHORIA."

new topic     » topic index » view message » categorize

2. Re: EUPHORIA CGI + Apache

ck, i wish you were here, so i could just HUG you..this is the FIRST time
i've gotten Euphoria to work!!!

I had actually given up and was trying to teach myself perl!!

Michelle Rogers
----- Original Message ----- 
From: "cklester" <guest at RapidEuphoria.com>
To: <EUforum at topica.com>
Sent: Friday, June 25, 2004 5:33 PM
Subject: EUPHORIA CGI + Apache


>
>
> posted by: cklester <cklester at yahoo.com>
>
> I've set up a simple page of instructions for getting
> Apache to serve EUPHORIA-generated HTML pages. Please
> check it out and let me know if there's anything I missed.
>
> I just set up Apache and EUPHORIA on my PC here at work.
> We were using IIS, but with the recent outbreak of
> IIS-targeting worms, I've decided to go with something... better. ;)
>
> Anyway, let me know!!!
>
> http://www.cklester.com/euphoria/
>
> I am planning on putting up a simple tutorial for IIS, also,
> or maybe not. If you think I should, lemme know.
>
> Rob, you can add this to the EUPHORIA web pages section of
> the RDS home page, if ya want. :)
>
> -=ck
> "Programming in a state of EUPHORIA."
>
>
>
>

new topic     » goto parent     » topic index » view message » categorize

3. Re: EUPHORIA CGI + Apache

Michelle Rogers wrote:
> 
> ck, i wish you were here, so i could just HUG you..this is the FIRST time
> i've gotten Euphoria to work!!!

All right! Very cool!! I'm glad it helped. :)

> I had actually given up and was trying to teach myself perl!!

Perl?! Gross! heheh.

new topic     » goto parent     » topic index » view message » categorize

4. Re: EUPHORIA CGI + Apache

A really useful article.

Can you give a simple "Hello World" example of a Euphoria CGI script?

I've tried:
#!C:\euphoria\bin\exw.exe
puts(1,"Hello World")


But when I try to access the file via: 
http://localhost/cgi-bin/hello.exw
I just get a "Page cannot be displayed" or a "500 Server Error" (dependent on
browser and slight httpd.conf changes)

I've checked the mods from your article and double checked the httpd.conf file,
but still cannot get it to work correctly.

It's probably just me that's messed up somewhere, but I'm not an Apache/CGI guru
:(

new topic     » goto parent     » topic index » view message » categorize

5. Re: EUPHORIA CGI + Apache

>From: Dave Probert <guest at RapidEuphoria.com>
>Reply-To: EUforum at topica.com
>To: EUforum at topica.com
>Subject: Re: EUPHORIA CGI + Apache
>Date: Fri, 25 Jun 2004 23:45:25 -0700
>
>posted by: Dave Probert <zingo at purpletiger.com>
>
>A really useful article.
>
>Can you give a simple "Hello World" example of a Euphoria CGI script?
>
>I've tried:
>}}}
<eucode>
>#!C:\euphoria\bin\exw.exe
>puts(1,"Hello World")
></eucode>
{{{

>

  You need to insert the correct CGI headers. Those specify if you're 
outputting HTML code, plain text, pictures, and can do other stuff, like a 
redirect. Try this for an example:

#!C:/euphoria/bin/exw.exe
-- i believe you need / and not \
puts(1, "ContentType: text/html\n\n")
puts(1, "< html > < body > Hello World! < /body > < /html >")


I put spaces between the < and the tags just in case they get removed on the 
list. Hopefully, you'd still be able to see the tags.

~[ WingZone ]~
http://wingzone.tripod.com/

new topic     » goto parent     » topic index » view message » categorize

6. Re: EUPHORIA CGI + Apache

Thankyou extremely.  Absolutely spot on reply.

Just dropping the Content-Type in there worked perfectly (comment it out and the
error appears again)

Though the < html >, etc tags show as is - ie they don't get tramsformed for
some reason - I'll look into that.  It's probably some error on my part. (Yes I
did remove the spaces ;) )

Thanks again.  Both CKL and Elliott.

new topic     » goto parent     » topic index » view message » categorize

7. Re: EUPHORIA CGI + Apache

Quick update:
The ContentType line works, but should actually be Content-Type

The hyphen makes a big difference.

Then the html tags work fine.

For those who are also struggling and following this thread - don't forget the
\n\n at the end of the line - those matter too :)

new topic     » goto parent     » topic index » view message » categorize

8. Re: EUPHORIA CGI + Apache

I have a question, too..
in perl you get the variable from the form on the last screen by using...

name=param('namekey')


can anyone tell me how to get the variable from the form in euphoria?


Michelle Rogers
----- Original Message ----- 
From: "Dave Probert" <guest at RapidEuphoria.com>
To: <EUforum at topica.com>
Sent: Saturday, June 26, 2004 4:23 AM
Subject: Re: EUPHORIA CGI + Apache


>
>
> posted by: Dave Probert <zingo at purpletiger.com>
>
> Quick update:
> The ContentType line works, but should actually be Content-Type
>
> The hyphen makes a big difference.
>
> Then the html tags work fine.
>
> For those who are also struggling and following this thread - don't forget
the \n\n at the end of the line - those matter too :)
>
>
>
>

new topic     » goto parent     » topic index » view message » categorize

9. Re: EUPHORIA CGI + Apache

Michelle Rogers wrote:
> 
> I have a question, too..
> in perl you get the variable from the form on the last screen by using...
> 
> name=param('namekey')
> 
> 
> can anyone tell me how to get the variable from the form in euphoria?

Yes. Get http://www.rapideuphoria.com/cgi.tar.gz
Therein are demo'ed various ways of accepting form data. You will need 
to parse the input string and convert the escaped characters before 
you can use them. You'll find the necessary routines in that package 
as well.

Regards,
Irv

new topic     » goto parent     » topic index » view message » categorize

10. Re: EUPHORIA CGI + Apache

irv mullins wrote:
> 
> Michelle Rogers wrote:

> > can anyone tell me how to get the variable from the form in euphoria?
> 
> Yes. Get <a
> href="http://www.rapideuphoria.com/cgi.tar.gz">http://www.rapideuphoria.com/cgi.tar.gz</a>
> Therein are demo'ed various ways of accepting form data. You will need 
> to parse the input string and convert the escaped characters before 
> you can use them. You'll find the necessary routines in that package 
> as well.

Oh.. perhaps you don't have a way to untar that package. I'll zip 
it and post it to my website in a couple of minutes. Look for it 
on the downloads page at http://ellijay.com/users/irvm/

Irv

new topic     » goto parent     » topic index » view message » categorize

11. Re: EUPHORIA CGI + Apache

cklester wrote:
> I've set up a simple page of instructions for getting
> Apache to serve EUPHORIA-generated HTML pages. Please
> check it out and let me know if there's anything I missed.

What's giving me headaches are includes.  Normal includes like this fail:
  include machine.e
They have to be rewritten to be explicit:
  include /home/fraser/euphoria/include/machine.e

That's fine for my programs.  But when I call standard libraries which call
their own includes, these fail.  Which forces me to edit the libraries and
hack in my full path.  This is really bad practice.

What's the proper solution?  How do I get the EUINC set up properly within
a Linux/Apache/CGI environment?

new topic     » goto parent     » topic index » view message » categorize

12. Re: EUPHORIA CGI + Apache

>From: Dave Probert <guest at RapidEuphoria.com>
>Reply-To: EUforum at topica.com
>To: EUforum at topica.com
>Subject: Re: EUPHORIA CGI + Apache
>Date: Sat, 26 Jun 2004 01:15:42 -0700
>
>posted by: Dave Probert <zingo at purpletiger.com>
>
>Thankyou extremely.  Absolutely spot on reply.
>
>Just dropping the Content-Type in there worked perfectly (comment it out=
=20
>and the error appears again)
>
>Though the < html >, etc tags show as is - ie they don't get tramsformed=
=20
>for some reason - I'll look into that.  It's probably some error on my=20
>part. (Yes I did remove the spaces ;) )
>

     Err, no, I meant on the EUforum webpage. I heard that HTML tags that=
=20
weren't really HTML code (ie, not formatting for the e-mail, but text in th=
e=20
e-mail) might disappear. It may be fixed now, though.

>Thanks again.  Both CKL and Elliott.
>

~[ WingZone ]~
http://wingzone.tripod.com/

hs=20
FREE*=20=20=20
http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=10=
34&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines

new topic     » goto parent     » topic index » view message » categorize

13. Re: EUPHORIA CGI + Apache

>From: Dave Probert <guest at RapidEuphoria.com>
>Reply-To: EUforum at topica.com
>To: EUforum at topica.com
>Subject: Re: EUPHORIA CGI + Apache
>Date: Sat, 26 Jun 2004 01:23:44 -0700
>
>posted by: Dave Probert <zingo at purpletiger.com>
>
>Quick update:
>The ContentType line works, but should actually be Content-Type
>
>The hyphen makes a big difference.
>

  Ah, sorry, I couldn't remember which it was. It was a bit late...

>Then the html tags work fine.
>
>For those who are also struggling and following this thread - don't forget 
>the \n\n at the end of the line - those matter too :)
>

  The \n\n signifies the end of the headers. You can do something longer 
like this, which shows why you would need them:

puts(1, "Content-Type: text/html\n")
printf(1, "Content-Length: %d\n", {length("some HTML code")})
puts(1, "Expires: Sunday, 27-Jun-2004 12:00:00 GMT\n")
puts(1, "\n")    --done headers
puts(1, "some HTML code")


~[ WingZone ]~
http://wingzone.tripod.com/

_________________________________________________________________
Tired of spam? Get advanced junk mail protection with MSN Premium   
http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines

new topic     » goto parent     » topic index » view message » categorize

14. Re: EUPHORIA CGI + Apache

hmm..normal includes are working for me....but I'm using windows
Michelle Rogers
----- Original Message ----- 
From: "Neil Fraser" <guest at RapidEuphoria.com>
To: <EUforum at topica.com>
Sent: Saturday, June 26, 2004 9:52 AM
Subject: Re: EUPHORIA CGI + Apache


>
>
> posted by: Neil Fraser <euphoria at neil.fraser.name>
>
> cklester wrote:
> > I've set up a simple page of instructions for getting
> > Apache to serve EUPHORIA-generated HTML pages. Please
> > check it out and let me know if there's anything I missed.
>
> What's giving me headaches are includes.  Normal includes like this fail:
>   include machine.e
> They have to be rewritten to be explicit:
>   include /home/fraser/euphoria/include/machine.e
>
> That's fine for my programs.  But when I call standard libraries which
call
> their own includes, these fail.  Which forces me to edit the libraries and
> hack in my full path.  This is really bad practice.
>
> What's the proper solution?  How do I get the EUINC set up properly within
> a Linux/Apache/CGI environment?
>
>
>
>

new topic     » goto parent     » topic index » view message » categorize

15. Re: EUPHORIA CGI + Apache

Dave Probert wrote:
> 
> Can you give a simple "Hello World" example of a Euphoria CGI script?

Hi, Dave! I've updated the web page to provide
a simple "Hello, world!" sample script.

Let me know if y'all need anything else. ;)


-=ck
"Programming in a state of EUPHORIA."

new topic     » goto parent     » topic index » view message » categorize

16. Re: EUPHORIA CGI + Apache

Michelle Rogers wrote:
> 
> hmm..normal includes are working for me....but I'm using windows

When you use Linux/FreeBSD, you have to make sure that the "user" that
runs Apache will have permission to the EUPHORIA directory.

I also notice on Windows that I don't have this problem. On my FreeBSD
box, I do have to be explicit about stuff.

For my Linux web host, I put exu and all the needed includes in the
same folder as where the scripts are... :/

-=ck
"Programming in a state of EUPHORIA."

new topic     » goto parent     » topic index » view message » categorize

17. Re: EUPHORIA CGI + Apache

cklester wrote:

>When you use Linux/FreeBSD, you have to make sure that the "user" that
>runs Apache will have permission to the EUPHORIA directory.
>
>I also notice on Windows that I don't have this problem. On my FreeBSD
>box, I do have to be explicit about stuff.
>
>For my Linux web host, I put exu and all the needed includes in the
>same folder as where the scripts are... :/
>  
>
The reason for this, is cause sometimes Apache doesn't allow access to 
certian Enviroment Variables, in order to prevent hacking.  If you want 
a Enviroment Variable to work, you'll have to set it up in the 
httpd.conf file.  This applies to both Windows, and Linux.  The easiest 
way to do this is put these lines in your httpd.conf
SETENV EUINC="C:\euinc"
SETENV EUPHORIA="C:\euphoria"

-- OR for linux --
SETENV EUINC="/home/eumario/euinc"
SETENV EUPHORIA="/home/eumario/euphoria"

That should solve your problems with it not finding the Include files 
properly.  But be sure to have loadmodule "env.so" or whatever it may be 
on which ever system.  It should be in the default httpd.conf file, and 
may be commented out.

L8ers
Mario

new topic     » goto parent     » topic index » view message » categorize

18. Re: EUPHORIA CGI + Apache

Mario Steele wrote:
> 
> cklester wrote:
> 
> >For my Linux web host, I put exu and all the needed includes in the
> >same folder as where the scripts are... :/
> >  
> If you want 
> a Enviroment Variable to work, you'll have to set it up in the 
> httpd.conf file.  This applies to both Windows, and Linux.  The easiest 
> way to do this is put these lines in your httpd.conf
> SETENV EUINC="C:\euinc"
> SETENV EUPHORIA="C:\euphoria"
> 
> -- OR for linux --
> SETENV EUINC="/home/eumario/euinc"
> SETENV EUPHORIA="/home/eumario/euphoria"

Thanks, Mario! Very helpful.

-=ck
"Programming in a state of EUPHORIA."

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu