1. CGI help

I'm new to this and am trying to study IRV's stuff.

<eucode

  1. !/home/irv/euphoria/bin/exu

constant envars = {"SERVER_NAME","SERVER_PROTOCOL","SERVER_PORT","SERVER_SOFTWARE","SERVER_SIGNATURE", "GATEWAY_INTERFACE","REQUEST_METHOD","HTTP_ACCEPT","PATH","PATH_INFO","PATH_TRANSLATED", "DOCUMENT_ROOT","SCRIPT_NAME","SCRIPT_FILENAME","REQUEST_URI", "QUERY_STRING","REMOTE_HOST","REMOTE_ADDR","REMOTE_USER","UNIQUE_ID", "AUTH_TYPE","CONTENT_TYPE","CONTENT_LENGTH", "HTTP_USER_AGENT","HTTP_HOST","HTTP_CONNECTION", "REMOTE_PORT","SERVER_ADMIN"}

object now now = date()

build html page: puts(1,"Content-type: text/HTML\n\n") most important! puts(1,"<title>CGI-TEST.EX</title>\n") puts(1,"<body>\n") puts(1,"<IMG SRC=\"/gif/suse_150.gif\">\n") note the escaped quotes puts(1,"<H3>Euphoria CGI environmental variables found:</H3>\n") printf(1,"System time: %02d:%02d:%02d\n",{now[4],now[5],now[6]}) printf(1,"System date: %02d/%02d/%4d\n",{now[2],now[3],now[1]+1900})

retrieve values of environmental variables listed above: for i = 1 to length(envars) do if not atom (getenv(envars[i])) then show only initialized vars printf(1, "<LI>%s = %s </LI>", {envars[i], getenv(envars[i])} ) end if end for

end html page: puts(1,"</body></html>\n") </eucode.

When you launch a cgi program from a document (I know how to do that) does the executing program send it's output to the std output like the program above? If so, I can't see the returning document from his example above which I launch from his html document. I see a black screen flash if I run it directly and can see output if I put a gets(0) at the end. I never see anything back on IE....help!

new topic     » topic index » view message » categorize

2. Re: CGI help

GeorgeWalters said...

When you launch a cgi program from a document (I know how to do that) does the executing program send its output to the std output like the program above?

Yes... so long as your server is properly configured. smile

GeorgeWalters said...

If so, I can't see the returning document from his example above which I launch from his html document. I see a black screen flash if I run it directly and can see output if I put a gets(0) at the end. I never see anything back on IE....help!

You have to have a web server (like Apache) running which processes the file first.

See this and this.

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

3. Re: CGI help

euphoric said...
GeorgeWalters said...

When you launch a cgi program from a document (I know how to do that) does the executing program send its output to the std output like the program above?

Yes... so long as your server is properly configured. smile

GeorgeWalters said...

If so, I can't see the returning document from his example above which I launch from his html document. I see a black screen flash if I run it directly and can see output if I put a gets(0) at the end. I never see anything back on IE....help!

You have to have a web server (like Apache) running which processes the file first.

See this and this.

Looks just like what I need. Thanks.

George

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

4. Re: CGI help

How do you get IE on XP to quit poping up the "run, save, cancel" panel when I try to run a cgi script?

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

5. Re: CGI help

GeorgeWalters said...

How do you get IE on XP to quit poping up the "run, save, cancel" panel when I try to run a cgi script?

What are you outputting? Is this the first line (as noted here)?

   puts(1, "Content-type: text/html\n\n") 

Matt

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

6. Re: CGI help

mattlewis said...
GeorgeWalters said...

How do you get IE on XP to quit poping up the "run, save, cancel" panel when I try to run a cgi script?

What are you outputting? Is this the first line (as noted here)?

   puts(1, "Content-type: text/html\n\n") 

Matt

Didn't get that far. I was launching an exe program which would print that stuff.

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

7. Re: CGI help

GeorgeWalters said...

Didn't get that far. I was launching an exe program which would print that stuff.

Then you should be running it on a command line, not from the browser. Also, you'd have to setup your server to allow .exe files to be run as scripts, which is a pretty big security hole.

-Greg

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

8. Re: CGI help

Appear that you are not clear.

The Euphoria program is not called from command line or Open File Menu, must to be called from a web server program. If you have not a web server program running on your windows machine I suggest you Abyss Web Server. See free download at:

http://www.aprelium.com

Apache is the best for Linux or Windows, but is bigger and complex

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

9. Re: CGI help

Well, here is what I need to do. I need for the browser to launch a program(somehow) which reads data from a database, collects the needed stuff and loads it into a template html script which would then be sent back to the browser. So, how can I do that? Right now, all of that is on my laptop which is running apache and I'm trying to launch from IE a cgi program which will build the html script to send back to the browser.

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

10. Re: CGI help

GeorgeWalters said...

Well, here is what I need to do. I need for the browser to launch a program(somehow) which reads data from a database, collects the needed stuff and loads it into a template html script which would then be sent back to the browser. So, how can I do that? Right now, all of that is on my laptop which is running apache and I'm trying to launch from IE a cgi program which will build the html script to send back to the browser.

You have to tell Apache to use Euphoria to run your programs. Have you done that?

For instance, for BBCMF, I use esp as the file extension for files I want to serve my web pages. When you visit bbcmf.com, Apache knows to run index.esp to serve up the site pages. index.esp is a Euphoria program and reads data from a database and completes a template... just like what you want to do.

If you can get this program running, it will be a good start. smile

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

11. Re: CGI help

euphoric said...
GeorgeWalters said...

Well, here is what I need to do. I need for the browser to launch a program(somehow) which reads data from a database, collects the needed stuff and loads it into a template html script which would then be sent back to the browser. So, how can I do that? Right now, all of that is on my laptop which is running apache and I'm trying to launch from IE a cgi program which will build the html script to send back to the browser.

You have to tell Apache to use Euphoria to run your programs. Have you done that?

For instance, for BBCMF, I use esp as the file extension for files I want to serve my web pages. When you visit bbcmf.com, Apache knows to run index.esp to serve up the site pages. index.esp is a Euphoria program and reads data from a database and completes a template... just like what you want to do.

If you can get this program running, it will be a good start. smile

Yes, I just read about telling apache how to handle the euphoria program. This is for running the source as I understand. What I'm trying to do is look ahead to the point when all programs are done and how to xport the set to some customer site. I would want to bind and shroud the resulting programs so I don't have to install all the libraries and EU. Just the exe's. Is there a way to do that?

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

12. Re: CGI help

GeorgeWalters said...
euphoric said...

You have to tell Apache to use Euphoria to run your programs. Have you done that?

I would want to bind and shroud the resulting programs so I don't have to install all the libraries and EU. Just the exe's. Is there a way to do that?

Yes, there's a way to do it. I've never done it though so I'm not yet familiar with how to do it. getlost

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

13. Re: CGI help

Making some headway. If I put this into IE address bar

http://localhost/cgi/cgitest.exw

It will run the cgitest.exw correctly.

But If I have this html segment.

<th width="63" align="left" valign="top" scope="col"> <a onClick="return chkDblClick();" href="/cgi/cgitest.exw"> <img border="0" src="C:/AcuTrackWebDevelopment/go.bmp" alt="cart"> </a> </th>

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

14. Re: CGI help

Making some headway. If I put this into IE address bar

http://localhost/cgi/cgitest.exw

It will run the cgitest.exw correctly with no problem.

But If I have this html segment.

<th width="63" align="left" valign="top" scope="col"> <a onClick="return chkDblClick();" href="/cgi/cgitest.exw"> <img border="0" src="C:/AcuTrackWebDevelopment/go.bmp" alt="cart"> </a> </th>

and click the button. I get this

Internet Explorer cannot display the webpage

Most likely causes: You are not connected to the Internet. The website is encountering problems. There might be a typing error in the address.

What you can try: Diagnose Connection Problems

More information

What have I setup wrong? Any Ideas?

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

15. Re: CGI help

GeorgeWalters said...

<a onClick="return chkDblClick();" href="/cgi/cgitest.exw">

I assume this is on a page found at localhost... Try removing the first slash (before "cgi") from the href parameter, so it becomes:

href="cgi/cgitest.exw" 

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

16. Re: CGI help

euphoric said...
GeorgeWalters said...

<a onClick="return chkDblClick();" href="/cgi/cgitest.exw">

I assume this is on a page found at localhost... Try removing the first slash (before "cgi") from the href parameter, so it becomes:

href="cgi/cgitest.exw" 

I did that, and now windows asks me if I want to open the file. If I open it, windows sends it to crimson editor. I'm apparently missing a setup somewhere.

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

17. Re: CGI help

and this works.

href="http://localhost/cgi/cgitest.exw">

but not /cgi/cgitest.exw

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

18. Re: CGI help

GeorgeWalters said...

but not /cgi/cgitest.exw

That's because the URL formed by the above is probably http://cgi/cgitest.exw, which doesn't exist. Without the slash, it resolves to http://localhost/cgi/cgitest.exw.

But why it doesn't work as a relative URL I don't know.

What is the name of the page on which this link exists? And does the page exist on localhost?

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

19. Re: CGI help

Well, this is the url of the page that calls /cgi/cgitest.exw

C:\AcuTrackWebDevelopment\CBSI\acu-track.com\web\home.html

Here is a clip of httpd.conf

ScriptAlias /cgi/ "C:/AcuTrackWebDevelopment/CBSI/acu-track.com/cgi/"

</IfModule>

<IfModule cgid_module>

  1. #
  2. ScriptSock: On threaded servers, designate the path to the UNIX
  3. socket used to communicate with the CGI daemon of mod_cgid.
  4. #
  5. Scriptsock logs/cgisock </IfModule>
  1. #
  2. "C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin" should be changed to whatever your ScriptAliased
  3. CGI directory exists, if you have that configured.
  4. #

<Directory "C:/AcuTrackWebDevelopment/CBSI/acu-track.com/cgi"> Options FollowSymLinks +ExecCGI AllowOverride None Order allow,deny allow from all </Directory>

See anything here that is wrong?

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

20. Re: CGI help

Revisiting this for a moment...

GeorgeWalters said...

           <a onClick="return chkDblClick();" href="/cgi/cgitest.exw"> 

The onClick is a javascript call that might be intercepting the click before it can go to the href call. If you take out the onClick parameter, does your link work (with or without leading slash)?

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

21. Re: CGI help

euphoric said...

Revisiting this for a moment...

GeorgeWalters said...

           <a onClick="return chkDblClick();" href="/cgi/cgitest.exw"> 

The onClick is a javascript call that might be intercepting the click before it can go to the href call. If you take out the onClick parameter, does your link work (with or without leading slash)?

No, that didn't change anything. If I remove the first '/' then it looks in /web/cgi rather than where it exists, which is C:/AcuTrackWebDevelopment/CBSI/cgi. I'm close but no bananna yet.

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

22. Re: CGI help

GeorgeWalters said...

But If I have this html segment.

      	<th width="63" align="left" valign="top" scope="col"> 
           <a onClick="return chkDblClick();" href="/cgi/cgitest.exw"> 
           <img border="0" src="C:/AcuTrackWebDevelopment/go.bmp" alt="cart"> 
	     </a> 
	</th> 
and click the button. I get this

Internet Explorer cannot display the webpage

What's in the URL bar at this point?

I think it should be http://localhost/cgi/cgitest.exw.

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

23. Re: CGI help

euphoric said...
GeorgeWalters said...

But If I have this html segment.

      	<th width="63" align="left" valign="top" scope="col"> 
           <a onClick="return chkDblClick();" href="/cgi/cgitest.exw"> 
           <img border="0" src="C:/AcuTrackWebDevelopment/go.bmp" alt="cart"> 
	     </a> 
	</th> 
and click the button. I get this

Internet Explorer cannot display the webpage

What's in the URL bar at this point?

I think it should be http://localhost/cgi/cgitest.exw.

c:\cgi\cgitest.exw

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

24. Re: CGI help

GeorgeWalters said...
euphoric said...

What's in the URL bar at this point?

c:\cgi\cgitest.exw

That's probably the problem. That's not a valid URL. IE doesn't know what to do with it.

If I enter a file path in Chrome, say, c:/htdocs/, which is not a valid URL, it converts to a file URL (file:///C:/htdocs/), which is now a valid URL.

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

25. Re: CGI help

euphoric said...
GeorgeWalters said...
euphoric said...

What's in the URL bar at this point?

c:\cgi\cgitest.exw

That's probably the problem. That's not a valid URL. IE doesn't know what to do with it.

If I enter a file path in Chrome, say, c:/htdocs/, which is not a valid URL, it converts to a file URL (file:///C:/htdocs/), which is now a valid URL.

I agree but I can't figure out why it doesen't preprend the correct stuff since it's setup in the httpd.conf. I've made a mistake some where but can't find it. If you want me to post the entire httpd.conf and virtual-hosts.conf I can.

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

26. Re: CGI help

GeorgeWalters said...

Well, this is the url of the page that calls /cgi/cgitest.exw

C:\AcuTrackWebDevelopment\CBSI\acu-track.com\web\home.html

What if you start with http://localhost/home.html?

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

27. Re: CGI help

euphoric said...
GeorgeWalters said...

Well, this is the url of the page that calls /cgi/cgitest.exw

C:\AcuTrackWebDevelopment\CBSI\acu-track.com\web\home.html

What if you start with http://localhost/home.html?

Well, that's interesting. I don't know where that is. If I put that in the address bar IE doensn't know where it is either.

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

28. Re: CGI help

GeorgeWalters said...

I agree but I can't figure out why it doesen't preprend the correct stuff since it's setup in the httpd.conf. I've made a mistake some where but can't find it. If you want me to post the entire httpd.conf and virtual-hosts.conf I can.

I think you need to do this. It seems clear that something is not configured to have cgi work the way you expect it to.

Matt

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

29. Re: CGI help

GeorgeWalters said...
euphoric said...

What if you start with http://localhost/home.html?

Well, that's interesting. I don't know where that is. If I put that in the address bar IE doensn't know where it is either.

There's a directory specified in http.conf like this:

DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs"

What you probably need is this (if it's not already):

DocumentRoot "C:/AcuTrackWebDevelopment/CBSI/acu-track.com/web"

This tells Apache where to look for localhost files.

You have to always use an HTTP URL. You cannot just use a file path.

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

30. Re: CGI help

euphoric said...
GeorgeWalters said...
euphoric said...

What if you start with http://localhost/home.html?

Well, that's interesting. I don't know where that is. If I put that in the address bar IE doensn't know where it is either.

There's a directory specified in http.conf like this:

DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs"

What you probably need is this (if it's not already):

DocumentRoot "C:/AcuTrackWebDevelopment/CBSI/acu-track.com/web"

This tells Apache where to look for localhost files.

You have to always use an HTTP URL. You cannot just use a file path.

Well I did that and http://localhost/cgitest.exw works so does http://acu-track.com/cgitest.exw

but the root is not preprended to /cgi/cgitest.exw when the calling html page links. I have here my entire httpd.conf if you can see something amis. I know it's simple but I don't see it.

  1. #
  2. This is the main Apache HTTP server configuration file. It contains the
  3. configuration directives that give the server its instructions.
  4. See <URL:http://httpd.apache.org/docs/2.2> for detailed information.
  5. In particular, see
  6. <URL:http://httpd.apache.org/docs/2.2/mod/directives.html>
  7. for a discussion of each configuration directive.
  8. #
  9. Do NOT simply read the instructions in here without understanding
  10. what they do. They're here only as hints or reminders. If you are unsure
  11. consult the online docs. You have been warned.
  12. #
  13. Configuration and logfile names: If the filenames you specify for many
  14. of the server's control files begin with "/" (or "drive:/" for Win32), the
  15. server will use that explicit path. If the filenames do *not* begin
  16. with "/", the value of ServerRoot is prepended -- so "logs/foo.log"
  17. with ServerRoot set to "C:/Program Files/Apache Software Foundation/Apache2.2" will be interpreted by the
  18. server as "C:/Program Files/Apache Software Foundation/Apache2.2/logs/foo.log".
  19. #
  20. NOTE: Where filenames are specified, you must use forward slashes
  21. instead of backslashes (e.g., "c:/apache" instead of "c:\apache").
  22. If a drive letter is omitted, the drive on which httpd.exe is located
  23. will be used by default. It is recommended that you always supply
  24. an explicit drive letter in absolute paths to avoid confusion.
  1. #
  2. ServerRoot: The top of the directory tree under which the server's
  3. configuration, error, and log files are kept.
  4. #
  5. Do not add a slash at the end of the directory path. If you point
  6. ServerRoot at a non-local disk, be sure to point the LockFile directive
  7. at a local disk. If you wish to share the same ServerRoot for multiple
  8. httpd daemons, you will need to change at least LockFile and PidFile.
  9. ServerRoot "C:/Program Files/Apache Software Foundation/Apache2.2"
  1. #
  2. Listen: Allows you to bind Apache to specific IP addresses and/or
  3. ports, instead of the default. See also the <VirtualHost>
  4. directive.
  5. #
  6. Change this to Listen on specific IP addresses as shown below to
  7. prevent Apache from glomming onto all bound IP addresses.
  8. #
  9. Listen 12.34.56.78:80 Listen 80
  1. #
  2. Dynamic Shared Object (DSO) Support
  3. #
  4. To be able to use the functionality of a module which was built as a DSO you
  5. have to place corresponding `LoadModule' lines at this location so the
  6. directives contained in it are actually available _before_ they are used.
  7. Statically compiled modules (those listed by `httpd -l') do not need
  8. to be loaded here.
  9. #
  10. Example:
  11. LoadModule foo_module modules/mod_foo.so
  12. LoadModule actions_module modules/mod_actions.so LoadModule alias_module modules/mod_alias.so LoadModule asis_module modules/mod_asis.so LoadModule auth_basic_module modules/mod_auth_basic.so
  13. LoadModule auth_digest_module modules/mod_auth_digest.so
  14. LoadModule authn_alias_module modules/mod_authn_alias.so
  15. LoadModule authn_anon_module modules/mod_authn_anon.so
  16. LoadModule authn_dbd_module modules/mod_authn_dbd.so
  17. LoadModule authn_dbm_module modules/mod_authn_dbm.so LoadModule authn_default_module modules/mod_authn_default.so LoadModule authn_file_module modules/mod_authn_file.so
  18. LoadModule authnz_ldap_module modules/mod_authnz_ldap.so
  19. LoadModule authz_dbm_module modules/mod_authz_dbm.so LoadModule authz_default_module modules/mod_authz_default.so LoadModule authz_groupfile_module modules/mod_authz_groupfile.so LoadModule authz_host_module modules/mod_authz_host.so
  20. LoadModule authz_owner_module modules/mod_authz_owner.so LoadModule authz_user_module modules/mod_authz_user.so LoadModule autoindex_module modules/mod_autoindex.so
  21. LoadModule cache_module modules/mod_cache.so
  22. LoadModule cern_meta_module modules/mod_cern_meta.so LoadModule cgi_module modules/mod_cgi.so
  23. LoadModule charset_lite_module modules/mod_charset_lite.so
  24. LoadModule dav_module modules/mod_dav.so
  25. LoadModule dav_fs_module modules/mod_dav_fs.so
  26. LoadModule dav_lock_module modules/mod_dav_lock.so
  27. LoadModule dbd_module modules/mod_dbd.so
  28. LoadModule deflate_module modules/mod_deflate.so LoadModule dir_module modules/mod_dir.so
  29. LoadModule disk_cache_module modules/mod_disk_cache.so
  30. LoadModule dumpio_module modules/mod_dumpio.so LoadModule env_module modules/mod_env.so
  31. LoadModule expires_module modules/mod_expires.so
  32. LoadModule ext_filter_module modules/mod_ext_filter.so
  33. LoadModule file_cache_module modules/mod_file_cache.so
  34. LoadModule filter_module modules/mod_filter.so
  35. LoadModule headers_module modules/mod_headers.so
  36. LoadModule ident_module modules/mod_ident.so
  37. LoadModule imagemap_module modules/mod_imagemap.so LoadModule include_module modules/mod_include.so
  38. LoadModule info_module modules/mod_info.so LoadModule isapi_module modules/mod_isapi.so
  39. LoadModule ldap_module modules/mod_ldap.so
  40. LoadModule logio_module modules/mod_logio.so LoadModule log_config_module modules/mod_log_config.so
  41. LoadModule log_forensic_module modules/mod_log_forensic.so
  42. LoadModule mem_cache_module modules/mod_mem_cache.so LoadModule mime_module modules/mod_mime.so
  43. LoadModule mime_magic_module modules/mod_mime_magic.so LoadModule negotiation_module modules/mod_negotiation.so
  44. LoadModule proxy_module modules/mod_proxy.so
  45. LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
  46. LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
  47. LoadModule proxy_connect_module modules/mod_proxy_connect.so
  48. LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
  49. LoadModule proxy_http_module modules/mod_proxy_http.so
  50. LoadModule rewrite_module modules/mod_rewrite.so LoadModule setenvif_module modules/mod_setenvif.so
  51. LoadModule speling_module modules/mod_speling.so
  52. LoadModule ssl_module modules/mod_ssl.so
  53. LoadModule status_module modules/mod_status.so
  54. LoadModule substitute_module modules/mod_substitute.so
  55. LoadModule unique_id_module modules/mod_unique_id.so
  56. LoadModule userdir_module modules/mod_userdir.so
  57. LoadModule usertrack_module modules/mod_usertrack.so
  58. LoadModule version_module modules/mod_version.so
  59. LoadModule vhost_alias_module modules/mod_vhost_alias.so

<IfModule !mpm_netware_module> <IfModule !mpm_winnt_module>

  1. #
  2. If you wish httpd to run as a different user or group, you must run
  3. httpd as root initially and it will switch.
  4. #
  5. User/Group: The name (or #number) of the user/group to run httpd as.
  6. It is usually good practice to create a dedicated user and group for
  7. running httpd, as with most system services.
  8. User daemon Group daemon

</IfModule> </IfModule>

  1. 'Main' server configuration
  2. #
  3. The directives in this section set up the values used by the 'main'
  4. server, which responds to any requests that aren't handled by a
  5. <VirtualHost> definition. These values also provide defaults for
  6. any <VirtualHost> containers you may define later in the file.
  7. #
  8. All of these directives may appear inside <VirtualHost> containers,
  9. in which case these default settings will be overridden for the
  10. virtual host being defined.
  11. #
  1. #
  2. ServerAdmin: Your address, where problems with the server should be
  3. e-mailed. This address appears on some server-generated pages, such
  4. as error documents. e.g. admin@your-domain.com
  5. ServerAdmin gwalters@acu-track.com
  1. #
  2. ServerName gives the name and port that the server uses to identify itself.
  3. This can often be determined automatically, but we recommend you specify
  4. it explicitly to prevent problems during startup.
  5. #
  6. If your host doesn't have a registered DNS name, enter its IP address here.
  7. #
  8. ServerName localhost:80
  1. #
  2. DocumentRoot: The directory out of which you will serve your
  3. documents. By default, all requests are taken from this directory, but
  4. symbolic links and aliases may be used to point to other locations.
  5. #
  6. DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs"

DocumentRoot "C:/AcuTrackWebDevelopment/CBSI/acu-track.com"

  1. #
  2. Each directory to which Apache has access can be configured with respect
  3. to which services and features are allowed and/or disabled in that
  4. directory (and its subdirectories).
  5. #
  6. First, we configure the "default" to be a very restrictive set of
  7. features.
  8. <Directory /> Options FollowSymLinks AllowOverride None Order deny,allow Deny from all </Directory>

<Directory "C:/AcuTrackWebDevelopment/CBSI/acu-track.com"> Options FollowSymLinks +ExecCGI AllowOverride None Order allow,deny allow from all </Directory>

<Directory "C:/AcuTrackWebDevelopment/CBSI/lc.acu-track.com"> Options FollowSymLinks +ExecCGI AllowOverride None Order allow,deny allow from all </Directory>

  1. #
  2. Note that from this point forward you must specifically allow
  3. particular features to be enabled - so if something's not working as
  4. you might expect, make sure that you have specifically enabled it
  5. below.
  6. #
  1. #
  2. This should be changed to whatever you set DocumentRoot to.
  3. <Directory "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs">
  4. #
  5. Possible values for the Options directive are "None", "All",
  6. or any combination of:
  7. Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
  8. #
  9. Note that "MultiViews" must be named *explicitly*
  10. doesn't give it to you.
  11. #
  12. The Options directive is both complicated and important. Please see
  13. http://httpd.apache.org/docs/2.2/mod/core.html#options
  14. for more information.
  15. Options Indexes FollowSymLinks
  1. #
  2. AllowOverride controls what directives may be placed in .htaccess files.
  3. It can be "All", "None", or any combination of the keywords:
  4. Options FileInfo AuthConfig Limit
  5. AllowOverride None
  1. #
  2. Controls who can get stuff from this server.
  3. Order allow,deny Allow from all

</Directory>

  1. #
  2. DirectoryIndex: sets the file that Apache will serve if a directory
  3. is requested.
  4. <IfModule dir_module> DirectoryIndex home.html #index.html </IfModule>
  1. #
  2. The following lines prevent .htaccess and .htpasswd files from being
  3. viewed by Web clients.
  4. <FilesMatch "^\.ht"> Order allow,deny Deny from all Satisfy All </FilesMatch>
  1. #
  2. ErrorLog: The location of the error log file.
  3. If you do not specify an ErrorLog directive within a <VirtualHost>
  4. container, error messages relating to that virtual host will be
  5. logged here. If you *do* define an error logfile for a <VirtualHost>
  6. container, that host's errors will be logged there and not here.
  7. ErrorLog "logs/error.log"
  1. #
  2. LogLevel: Control the number of messages logged to the error_log.
  3. Possible values include: debug, info, notice, warn, error, crit,
  4. alert, emerg.
  5. LogLevel warn

<IfModule log_config_module>

  1. #
  2. The following directives define some format nicknames for use with
  3. a CustomLog directive (see below).
  4. LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined LogFormat "%h %l %u %t \"%r\" %>s %b" common

<IfModule logio_module>

  1. You need to enable mod_logio.c to use %I and %O LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio </IfModule>
  1. #
  2. The location and format of the access logfile (Common Logfile Format).
  3. If you do not define any access logfiles within a <VirtualHost>
  4. container, they will be logged here. Contrariwise, if you *do*
  5. define per-<VirtualHost> access logfiles, transactions will be
  6. logged therein and *not* in this file.
  7. CustomLog "logs/access.log" common
  1. #
  2. If you prefer a logfile with access, agent, and referer information
  3. (Combined Logfile Format) you can use the following directive.
  4. #
  5. CustomLog "logs/access.log" combined </IfModule>

<IfModule alias_module>

  1. #
  2. Redirect: Allows you to tell clients about documents that used to
  3. exist in your server's namespace, but do not anymore. The client
  4. will make a new request for the document at its new location.
  5. Example:
  6. Redirect permanent /foo http://localhost/bar
  1. #
  2. Alias: Maps web paths into filesystem paths and is used to
  3. access content that does not live under the DocumentRoot.
  4. Example:
  5. Alias /webpath /full/filesystem/path
  6. #
  7. If you include a trailing / on /webpath then the server will
  8. require it to be present in the URL. You will also likely
  9. need to provide a <Directory> section to allow access to
  10. the filesystem path.
  1. #
  2. ScriptAlias: This controls which directories contain server scripts.
  3. ScriptAliases are essentially the same as Aliases, except that
  4. documents in the target directory are treated as applications and
  5. run by the server when requested rather than as documents sent to the
  6. client. The same rules about trailing "/" apply to ScriptAlias
  7. directives as to Alias.
  8. #
  9. ScriptAlias /cgi-bin/ "C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/"
  10. ScriptAlias /cgi/ "C:/AcuTrackWebDevelopment/CBSI/lc.acu-track.com/cgi/"

ScriptAlias /cgi/ "C:/AcuTrackWebDevelopment/CBSI/acu-track.com/cgi/"

</IfModule>

<IfModule cgid_module>

  1. #
  2. ScriptSock: On threaded servers, designate the path to the UNIX
  3. socket used to communicate with the CGI daemon of mod_cgid.
  4. #
  5. Scriptsock logs/cgisock </IfModule>
  1. #
  2. "C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin" should be changed to whatever your ScriptAliased
  3. CGI directory exists, if you have that configured.
  4. #

<Directory "C:/AcuTrackWebDevelopment/CBSI/acu-track.com/cgi"> Options FollowSymLinks +ExecCGI AllowOverride None Order allow,deny allow from all </Directory>

  1. #
  2. DefaultType: the default MIME type the server will use for a document
  3. if it cannot otherwise determine one, such as from filename extensions.
  4. If your server contains mostly text or HTML documents, "text/plain" is
  5. a good value. If most of your content is binary, such as applications
  6. or images, you may want to use "application/octet-stream" instead to
  7. keep browsers from trying to display binary files as though they are
  8. text.
  9. DefaultType text/plain

<IfModule mime_module>

  1. #
  2. TypesConfig points to the file containing the list of mappings from
  3. filename extension to MIME-type.
  4. TypesConfig conf/mime.types
  1. #
  2. AddType allows you to add to or override the MIME configuration
  3. file specified in TypesConfig for specific file types.
  4. #
  5. AddType application/x-gzip .tgz
  6. #
  7. AddEncoding allows you to have certain browsers uncompress
  8. information on the fly. Note: Not all browsers support this.
  9. #
  10. AddEncoding x-compress .Z
  11. AddEncoding x-gzip .gz .tgz
  12. #
  13. If the AddEncoding directives above are commented-out, then you
  14. probably should define those extensions to indicate media types:
  15. AddType application/x-compress .Z AddType application/x-gzip .gz .tgz
  1. #
  2. AddHandler allows you to map certain file extensions to "handlers":
  3. actions unrelated to filetype. These can be either built into the server
  4. or added with the Action directive (see below)
  5. #
  6. To use CGI scripts outside of ScriptAliased directories:
  7. (You will also need to add "ExecCGI" to the "Options" directive.)
  8. AddHandler cgi-script .cgi .exw
  1. For type maps (negotiated resources):
  2. AddHandler type-map var
  1. #
  2. Filters allow you to process content before it is sent to the client.
  3. #
  4. To parse .shtml files for server-side includes (SSI):
  5. (You will also need to add "Includes" to the "Options" directive.)
  6. #
  7. AddType text/html .shtml
  8. AddOutputFilter INCLUDES .shtml </IfModule>
  1. #
  2. The mod_mime_magic module allows the server to use various hints from the
  3. contents of the file itself to determine its type. The MIMEMagicFile
  4. directive tells the module where the hint definitions are located.
  5. #
  6. MIMEMagicFile conf/magic
  1. #
  2. Customizable error responses come in three flavors:
  3. 1) plain text 2) local redirects 3) external redirects
  4. #
  5. Some examples:
  6. ErrorDocument 500 "The server made a boo boo."
  7. ErrorDocument 404 /missing.html
  8. ErrorDocument 404 "/cgi-bin/missing_handler.pl"
  9. ErrorDocument 402 http://localhost/subscription_info.html
  10. #
  1. #
  2. EnableMMAP and EnableSendfilefile: On systems that support it,
  3. memory-mapping or the sendfile syscall is used to deliver
  4. files. This usually improves server performance, but must
  5. be turned off when serving from networked-mounted
  6. filesystems or if support for these functions is otherwise
  7. broken on your system.
  8. #
  9. EnableMMAP off
  10. EnableSendfile off
  1. Supplemental configuration
  2. #
  3. The configuration files in the conf/extra/ directory can be
  4. included to add extra features or to modify the default configuration of
  5. the server, or you may simply copy their contents here and change as
  6. necessary.
  1. Server-pool management (MPM specific)
  2. Include conf/extra/httpd-mpm.conf
  1. Multi-language error messages
  2. Include conf/extra/httpd-multilang-errordoc.conf
  1. Fancy directory listings
  2. Include conf/extra/httpd-autoindex.conf
  1. Language settings
  2. Include conf/extra/httpd-languages.conf
  1. User home directories
  2. Include conf/extra/httpd-userdir.conf
  1. Real-time info on requests and configuration
  2. Include conf/extra/httpd-info.conf
  1. Virtual hosts
  2. Include conf/extra/httpd-vhosts.conf
  1. Local access to the Apache HTTP Server Manual
  2. Include conf/extra/httpd-manual.conf
  1. Distributed authoring and versioning (WebDAV)
  2. Include conf/extra/httpd-dav.conf
  1. Various default settings
  2. Include conf/extra/httpd-default.conf
  1. Secure (SSL/TLS) connections
  2. Include conf/extra/httpd-ssl.conf
  3. #
  4. Note: The following must must be present to support
  5. starting without SSL on platforms with no /dev/random equivalent
  6. but a statically compiled-in mod_ssl.
  7. <IfModule ssl_module> SSLRandomSeed startup builtin SSLRandomSeed connect builtin </IfModule>
  8. JRun Settings LoadModule jrun_module "C:/ColdFusion8/runtime/lib/wsconfig/1/mod_jrun22.so" <IfModule mod_jrun22.c> JRunConfig Verbose false JRunConfig Apialloc false JRunConfig Ignoresuffixmap false JRunConfig Serverstore "C:/ColdFusion8/runtime/lib/wsconfig/1/jrunserver.store" JRunConfig Bootstrap 127.0.0.1:51011
  9. JRunConfig Errorurl url <optionally redirect to this URL on errors>
  10. JRunConfig ProxyRetryInterval 600 <number of seconds to wait before trying to reconnect to unreachable clustered server>
  11. JRunConfig ConnectTimeout 15 <number of seconds to wait on a socket connect to a jrun server>
  12. JRunConfig RecvTimeout 300 <number of seconds to wait on a socket receive to a jrun server>
  13. JRunConfig SendTimeout 15 <number of seconds to wait on a socket send to a jrun server> AddHandler jrun-handler .jsp .jws </IfModule>

Include conf/virtual-hosts.conf

Here also is virtual-hosts.conf

  1. Use name-based virtual hosting NameVirtualHost *:80

<VirtualHost *:80>

ServerName lc.acu-track.com DocumentRoot C:/AcuTrackWebDevelopment/CBSI/lc.acu-track.com CustomLog logs/lc.acu-track.com.access.log combined ErrorLog logs/lc.acu-track.com.error.log

</VirtualHost>

<VirtualHost *:80>

ServerName acu-track.com DocumentRoot C:/AcuTrackWebDevelopment/CBSI/acu-track.com CustomLog logs/acu-track.com.access.log combined ErrorLog logs/acu-track.com.error.log

</VirtualHost>

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

31. Re: CGI help

Well that copy and paste into the forum looks like crap. Any better way to paste it? It doesen't look anything like I copied. I could email them if I had your addresses if you can't read the post.

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

32. Re: CGI help

mattlewis said...
GeorgeWalters said...

I agree but I can't figure out why it doesen't preprend the correct stuff since it's setup in the httpd.conf. I've made a mistake some where but can't find it. If you want me to post the entire httpd.conf and virtual-hosts.conf I can.

I think you need to do this. It seems clear that something is not configured to have cgi work the way you expect it to.

Matt

Matt, I missed something. What did you suggest?

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

33. Re: CGI help

GeorgeWalters said...
euphoric said...

There's a directory specified in http.conf like this:

DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs"

What you probably need is this (if it's not already):

DocumentRoot "C:/AcuTrackWebDevelopment/CBSI/acu-track.com/web"

Well I did that and http://localhost/cgitest.exw works so does http://acu-track.com/cgitest.exw

Okay, the only file in the root should be home.html. Does home.html get served from localhost or the acu-track.com location?

If so, your CGI program (cgitest.exw) needs to be in the path specified by your ScriptAlias directive, which is the following:

C:/AcuTrackWebDevelopment/CBSI/acu-track.com/cgi/

Put cgitest.exw there and see if it works.

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

34. Re: CGI help

Formatted using {{{ }}}

# 
# This is the main Apache HTTP server configuration file.  It contains the 
# configuration directives that give the server its instructions. 
# See <URL:http://httpd.apache.org/docs/2.2> for detailed information. 
# In particular, see  
# <URL:http://httpd.apache.org/docs/2.2/mod/directives.html> 
# for a discussion of each configuration directive. 
# 
# Do NOT simply read the instructions in here without understanding 
# what they do.  They're here only as hints or reminders.  If you are unsure 
# consult the online docs. You have been warned.   
# 
# Configuration and logfile names: If the filenames you specify for many 
# of the server's control files begin with "/" (or "drive:/" for Win32), the 
# server will use that explicit path.  If the filenames do *not* begin 
# with "/", the value of ServerRoot is prepended -- so "logs/foo.log" 
# with ServerRoot set to "C:/Program Files/Apache Software Foundation/Apache2.2" will be interpreted by the 
# server as "C:/Program Files/Apache Software Foundation/Apache2.2/logs/foo.log". 
# 
# NOTE: Where filenames are specified, you must use forward slashes 
# instead of backslashes (e.g., "c:/apache" instead of "c:\apache"). 
# If a drive letter is omitted, the drive on which httpd.exe is located 
# will be used by default.  It is recommended that you always supply 
# an explicit drive letter in absolute paths to avoid confusion. 
 
# 
# ServerRoot: The top of the directory tree under which the server's 
# configuration, error, and log files are kept. 
# 
# Do not add a slash at the end of the directory path.  If you point 
# ServerRoot at a non-local disk, be sure to point the LockFile directive 
# at a local disk.  If you wish to share the same ServerRoot for multiple 
# httpd daemons, you will need to change at least LockFile and PidFile. 
# 
ServerRoot "C:/Program Files/Apache Software Foundation/Apache2.2" 
 
# 
# Listen: Allows you to bind Apache to specific IP addresses and/or 
# ports, instead of the default. See also the <VirtualHost> 
# directive. 
# 
# Change this to Listen on specific IP addresses as shown below to  
# prevent Apache from glomming onto all bound IP addresses. 
# 
#Listen 12.34.56.78:80 
Listen 80 
 
# 
# Dynamic Shared Object (DSO) Support 
# 
# To be able to use the functionality of a module which was built as a DSO you 
# have to place corresponding `LoadModule' lines at this location so the 
# directives contained in it are actually available _before_ they are used. 
# Statically compiled modules (those listed by `httpd -l') do not need 
# to be loaded here. 
# 
# Example: 
# LoadModule foo_module modules/mod_foo.so 
# 
LoadModule actions_module modules/mod_actions.so 
LoadModule alias_module modules/mod_alias.so 
LoadModule asis_module modules/mod_asis.so 
LoadModule auth_basic_module modules/mod_auth_basic.so 
#LoadModule auth_digest_module modules/mod_auth_digest.so 
#LoadModule authn_alias_module modules/mod_authn_alias.so 
#LoadModule authn_anon_module modules/mod_authn_anon.so 
#LoadModule authn_dbd_module modules/mod_authn_dbd.so 
#LoadModule authn_dbm_module modules/mod_authn_dbm.so 
LoadModule authn_default_module modules/mod_authn_default.so 
LoadModule authn_file_module modules/mod_authn_file.so 
#LoadModule authnz_ldap_module modules/mod_authnz_ldap.so 
#LoadModule authz_dbm_module modules/mod_authz_dbm.so 
LoadModule authz_default_module modules/mod_authz_default.so 
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so 
LoadModule authz_host_module modules/mod_authz_host.so 
#LoadModule authz_owner_module modules/mod_authz_owner.so 
LoadModule authz_user_module modules/mod_authz_user.so 
LoadModule autoindex_module modules/mod_autoindex.so 
#LoadModule cache_module modules/mod_cache.so 
#LoadModule cern_meta_module modules/mod_cern_meta.so 
LoadModule cgi_module modules/mod_cgi.so 
#LoadModule charset_lite_module modules/mod_charset_lite.so 
#LoadModule dav_module modules/mod_dav.so 
#LoadModule dav_fs_module modules/mod_dav_fs.so 
#LoadModule dav_lock_module modules/mod_dav_lock.so 
#LoadModule dbd_module modules/mod_dbd.so 
#LoadModule deflate_module modules/mod_deflate.so 
LoadModule dir_module modules/mod_dir.so 
#LoadModule disk_cache_module modules/mod_disk_cache.so 
#LoadModule dumpio_module modules/mod_dumpio.so 
LoadModule env_module modules/mod_env.so 
#LoadModule expires_module modules/mod_expires.so 
#LoadModule ext_filter_module modules/mod_ext_filter.so 
#LoadModule file_cache_module modules/mod_file_cache.so 
#LoadModule filter_module modules/mod_filter.so 
#LoadModule headers_module modules/mod_headers.so 
#LoadModule ident_module modules/mod_ident.so 
#LoadModule imagemap_module modules/mod_imagemap.so 
LoadModule include_module modules/mod_include.so 
#LoadModule info_module modules/mod_info.so 
LoadModule isapi_module modules/mod_isapi.so 
#LoadModule ldap_module modules/mod_ldap.so 
#LoadModule logio_module modules/mod_logio.so 
LoadModule log_config_module modules/mod_log_config.so 
#LoadModule log_forensic_module modules/mod_log_forensic.so 
#LoadModule mem_cache_module modules/mod_mem_cache.so 
LoadModule mime_module modules/mod_mime.so 
#LoadModule mime_magic_module modules/mod_mime_magic.so 
LoadModule negotiation_module modules/mod_negotiation.so 
#LoadModule proxy_module modules/mod_proxy.so 
#LoadModule proxy_ajp_module modules/mod_proxy_ajp.so 
#LoadModule proxy_balancer_module modules/mod_proxy_balancer.so 
#LoadModule proxy_connect_module modules/mod_proxy_connect.so 
#LoadModule proxy_ftp_module modules/mod_proxy_ftp.so 
#LoadModule proxy_http_module modules/mod_proxy_http.so 
#LoadModule rewrite_module modules/mod_rewrite.so 
LoadModule setenvif_module modules/mod_setenvif.so 
#LoadModule speling_module modules/mod_speling.so 
#LoadModule ssl_module modules/mod_ssl.so 
#LoadModule status_module modules/mod_status.so 
#LoadModule substitute_module modules/mod_substitute.so 
#LoadModule unique_id_module modules/mod_unique_id.so 
#LoadModule userdir_module modules/mod_userdir.so 
#LoadModule usertrack_module modules/mod_usertrack.so 
#LoadModule version_module modules/mod_version.so 
#LoadModule vhost_alias_module modules/mod_vhost_alias.so 
 
<IfModule !mpm_netware_module> 
<IfModule !mpm_winnt_module> 
# 
# If you wish httpd to run as a different user or group, you must run 
# httpd as root initially and it will switch.   
# 
# User/Group: The name (or #number) of the user/group to run httpd as. 
# It is usually good practice to create a dedicated user and group for 
# running httpd, as with most system services. 
# 
User daemon 
Group daemon 
 
</IfModule> 
</IfModule> 
 
# 'Main' server configuration 
# 
# The directives in this section set up the values used by the 'main' 
# server, which responds to any requests that aren't handled by a 
# <VirtualHost> definition.  These values also provide defaults for 
# any <VirtualHost> containers you may define later in the file. 
# 
# All of these directives may appear inside <VirtualHost> containers, 
# in which case these default settings will be overridden for the 
# virtual host being defined. 
# 
 
# 
# ServerAdmin: Your address, where problems with the server should be 
# e-mailed.  This address appears on some server-generated pages, such 
# as error documents.  e.g. admin@your-domain.com 
# 
ServerAdmin gwalters@acu-track.com 
 
# 
# ServerName gives the name and port that the server uses to identify itself. 
# This can often be determined automatically, but we recommend you specify 
# it explicitly to prevent problems during startup. 
# 
# If your host doesn't have a registered DNS name, enter its IP address here. 
# 
#ServerName localhost:80 
 
# 
# DocumentRoot: The directory out of which you will serve your 
# documents. By default, all requests are taken from this directory, but 
# symbolic links and aliases may be used to point to other locations. 
# 
#DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs" 
 
DocumentRoot "C:/AcuTrackWebDevelopment/CBSI/acu-track.com" 
 
# 
# Each directory to which Apache has access can be configured with respect 
# to which services and features are allowed and/or disabled in that 
# directory (and its subdirectories).  
# 
# First, we configure the "default" to be a very restrictive set of  
# features.   
# 
<Directory /> 
    Options FollowSymLinks 
    AllowOverride None 
    Order deny,allow 
    Deny from all 
</Directory> 
 
<Directory "C:/AcuTrackWebDevelopment/CBSI/acu-track.com"> 
    Options FollowSymLinks +ExecCGI 
    AllowOverride None 
    Order allow,deny 
    allow from all 
</Directory> 
 
<Directory "C:/AcuTrackWebDevelopment/CBSI/lc.acu-track.com"> 
    Options FollowSymLinks +ExecCGI 
    AllowOverride None 
    Order allow,deny 
    allow from all 
</Directory> 
 
# 
# Note that from this point forward you must specifically allow 
# particular features to be enabled - so if something's not working as 
# you might expect, make sure that you have specifically enabled it 
# below. 
# 
 
# 
# This should be changed to whatever you set DocumentRoot to. 
# 
<Directory "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs"> 
    # 
    # Possible values for the Options directive are "None", "All", 
    # or any combination of: 
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews 
    # 
    # Note that "MultiViews" must be named *explicitly* --- "Options All" 
    # doesn't give it to you. 
    # 
    # The Options directive is both complicated and important.  Please see 
    # http://httpd.apache.org/docs/2.2/mod/core.html#options 
    # for more information. 
    # 
    Options Indexes FollowSymLinks 
 
    # 
    # AllowOverride controls what directives may be placed in .htaccess files. 
    # It can be "All", "None", or any combination of the keywords: 
    #   Options FileInfo AuthConfig Limit 
    # 
    AllowOverride None 
 
    # 
    # Controls who can get stuff from this server. 
    # 
    Order allow,deny 
    Allow from all 
 
</Directory> 
 
# 
# DirectoryIndex: sets the file that Apache will serve if a directory 
# is requested. 
# 
<IfModule dir_module> 
    DirectoryIndex home.html #index.html 
</IfModule> 
 
# 
# The following lines prevent .htaccess and .htpasswd files from being  
# viewed by Web clients.  
# 
<FilesMatch "^\.ht"> 
    Order allow,deny 
    Deny from all 
    Satisfy All 
</FilesMatch> 
 
# 
# ErrorLog: The location of the error log file. 
# If you do not specify an ErrorLog directive within a <VirtualHost> 
# container, error messages relating to that virtual host will be 
# logged here.  If you *do* define an error logfile for a <VirtualHost> 
# container, that host's errors will be logged there and not here. 
# 
ErrorLog "logs/error.log" 
 
# 
# LogLevel: Control the number of messages logged to the error_log. 
# Possible values include: debug, info, notice, warn, error, crit, 
# alert, emerg. 
# 
LogLevel warn 
 
<IfModule log_config_module> 
    # 
    # The following directives define some format nicknames for use with 
    # a CustomLog directive (see below). 
    # 
    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined 
    LogFormat "%h %l %u %t \"%r\" %>s %b" common 
 
    <IfModule logio_module> 
      # You need to enable mod_logio.c to use %I and %O 
      LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio 
    </IfModule> 
 
    # 
    # The location and format of the access logfile (Common Logfile Format). 
    # If you do not define any access logfiles within a <VirtualHost> 
    # container, they will be logged here.  Contrariwise, if you *do* 
    # define per-<VirtualHost> access logfiles, transactions will be 
    # logged therein and *not* in this file. 
    # 
    CustomLog "logs/access.log" common 
 
    # 
    # If you prefer a logfile with access, agent, and referer information 
    # (Combined Logfile Format) you can use the following directive. 
    # 
    #CustomLog "logs/access.log" combined 
</IfModule> 
 
<IfModule alias_module> 
    # 
    # Redirect: Allows you to tell clients about documents that used to  
    # exist in your server's namespace, but do not anymore. The client  
    # will make a new request for the document at its new location. 
    # Example: 
    # Redirect permanent /foo http://localhost/bar 
 
    # 
    # Alias: Maps web paths into filesystem paths and is used to 
    # access content that does not live under the DocumentRoot. 
    # Example: 
    # Alias /webpath /full/filesystem/path 
    # 
    # If you include a trailing / on /webpath then the server will 
    # require it to be present in the URL.  You will also likely 
    # need to provide a <Directory> section to allow access to 
    # the filesystem path. 
 
    # 
    # ScriptAlias: This controls which directories contain server scripts.  
    # ScriptAliases are essentially the same as Aliases, except that 
    # documents in the target directory are treated as applications and 
    # run by the server when requested rather than as documents sent to the 
    # client.  The same rules about trailing "/" apply to ScriptAlias 
    # directives as to Alias. 
    # 
    #ScriptAlias /cgi-bin/ "C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/" 
	#ScriptAlias /cgi/ "C:/AcuTrackWebDevelopment/CBSI/lc.acu-track.com/cgi/" 
	 
	ScriptAlias /cgi/ "C:/AcuTrackWebDevelopment/CBSI/acu-track.com/cgi/" 
 
</IfModule> 
 
<IfModule cgid_module> 
    # 
    # ScriptSock: On threaded servers, designate the path to the UNIX 
    # socket used to communicate with the CGI daemon of mod_cgid. 
    # 
    #Scriptsock logs/cgisock 
</IfModule> 
 
# 
# "C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin" should be changed to whatever your ScriptAliased 
# CGI directory exists, if you have that configured. 
# 
 
 
<Directory "C:/AcuTrackWebDevelopment/CBSI/acu-track.com/cgi"> 
    Options FollowSymLinks +ExecCGI 
    AllowOverride None 
    Order allow,deny 
    allow from all 
</Directory> 
 
# 
# DefaultType: the default MIME type the server will use for a document 
# if it cannot otherwise determine one, such as from filename extensions. 
# If your server contains mostly text or HTML documents, "text/plain" is 
# a good value.  If most of your content is binary, such as applications 
# or images, you may want to use "application/octet-stream" instead to 
# keep browsers from trying to display binary files as though they are 
# text. 
# 
DefaultType text/plain 
 
<IfModule mime_module> 
    # 
    # TypesConfig points to the file containing the list of mappings from 
    # filename extension to MIME-type. 
    # 
    TypesConfig conf/mime.types 
 
    # 
    # AddType allows you to add to or override the MIME configuration 
    # file specified in TypesConfig for specific file types. 
    # 
    #AddType application/x-gzip .tgz 
    # 
    # AddEncoding allows you to have certain browsers uncompress 
    # information on the fly. Note: Not all browsers support this. 
    # 
    #AddEncoding x-compress .Z 
    #AddEncoding x-gzip .gz .tgz 
    # 
    # If the AddEncoding directives above are commented-out, then you 
    # probably should define those extensions to indicate media types: 
    # 
    AddType application/x-compress .Z 
    AddType application/x-gzip .gz .tgz 
 
    # 
    # AddHandler allows you to map certain file extensions to "handlers": 
    # actions unrelated to filetype. These can be either built into the server 
    # or added with the Action directive (see below) 
    # 
    # To use CGI scripts outside of ScriptAliased directories: 
    # (You will also need to add "ExecCGI" to the "Options" directive.) 
    # 
    AddHandler cgi-script .cgi .exw 
 
    # For type maps (negotiated resources): 
    #AddHandler type-map var 
 
    # 
    # Filters allow you to process content before it is sent to the client. 
    # 
    # To parse .shtml files for server-side includes (SSI): 
    # (You will also need to add "Includes" to the "Options" directive.) 
    # 
    #AddType text/html .shtml 
    #AddOutputFilter INCLUDES .shtml 
</IfModule> 
 
# 
# The mod_mime_magic module allows the server to use various hints from the 
# contents of the file itself to determine its type.  The MIMEMagicFile 
# directive tells the module where the hint definitions are located. 
# 
#MIMEMagicFile conf/magic 
 
# 
# Customizable error responses come in three flavors: 
# 1) plain text 2) local redirects 3) external redirects 
# 
# Some examples: 
#ErrorDocument 500 "The server made a boo boo." 
#ErrorDocument 404 /missing.html 
#ErrorDocument 404 "/cgi-bin/missing_handler.pl" 
#ErrorDocument 402 http://localhost/subscription_info.html 
# 
 
# 
# EnableMMAP and EnableSendfile: On systems that support it,  
# memory-mapping or the sendfile syscall is used to deliver 
# files.  This usually improves server performance, but must 
# be turned off when serving from networked-mounted  
# filesystems or if support for these functions is otherwise 
# broken on your system. 
# 
#EnableMMAP off 
#EnableSendfile off 
 
# Supplemental configuration 
# 
# The configuration files in the conf/extra/ directory can be  
# included to add extra features or to modify the default configuration of  
# the server, or you may simply copy their contents here and change as  
# necessary. 
 
# Server-pool management (MPM specific) 
#Include conf/extra/httpd-mpm.conf 
 
# Multi-language error messages 
#Include conf/extra/httpd-multilang-errordoc.conf 
 
# Fancy directory listings 
#Include conf/extra/httpd-autoindex.conf 
 
# Language settings 
#Include conf/extra/httpd-languages.conf 
 
# User home directories 
#Include conf/extra/httpd-userdir.conf 
 
# Real-time info on requests and configuration 
#Include conf/extra/httpd-info.conf 
 
# Virtual hosts 
#Include conf/extra/httpd-vhosts.conf 
 
# Local access to the Apache HTTP Server Manual 
#Include conf/extra/httpd-manual.conf 
 
# Distributed authoring and versioning (WebDAV) 
#Include conf/extra/httpd-dav.conf 
 
# Various default settings 
#Include conf/extra/httpd-default.conf 
 
# Secure (SSL/TLS) connections 
#Include conf/extra/httpd-ssl.conf 
# 
# Note: The following must must be present to support 
#       starting without SSL on platforms with no /dev/random equivalent 
#       but a statically compiled-in mod_ssl. 
# 
<IfModule ssl_module> 
SSLRandomSeed startup builtin 
SSLRandomSeed connect builtin 
</IfModule> 
# JRun Settings 
LoadModule jrun_module "C:/ColdFusion8/runtime/lib/wsconfig/1/mod_jrun22.so" 
<IfModule mod_jrun22.c> 
    JRunConfig Verbose false 
    JRunConfig Apialloc false 
    JRunConfig Ignoresuffixmap false 
    JRunConfig Serverstore "C:/ColdFusion8/runtime/lib/wsconfig/1/jrunserver.store" 
    JRunConfig Bootstrap 127.0.0.1:51011 
    #JRunConfig Errorurl url <optionally redirect to this URL on errors> 
    #JRunConfig ProxyRetryInterval 600 <number of seconds to wait before trying to reconnect to unreachable clustered server> 
    #JRunConfig ConnectTimeout 15 <number of seconds to wait on a socket connect to a jrun server> 
    #JRunConfig RecvTimeout 300 <number of seconds to wait on a socket receive to a jrun server> 
    #JRunConfig SendTimeout 15 <number of seconds to wait on a socket send to a jrun server> 
    AddHandler jrun-handler .jsp .jws 
</IfModule> 
 
Include conf/virtual-hosts.conf 

Here also is virtual-hosts.conf

# Use name-based virtual hosting 
NameVirtualHost *:80 
 
<VirtualHost *:80> 
 
	ServerName lc.acu-track.com 
	DocumentRoot C:/AcuTrackWebDevelopment/CBSI/lc.acu-track.com 
	CustomLog logs/lc.acu-track.com.access.log combined 
	ErrorLog logs/lc.acu-track.com.error.log 
 
</VirtualHost> 
 
<VirtualHost *:80> 
 
	ServerName acu-track.com 
	DocumentRoot C:/AcuTrackWebDevelopment/CBSI/acu-track.com 
	CustomLog logs/acu-track.com.access.log combined 
	ErrorLog logs/acu-track.com.error.log 
 
</VirtualHost> 

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

35. Re: CGI help

GeorgeWalters said...
mattlewis said...
GeorgeWalters said...

I agree but I can't figure out why it doesen't preprend the correct stuff since it's setup in the httpd.conf. I've made a mistake some where but can't find it. If you want me to post the entire httpd.conf and virtual-hosts.conf I can.

I think you need to do this. It seems clear that something is not configured to have cgi work the way you expect it to.

Matt

Matt, I missed something. What did you suggest?

It just seemed to me that this thread was going in circles. I've never configured apache, but CK has, and I've done enough debugging to know that if he could see your configuration, he could probably spot the problem pretty quickly.

Matt

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

36. Re: CGI help

Well I figured out the problem at 3:00AM laying awake in the bed. It's so simple and I'm sorry for wasting so much of everyone's time. I'm writing the script using crimson editor and when the script is launched from there to IE it is different than when launched by apache. If I launch the script from apache (IE address bar) it works correctly. A simple solution and caused by my lack of understanding being a newbie to html and apache. However in talking with all of you, I have learned a lot. So your assistance has not been in vain.

Thanks.

George

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

37. Re: CGI help

Another question. Can you point me where to look. When I type '1/2 90 el' into a HTML imput field, I get 1%2F2 back in the environmental var instead of '1/2'. Apparently the slash has to be changed and I'm wondering if other chars are the same. Can someone point me to why this is and I can understand.

Thanks George

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

38. Re: CGI help

GeorgeWalters said...

Another question. Can you point me where to look. When I type '1/2 90 el' into a HTML imput field, I get 1%2F2 back in the environmental var instead of '1/2'. Apparently the slash has to be changed and I'm wondering if other chars are the same. Can someone point me to why this is and I can understand.

See this and this.

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

39. Re: CGI help

GeorgeWalters said...

Another question. Can you point me where to look. When I type '1/2 90 el' into a HTML imput field, I get 1%2F2 back in the environmental var instead of '1/2'. Apparently the slash has to be changed and I'm wondering if other chars are the same. Can someone point me to why this is and I can understand.

Certain characters have special meaning to HTML. For instance, &, =. Let's say you have a form that submits a post containing 2 fields, name and age. When submitting the form with no special characters, "name=John&age=30" would be sent to the web server, and then passed on to the web application. Now, what happens if in the name field you enter =Jim. If escaping did not take place, "name==Jim&age=30" would be sent to the web application, thus making it hard to parse. Many other characters have special meaning.

http://jeremy.cowgar.com/svn/webclay/trunk/webclay/cgi.e contains a function that takes either a QUERY_STRING or POST_DATA read from std in and returns a map of the values, automatically converting any escaped characters to their real (programmer usable) values. That function "process_data", the last function in the file. You can use it directly or just take bits and parts from it you need.

Jeremy

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

40. Re: CGI help

Thanks all. It makes a lot of sense.

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

41. Re: CGI help

GeorgeWalters said...

Thanks all. It makes a lot of sense.

Oh, 4.0 has a urlencode() function that is the counterpart to the decode function in the cgi.e. BTW... I think we need to make a urldecode() function and put it in std euphoria as well.

Jeremy

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

42. Re: CGI help

jeremy said...

Oh, 4.0 has a urlencode() function that is the counterpart to the decode function in the cgi.e. BTW... I think we need to make a urldecode() function and put it in std euphoria as well.

Where is urlencode()?

I'd love to see a standard cross-platform CGI library.

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

43. Re: CGI help

jeremy said...
GeorgeWalters said...

Thanks all. It makes a lot of sense.

Oh, 4.0 has a urlencode() function that is the counterpart to the decode function in the cgi.e. BTW... I think we need to make a urldecode() function and put it in std euphoria as well.

Jeremy

Well, I'm using 2.4 so I had to work on your decode, but not much. Neat routine.

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

44. Re: CGI help

Well, I have my first CGI program running when launching from Crimson editor, but when I launch it from IE it fails because it can't find any includes. Apparently the env vars can't be located. Can someone explain?

example: include lib/ic/tables.e

EUINC is 'C:\AcuTrack' where the lib resides

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

45. Re: CGI help

GeorgeWalters said...

Well, I have my first CGI program running when launching from Crimson editor, but when I launch it from IE it fails because it can't find any includes. Apparently the env vars can't be located. Can someone explain?

example: include lib/ic/tables.e

EUINC is 'C:\AcuTrack' where the lib resides

Apache runs in it's own console, therefore it has it's own environmental variables... If you issue SET EUDIR=C:\Euphoria in a console, then click Start>Programs>Apache>Server, it will not have the EUDIR environmental variable. What you need to do is set EUDIR in the Control Panel > System > Advanced Settings. Set it as a system wide environmental variable.

If that does not work, then you will have to revert to Apache's mod_env, which sets environmental variables in each session that is spawned by Apache.

Jeremy

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

46. Re: CGI help

GeorgeWalters said...

Well, I have my first CGI program running when launching from Crimson editor, but when I launch it from IE it fails because it can't find any includes. Apparently the env vars can't be located. Can someone explain?

example: include lib/ic/tables.e

EUINC is 'C:\AcuTrack' where the lib resides

I'm sorry, you have to set EUINC, not EUDIR like my previous message suggests. Make sure you include the euphoria include directory as well:

EUINC=C:\Euphoria\include;C:\AcuTrack 

Jeremy

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

47. Re: CGI help

[http://jeremy.cowgar.com/svn/webclay/trunk/webclay/cgi.e contains a function that takes either a QUERY_STRING or POST_DATA read from std in and returns a map of the values, automatically converting any escaped characters to their real (programmer usable) values. That function "process_data", the last function in the file. You can use it directly or just take bits and parts from it you need.

Jeremy

[/quote]

Jeremy, I ran across a small bug in your "process_data". If the 1st time it's called and 'data' is an atom, your routine will crash since 'the_map' has no value.

 
        function processData(object data) 
	atom i, char 
	object tmp 
	sequence charbuf, fieldbuf, fname,the_map 
	fname="" 
	 
	if atom(data) then 
		return the_map 
	end if 
 

George

BTW thanks for the routine. It works nicely.

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

48. Re: CGI help

GeorgeWalters said...

Jeremy, I ran across a small bug in your "process_data". If the 1st time it's called and 'data' is an atom, your routine will crash since 'the_map' has no value.

Oh! Thanks, I'll update my copy.

Jeremy

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

49. Re: CGI help

jeremy said...
GeorgeWalters said...

Jeremy, I ran across a small bug in your "process_data". If the 1st time it's called and 'data' is an atom, your routine will crash since 'the_map' has no value.

Oh! Thanks, I'll update my copy.

Jeremy

Jeremy, I've also modified your "process_data" to handle a "query_string" which had more than one field and value pairs. It was only returning the last one for me. There a couple of appends to return a sequence with all the conversions.

 
function processData(object data) 
	atom i, char 
	object tmp 
	sequence charbuf, fieldbuf, fname,the_map 
	fname="" 
	the_map = {} -- <<< add here 
		 
	if atom(data) then 
		return the_map 
	end if 
 
	charbuf = {}  fieldbuf = {}  i = 1 
	while i <= length(data) do 
		char = data[i]  -- character we're working on 
		if equal(char, HEX_SIG) then 
			tmp = value("#" & data[i+1] & data[i+2]) 
			charbuf &= tmp[2] 
			i += 3 
		elsif equal(char, WHITESPACE) then 
			charbuf &= " " 
			i += 1 
		elsif equal(char, VALUE_SEP) then 
			fname = charbuf 
			charbuf = {} 
			i += 1 
		elsif find(char, PAIR_SEP) then 
			the_map = append(the_map,{fname, charbuf}) --<< change here 
			fname = {} 
			charbuf = {} 
			i += 1 
		else 
			charbuf &= char 
			i += 1 
		end if 
	end while 
 
	if length(fname) then 
		the_map = append(the_map, {fname, charbuf})--<<<< and change here 
	end if 
 
	return the_map 
end function    
 
new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu