Setting things up
Where the Files should be
On my SuSE 6.4 system the web files served by Apache are stored
in /usr/local/httpd/....
On my Mandrake box, they are in /home/httpd/.......
/usr/local/httpd/htdocs -- contains the html
/usr/local/httpd/htdocs/gif -- contains some graphics,
such as the Apache logo below.
/usr/local/httpd/cgi-bin -- contains the cgi scripts and the
Euphoria interpreter and any necessary includes.The copy of
Euphoria stored here will not be able to access the
normal /home/user/euphoria/include directory that you use for
your normal programming.Be sure to copy any and all includes
you wish to use directly into the /usr/local/httpd/cgi-bin directory.
Permissions
Using KFM, right click on your cgi file(s), and
set the permissions as follows:
| Read | Write | Exec |
User | Yes | Yes | Yes |
Group | | | |
Others | Yes | | Yes |
or from a terminal: chmod 705 cgifile.cgi
Permissions should read: -rwx---r-x in a directory listing.
Your copy of exu or pdexu in the cgi-bin directory should have
the same permissions.
Any support files (includes) should be readable and writable
by yourself and readable by others. -rw-r--r--
Debugging
When a Euphoria cgi script is called from a web server, the
Euphoria error and warning messages will be printed to
/var/log/httpd/error_log.
To watch these messages, open an xterm, and run
tail -f /var/log/httpd/error_log, or, better, run ktail.
You'll probably see there an addition error message:
Can't create error message file: ex.err
That's because wwwrun (the owner of Apache) has no
permission to create a file in the current directory.
To be able to save and view the error file:
1.Set up a folder under / named cgi-errors
2.Set owner to wwwrun, and group to nogroup
3.Set permissions to read, write and change for user only
4.Add lines at the top of your cgi script as follows:
include machine.e
crash_file("/cgi-errors/cgi1.err") -- or some meaningful name.
Now, the usual Euphoria error dump will be available for inspection
if a run-time error is encountered.