1. How do you get CGI happening?
- Posted by Jerry Story <story.jerry at gmail.?om> Jan 22, 2008
- 725 views
- Last edited Jan 23, 2008
I went to http://www.rapideuphoria.com/cgi.htm This is the documentation that explains how to do CGI with Euphoria. From the above I downloaded the source of http://www.rapideuphoria.com/ecoform.htm and http://www.rapideuphoria.com/economy.txt Then I renamed "economy.txt" to "economy.exu" so it fits with <form method="POST" action="cgi-bin/economy.exu"> And I changed "rds at RapidEuphoria.com" to my email address. constant emailaddress = "rds at RapidEuphoria.com", Then I ran ecoform.htm with Opera on my computer. I filled out the form and clicked on submit. Got an error message. Could not open the file. Then I changed <form method="POST" action="cgi-bin/economy.exu"> to <form method="POST" action="economy.exu"> This is in the local directory. Clicked on the refresh button, filled out the form again, clicked on submit. Gotta blue screen with a bunch of source code on it. And no email message. How can I get CGI happening with Euphoria?
2. Re: How do you get CGI happening?
- Posted by Craig Welch <euphoriah at ??elch.org> Jan 22, 2008
- 657 views
- Last edited Jan 23, 2008
Jerry Story wrote: > Then I ran ecoform.htm with Opera on my computer. > I filled out the form and clicked on submit. > Got an error message. Could not open the file. What do you mean by 'ran' in the first sentence above? Do you mean that you opened the page in a browser? Or do you mean that you served it to a browser with a web server? The latter is what's required ... IIS would work if it's on a Windows machine, else Apache is the norm. There are others. If none of this makes any sense, I (and no doubt others) would be happy to explain further. -- Craig Euphoria friendly webhosting: http://www.wazu.jp/hosting/euphoria.html
3. Re: How do you get CGI happening?
- Posted by Jerry Story <story.jerry at gmai?.c?m> Jan 23, 2008
- 653 views
Craig Welch wrote: > > Jerry Story wrote: > > > Then I ran ecoform.htm with Opera on my computer. > > I filled out the form and clicked on submit. > > Got an error message. Could not open the file. > > What do you mean by 'ran' in the first sentence above? Do you mean that you > opened the page in a browser? Or do you mean that you served it to a browser > with a web server? I opened the page in a browser. But just a few minutes ago I put ecoform.htm and economy.exu on my website and then I opened ecoform.htm in a browser. At first it said POST is not allowed. So I changed POST to GET. Now it displays economy.exu. Still don't have it right. economy.exu seems to have code in it that handles GET. My ISP is Telus.
4. Re: How do you get CGI happening?
- Posted by c.k.lester <euphoric at cklest?r.?om> Jan 23, 2008
- 643 views
Jerry Story wrote: > > I opened the page in a browser. > > But just a few minutes ago I put ecoform.htm and economy.exu on my website and > then I opened ecoform.htm in a browser. At first it said POST is not allowed. > So I changed POST to GET. Now it displays economy.exu. Still don't have it > right. > > economy.exu seems to have code in it that handles GET. Jerry, you have to have a web server running that receives the incoming HTTP request and is able to serve up the page. So, for example, Apache would run your exu program and send the output to the browser. Without the web server, nothing gets served to the browser (or it acts like a file viewer).
5. Re: How do you get CGI happening?
- Posted by Michael Raley <thinkways at y?hoo?com> Jan 23, 2008
- 652 views
c.k.lester wrote: > > Jerry Story wrote: > > > > I opened the page in a browser. > > > > But just a few minutes ago I put ecoform.htm and economy.exu on my website > > and > > then I opened ecoform.htm in a browser. At first it said POST is not > > allowed. > > So I changed POST to GET. Now it displays economy.exu. Still don't have it > > right. > > > > economy.exu seems to have code in it that handles GET. > > Jerry, you have to have a web server running that receives the incoming > HTTP request and is able to serve up the page. So, for example, Apache would > run your exu program and send the output to the browser. > > Without the web server, nothing gets served to the browser (or it acts like > a file viewer). The web server also has to have some way of knowing how to invoke the interpreter. the economy program assumes a Linux based server (#!.exu is the interpreter invoked) IIS I believe you have to some alternatey, if you have cleared the syntax, you can bind a program into a CGI executable --"ask about our layaway plan". --
6. Re: How do you get CGI happening?
- Posted by Jerry Story <story.jerry at gmai?.co?> Jan 23, 2008
- 653 views
c.k.lester wrote: > > Jerry Story wrote: > > > > I opened the page in a browser. > > > > But just a few minutes ago I put ecoform.htm and economy.exu on my website > > and > > then I opened ecoform.htm in a browser. At first it said POST is not > > allowed. > > So I changed POST to GET. Now it displays economy.exu. Still don't have it > > right. > > > > economy.exu seems to have code in it that handles GET. > > Jerry, you have to have a web server running that receives the incoming > HTTP request and is able to serve up the page. So, for example, Apache would > run your exu program and send the output to the browser. > > Without the web server, nothing gets served to the browser (or it acts like > a file viewer). What is a web server? I use Telus. Is Telus a web server? This is Telus. http://consumer.telus.com/cgi-ebs/jsp/homepage.jsp
7. Re: How do you get CGI happening?
- Posted by Craig Welch <euphoriah at ?welch.or?> Jan 23, 2008
- 652 views
Jerry Story wrote: > > Craig Welch wrote: > > > > Jerry Story wrote: > > > > > Then I ran ecoform.htm with Opera on my computer. > > > I filled out the form and clicked on submit. > > > Got an error message. Could not open the file. > > > > What do you mean by 'ran' in the first sentence above? Do you mean that you > > opened the page in a browser? Or do you mean that you served it to a browser > > with a web server? > > I opened the page in a browser. That won't work. I suspect that you have not properly read http://www.rapideuphoria.com/cgi.htm. Please do so before proceeding. You might also read this page of mine: http://www.wazu.jp/hosting/CGI.html > But just a few minutes ago I put ecoform.htm and economy.exu on my website and > then I opened ecoform.htm in a browser. At first it said POST is not allowed. > So I changed POST to GET. Now it displays economy.exu. Still don't have it > right. > economy.exu seems to have code in it that handles GET. There's a bit more than that to it. > My ISP is Telus. Sorry, are we meant to know who that is? Does your ISP allow you to install Euphoria? To modify .htaccess so that Euphoria will be recognised as a program to execute CGI? -- Craig Euphoria friendly webhosting: http://www.wazu.jp/hosting/euphoria.html
8. Re: How do you get CGI happening?
- Posted by Jerry Story <story.jerry at gm?il?com> Jan 23, 2008
- 649 views
c.k.lester wrote: > > Jerry Story wrote: > > > > I opened the page in a browser. > > > > But just a few minutes ago I put ecoform.htm and economy.exu on my website > > and > > then I opened ecoform.htm in a browser. At first it said POST is not > > allowed. > > So I changed POST to GET. Now it displays economy.exu. Still don't have it > > right. > > > > economy.exu seems to have code in it that handles GET. > > Jerry, you have to have a web server running that receives the incoming > HTTP request and is able to serve up the page. So, for example, Apache would > run your exu program and send the output to the browser. > > Without the web server, nothing gets served to the browser (or it acts like > a file viewer). A few minutes ago I installed Apache. Now what do I gotta do with Apache?
9. Re: How do you get CGI happening?
- Posted by Jerry Story <story.jerry at gm?i?.com> Jan 23, 2008
- 650 views
Craig Welch wrote: > I suspect that you have not properly read <a > href="http://www.rapideuphoria.com/cgi.htm">http://www.rapideuphoria.com/cgi.htm</a>. > Please do so before proceeding. I read that many times. I am not smart enough to understand it. > Does your ISP allow you to install Euphoria? To modify .htaccess so that > Euphoria > will be recognised as a program to execute CGI? Who is .htaccess?
10. Re: How do you get CGI happening?
- Posted by Craig Welch <euphoriah at cwe??h.org> Jan 23, 2008
- 644 views
Jerry Story wrote: > > Craig Welch wrote: > > > I suspect that you have not properly read <a > > href="http://www.rapideuphoria.com/cgi.htm">http://www.rapideuphoria.com/cgi.htm</a>. > > Please do so before proceeding. > > I read that many times. I am not smart enough to understand it. In that case, I am not smart enough to help you. Sorry. > > Does your ISP allow you to install Euphoria? To modify .htaccess so that > > Euphoria > > will be recognised as a program to execute CGI? > > Who is .htaccess? http://en.wikipedia.org/wiki/.htaccess. Not sure why I'm doing your homework for you. You say you've just installed Apache, but you haven't (for some reason) read its documentation? Oops. Smacks own wrist. Reminds self not to respond to troll. -- Craig Euphoria friendly webhosting: http://www.wazu.jp/hosting/euphoria.html
11. Re: How do you get CGI happening?
- Posted by Frank Dowling <frank at fra?kied?com> Jan 23, 2008
- 658 views
Craig Welch wrote: > > I read that many times. I am not smart enough to understand it. > > In that case, I am not smart enough to help you. > > Sorry. There is some documentation on the internet about this. I would recommend searching the mailing list archive for "CGI" problems. I had the same problem as you, I tried off and on for ages to get euphoria working through CGI. I changed everything around so much I recognize in retrospect I got 99% of this right everytime but also I missed one directive everytime too. Please realise before you get frustrated with euphoria that it is *worth* investing time learning the concept of CGI programming in general - it will help with whatever language you end up using to do CGI. To do any CGI you have to have a webserver, basically. It's easiest if you use Apache for this because it's the dominant server and there is more documentation for this than any other at present (due to its cultural lineage).authoritave I'm making a presumption you are using Windows here. Install Apache as normal, using the default options. This should add "Apache" to your "Start Menu" programs. Under "Apache HTTP Server ......" You will find "Configure Apache Server", on which click "Edit Apache httpd.conf...." This is a file you're going to have to get used to. Apache is generally configured by a text configuration file, rather than tabbed dialog windows like most programs. It's easier if you just bite the bullet and experiment. I would save the original file as a backup somewhere, and go nuts with the following (you can always revert to the saved version - don't delete it!) First, read the website http://www.cklester.com/euphoria/?page=apache - this is the most authorative website I have seen on this issue. Don't worry if parts of it go over your head, just do it all step by step, and experiment ( I cannot stress enough - back-up the original httpd.conf ). These are the first things I do when setting up Euphoria for CGI on a new computer *) First things first, you need apache to be working - hit your ip address in your web browser, and it should give you a page that informs you Apache is working. If it is not working, there's no point even contemplating CGI - you'll need a webserver. If it doesn't work "out of the box" then you'll need to take this to an Apache specific group. Apache must work first and foremost *) Create a shorcut to Apache Error log file on your desktop or whatever folder is easiest for you. Go to the Start Menu, to Apache, then Review Server Log Files, then "Review Error Log". Left click on it, move it over your desktop or whereever is a convenient folder to have the link, and hold down the ALT key before you let go (this creates a shortcut, rather than moving the menu item). You'll need it. *) Through the start menu (you might want to create a shortcut for this too), edit httpd.conf for the following lines: the easiest way is to copy these and "search" for them in the text file Find the line "LoadModule cgi_module modules/mod_cgi.so" - make sure it does not have the character '#' at the start of the line. It should look like this LoadModule cgi_module modules/mod_cgi.so not this #LoadModule cgi_module modules/mod_cgi.so Go through the steps as detailed on CK Lesters website A good way to test whether Euphoria is working or not as a CGI implementation is to create a file in your web directory which is "Euphoric" (following what the CK Lester website documents, ends in exw,exu, etcetera) Hit it. If it says "Internal Server Error" then you are away laughinng. Euphoria is working with CGI, you just need to move onto the next step which is simple - the first line of every "euphoria cgi file" should be a "shebang" line - a # followed by the path to the Euphoria interpreter. for now just put the full windows path Secondly, the second line of each file should be this : puts(1,"content-type:text/html\n\n") Then put something like this or whatever: puts(1,"Hello World!") It can get a lot more complicated than this, but you'd be moving onto the world of the world wide web, rather than specific Euphoria example problems. I'm sorry it sounds so complicated, but you'd have to cover half of this to really even get anywhere with PHP, which is *substantially* more complex and slower than Euphoria. On a final note, with Apache every directory is allowed to be defined privelages - in Linux you can define some of these through the Operating System itself - but you can also define these in a file also. You can control a whole lot of shit through the .htaccess file, but you should not need to deal with it certainly not before you've mastered simple euphoria programs. Cheers Frank Too close to Antacrtica, New Zealand > > > Does your ISP allow you to install Euphoria? To modify .htaccess so that > > > Euphoria > > > will be recognised as a program to execute CGI? > > > > Who is .htaccess? > > <a > href="http://en.wikipedia.org/wiki/.htaccess">http://en.wikipedia.org/wiki/.htaccess</a>. > Not > sure why I'm doing your homework for you. You say you've just installed > Apache, but you haven't (for > some reason) read its documentation? > > Oops. Smacks own wrist. > > Reminds self not to respond to troll. > > -- > Craig > Euphoria friendly webhosting: <a > href="http://www.wazu.jp/hosting/euphoria.html">http://www.wazu.jp/hosting/euphoria.html</a>
12. Re: How do you get CGI happening?
- Posted by Jason Gade <jaygade at ya?oo.c?m> Jan 23, 2008
- 661 views
Jerry Story wrote: > > c.k.lester wrote: > > > > Jerry Story wrote: > > > > > > I opened the page in a browser. > > > > > > But just a few minutes ago I put ecoform.htm and economy.exu on my website > > > and > > > then I opened ecoform.htm in a browser. At first it said POST is not > > > allowed. > > > So I changed POST to GET. Now it displays economy.exu. Still don't have it > > > right. > > > > > > economy.exu seems to have code in it that handles GET. > > > > Jerry, you have to have a web server running that receives the incoming > > HTTP request and is able to serve up the page. So, for example, Apache would > > run your exu program and send the output to the browser. > > > > Without the web server, nothing gets served to the browser (or it acts like > > a file viewer). > > What is a web server? I use Telus. Is Telus a web server? > > This is Telus. > http://consumer.telus.com/cgi-ebs/jsp/homepage.jsp > > A few minutes ago I installed Apache. Now what do I gotta do with Apache? I'm no expert on CGI but I think I see the problem here. Others have tried to explain it but let me take a shot. First, let me ask "what do you want to do"? Are you trying to serve web pages to the world from your ISP (Telus) or are you trying to serve web pages from your own personal computer? Usually when you view an HTML file on your personal computer, the web browser is just acting as a file viewer (and maybe a Javascript interpreter as well). By itself, your web browser cannot execute CGI programs. As others have pointed out, you really cannot make Apache work on your own personal computer without reading some of the docs. It's not that hard, though. When you get it running, instead of pointing your browser to "http://c:/somefile.html" you want to point it to "http://127.0.0.1/somefile.html". That's just a basic example, there is a little more to it than that. But that should work if your webserver is running correctly and "somefile.html" is in the location that the webserver expects it to be. As for serving pages up to the world at large via your ISP, you will have to contact their support people and tell them what you want to do and find out whether it is possible or allowed. Hope that helps! -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j.
13. Re: How do you get CGI happening?
- Posted by c.k.lester <euphoric at ckl?ster.com> Jan 23, 2008
- 659 views
Jerry, I've made a few modifications to my web site instructions on using Apache and Euphoria. See if it makes a little more sense. For others, let me know if there is something you think I should add or change to make it more clear. http://www.cklester.com/euphoria/?page=apache
14. Re: How do you get CGI happening?
- Posted by Jules <jdavy at dsl?pipex.c?m> Jan 23, 2008
- 669 views
If you want a VERY easy way to set up Apache etc, nothing is easier than xampp: http://www.apachefriends.org/en/index.html Just download and extract. It's not really intended for "production" use, and by default there are a few security holes, but these are easily fixed.
15. Re: How do you get CGI happening?
- Posted by Jerry Story <story.jerry at gm?il.?om> Jan 24, 2008
- 655 views
- Last edited Jan 25, 2008
Jules wrote: > > If you want a VERY easy way to set up Apache etc, nothing is easier than > xampp: > > <a > href="http://www.apachefriends.org/en/index.html">http://www.apachefriends.org/en/index.html</a> > > Just download and extract. It's not really intended for "production" use, and > by default there are a few security holes, but these are easily fixed. Thanks. I followed the instructions and reached where it said "It works!" Thanks to everyone for their efforts to explain how to get CGI happening. I tried to study the material. All of it is way over my head. CGI programming is too techy for me, so I won't do that. I had no idea it was so difficult. I expected my ISP (Telus) to have Apache and all that stuff installed and ready to go.
16. Re: How do you get CGI happening?
- Posted by Julio C. Galaret Viera <galaret at ?dinet?com.uy> Jan 24, 2008
- 661 views
- Last edited Jan 25, 2008
Jerry Story wrote: > > I had no idea it was so difficult. I expected my ISP (Telus) to have Apache > and all that stuff installed and ready to go. Telus uses Apache as web server: http://toolbar.netcraft.com/site_report?url=http://www.telus.com Keep trying and you'll succeed! JG
17. Re: How do you get CGI happening?
- Posted by c.k.lester <euphoric at ck?ester.c?m> Jan 24, 2008
- 652 views
- Last edited Jan 25, 2008
Jerry Story wrote: > Jules wrote: > > If you want a VERY easy way to set up Apache etc, nothing is easier than > > xampp: > > <a > > href="http://www.apachefriends.org/en/index.html">http://www.apachefriends.org/en/index.html</a> > > Just download and extract. It's not really intended for "production" use, > > and > > by default there are a few security holes, but these are easily fixed. > > Thanks. I followed the instructions and reached where it said "It works!" Good news! :) So, Apache is now successfully installed. If you follow the directions at my site for modifying the Apache configuration file, you'll be running a Euphoria-based website in no time! > I had no idea it was so difficult. I expected my ISP (Telus) to have Apache > and all that stuff installed and ready to go. If Telus is your ISP, then they are probably not your web host. If they ARE your web host, then they probably have Apache installed. You just have to reconfigure it to use it the way you want. Of course, Telus might not allow CGI from its server, in which case you will need to change hosts.