1. Apache, Euphoria, and include files
- Posted by Greg Haberek <ghaberek at wowway.com> May 30, 2004
- 468 views
Ok, so I've installed RedHat 9.0 (text-mode) on my laptop for testing purposes. I setup Apache 2.0.4 and installed Euphoria 2.4. I wrote a quick little script and threw it into the /var/www/cgi-bin directory.
#!/euphoria/bin/exu constant text = "Content-type: text/html\n\n" & "<HTML>\n" & "<HEAD>\n" & " <TITLE>Hello World!</TITLE>\n" & "</HEAD>\n" & "\n" & "<BODY>\n" & " <CENTER>\n" & " <H1>Hello World!</H1>\n" & " </CENTER>\n" & "</BODY>\n" & "\n" & "</HTML>\n" puts(1, text)
So, there you have it, a simple "Hello World!" page. No problem, right? Right. Here's my problem: I'm trying to write a little library to assist me in my HTML endeavors, called html.e. If I insert a line "include html.e" then the script doesn't run. Instead, from my web brower (on another computer on my network) I get a "Server error!" "Error Message: Premature end of script headers: test.exu" I've looked through Rob's code for asearch.exu (for the Archive) and he has plenty of include files, so where am I going wrong? If I have no inlude files the script runs fine, the second there is an include file the script crashes. ~Greg www.finalphasesoftware.com
2. Re: Apache, Euphoria, and include files
- Posted by "Kat" <gertie at visionsix.com> May 30, 2004
- 466 views
On 30 May 2004, at 11:25, Greg Haberek wrote: > > > posted by: Greg Haberek <ghaberek at wowway.com> > > > Ok, so I've installed RedHat 9.0 (text-mode) on my laptop for testing > purposes. > I setup Apache 2.0.4 and installed Euphoria 2.4. I wrote a quick little script > and threw it into the /var/www/cgi-bin directory. > > }}} <eucode> > #!/euphoria/bin/exu > > constant text = > "Content-type: text/html\n\n" & > "<HTML>\n" & > "<HEAD>\n" & > " <TITLE>Hello World!</TITLE>\n" & > "</HEAD>\n" & > "\n" & > "<BODY>\n" & > " <CENTER>\n" & > " <H1>Hello World!</H1>\n" & > " </CENTER>\n" & > "</BODY>\n" & > "\n" & > "</HTML>\n" > > puts(1, text) > </eucode> {{{ > > So, there you have it, a simple "Hello World!" page. No problem, right? Right. > Here's my problem: I'm trying to write a little library to assist me in my > HTML > endeavors, called html.e. If I insert a line "include html.e" then the script > doesn't run. Instead, from my web brower (on another computer on my network) I > get a "Server error!" "Error Message: Premature end of script headers: > test.exu" > I've looked through Rob's code for asearch.exu (for the Archive) and he has > plenty of include files, so where am I going wrong? If I have no inlude files > the script runs fine, the second there is an include file the script crashes. I don't know *nix, but can i suggest the script crashes once it sees the first /n? You don't need any of them in html. Maybe keep one at the end so the server knows you are done. But you are right, the \n should be all acceptable. Kat
3. Re: Apache, Euphoria, and include files
- Posted by Pete Lomax <petelomax at blueyonder.co.uk> May 30, 2004
- 451 views
On Sun, 30 May 2004 11:25:43 -0700, Greg Haberek <guest at RapidEuphoria.com> wrote: >If I insert a line "include html.e" then the script doesn't run. This was answered earlier this year. Put html.e in your cgi-bin directory, or use the full path. Also make sure everyone has read permission on that file. It is "root" or "apache" or somesuch user that is actually running the script, so it is them you need to configure; there is not much point even looking at your own personal EUDIR/EUINC setting. Regards, Pete
4. Re: Apache, Euphoria, and include files
- Posted by Rubens Monteiro Luciano <rml at rubis.trix.net> May 30, 2004
- 474 views
Hi Greg, The include must contain the exact path to the include file, not= =20 only include html.e In my case: include /usr/local/euphoria/include/html.e Also be carefull with the permissions. I=B4m using Apache and Euphoria CGIs, under FEDORA. Good luck Rubens At 15:25 30/5/2004, you wrote: > > >posted by: Greg Haberek <ghaberek at wowway.com> > > >Ok, so I've installed RedHat 9.0 (text-mode) on my laptop for testing=20 >purposes. >I setup Apache 2.0.4 and installed Euphoria 2.4. I wrote a quick little sc= ript >and threw it into the /var/www/cgi-bin directory. > >}}} <eucode> >#!/euphoria/bin/exu > >constant text = > "Content-type: text/html\n\n" & > "<HTML>\n" & > "<HEAD>\n" & > " <TITLE>Hello World!</TITLE>\n" & > "</HEAD>\n" & > "\n" & > "<BODY>\n" & > " <CENTER>\n" & > " <H1>Hello World!</H1>\n" & > " </CENTER>\n" & > "</BODY>\n" & > "\n" & > "</HTML>\n" > >puts(1, text) ></eucode> {{{ > >So, there you have it, a simple "Hello World!" page. No problem, right? Ri= ght. >Here's my problem: I'm trying to write a little library to assist me in my= >HTML endeavors, called html.e. If I insert a line "include html.e" then= =20 >the script >doesn't run. Instead, from my web brower (on another computer on my networ= k) >I get a "Server error!" "Error Message: Premature end of script headers:= =20 >test.exu" >I've looked through Rob's code for asearch.exu (for the Archive) and he= =20 >has plenty of >include files, so where am I going wrong? If I have no inlude files the= =20 >script runs fine, >the second there is an include file the script crashes. > >~Greg >www.finalphasesoftware.com > >--^---------------------------------------------------------------- >This email was sent to: rml at rubis.trix.net > >EASY UNSUBSCRIBE click here: http://topica.com/u/?b1dd66.b4qFOM.cm1sQHJ1 >Or send an email to: EUforum-unsubscribe at topica.com > >For Topica's complete suite of email marketing solutions visit: >http://www.topica.com/?p=TEXFOOTER >--^----------------------------------------------------------------
5. Re: Apache, Euphoria, and include files
- Posted by irv mullins <irvm at ellijay.com> May 30, 2004
- 472 views
Greg Haberek wrote: > > > Ok, so I've installed RedHat 9.0 (text-mode) on my laptop for testing > purposes. > I setup Apache 2.0.4 and installed Euphoria 2.4. I wrote a quick little script > and threw it into the /var/www/cgi-bin directory. <snip> > So, there you have it, a simple "Hello World!" page. No problem, right? Right. > Here's my problem: I'm trying to write a little library to assist me in my > HTML endeavors, called html.e. If I insert a line "include html.e" then the > script > doesn't run. Instead, from my web brower (on another computer on my network) > I get a "Server error!" "Error Message: Premature end of script headers: > test.exu" > I've looked through Rob's code for asearch.exu (for the Archive) and he has > plenty > of > include files, so where am I going wrong? If I have no inlude files the script > runs > fine, > the second there is an include file the script crashes. Apache, for security reasons, doesn't have access to most of the programs, directories, files in your computer. You can copy the needed include files into the cgi directory, or put them somewhere else where Apache can access them - not in your user space! You may also have to change owner and group to apache:apache for those files. And make them read-only! The \n's in your code are fine, they make debugging the resulting HTML easier. Irv