1. CGI help
- Posted by GeorgeWalters Jul 16, 2009
- 2159 views
I'm new to this and am trying to study IRV's stuff.
<eucode
- !/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!
2. Re: CGI help
- Posted by euphoric (admin) Jul 16, 2009
- 2079 views
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.
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.
3. Re: CGI help
- Posted by GeorgeWalters Jul 16, 2009
- 2070 views
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.
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.
Looks just like what I need. Thanks.
George
4. Re: CGI help
- Posted by GeorgeWalters Jul 17, 2009
- 2079 views
How do you get IE on XP to quit poping up the "run, save, cancel" panel when I try to run a cgi script?
5. Re: CGI help
- Posted by mattlewis (admin) Jul 17, 2009
- 2095 views
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
6. Re: CGI help
- Posted by GeorgeWalters Jul 17, 2009
- 2107 views
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.
7. Re: CGI help
- Posted by ghaberek (admin) Jul 17, 2009
- 2078 views
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
8. Re: CGI help
- Posted by achury Jul 17, 2009
- 2101 views
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:
Apache is the best for Linux or Windows, but is bigger and complex
9. Re: CGI help
- Posted by GeorgeWalters Jul 17, 2009
- 2076 views
- Last edited Jul 18, 2009
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.
10. Re: CGI help
- Posted by euphoric (admin) Jul 17, 2009
- 2044 views
- Last edited Jul 18, 2009
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.
11. Re: CGI help
- Posted by GeorgeWalters Jul 18, 2009
- 2070 views
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.
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?
12. Re: CGI help
- Posted by euphoric (admin) Jul 18, 2009
- 2082 views
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.
13. Re: CGI help
- Posted by GeorgeWalters Jul 20, 2009
- 2121 views
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>
14. Re: CGI help
- Posted by GeorgeWalters Jul 20, 2009
- 2072 views
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?
15. Re: CGI help
- Posted by euphoric (admin) Jul 20, 2009
- 2056 views
<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"
16. Re: CGI help
- Posted by GeorgeWalters Jul 20, 2009
- 2084 views
<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.
17. Re: CGI help
- Posted by GeorgeWalters Jul 20, 2009
- 2076 views
and this works.
href="http://localhost/cgi/cgitest.exw">
but not /cgi/cgitest.exw
18. Re: CGI help
- Posted by euphoric (admin) Jul 20, 2009
- 2060 views
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?
19. Re: CGI help
- Posted by GeorgeWalters Jul 20, 2009
- 2061 views
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>
- #
- 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>
See anything here that is wrong?
20. Re: CGI help
- Posted by euphoric (admin) Jul 20, 2009
- 2065 views
Revisiting this for a moment...
<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)?
21. Re: CGI help
- Posted by GeorgeWalters Jul 20, 2009
- 2059 views
Revisiting this for a moment...
<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.
22. Re: CGI help
- Posted by euphoric (admin) Jul 20, 2009
- 2064 views
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.
23. Re: CGI help
- Posted by GeorgeWalters Jul 20, 2009
- 2046 views
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
24. Re: CGI help
- Posted by euphoric (admin) Jul 20, 2009
- 2077 views
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.
25. Re: CGI help
- Posted by GeorgeWalters Jul 20, 2009
- 2049 views
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.
26. Re: CGI help
- Posted by euphoric (admin) Jul 20, 2009
- 2119 views
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?
27. Re: CGI help
- Posted by GeorgeWalters Jul 20, 2009
- 2075 views
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.
28. Re: CGI help
- Posted by mattlewis (admin) Jul 20, 2009
- 2078 views
- Last edited Jul 21, 2009
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
29. Re: CGI help
- Posted by euphoric (admin) Jul 20, 2009
- 2082 views
- Last edited Jul 21, 2009
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.
30. Re: CGI help
- Posted by GeorgeWalters Jul 20, 2009
- 2179 views
- Last edited Jul 21, 2009
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.
- #
- 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
- '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*
- 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 EnableSendfilefile: 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>
31. Re: CGI help
- Posted by GeorgeWalters Jul 20, 2009
- 2013 views
- Last edited Jul 21, 2009
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.
32. Re: CGI help
- Posted by GeorgeWalters Jul 20, 2009
- 2039 views
- Last edited Jul 21, 2009
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?
33. Re: CGI help
- Posted by euphoric (admin) Jul 20, 2009
- 2040 views
- Last edited Jul 21, 2009
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.
34. Re: CGI help
- Posted by DerekParnell (admin) Jul 20, 2009
- 2082 views
- Last edited Jul 21, 2009
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>
35. Re: CGI help
- Posted by mattlewis (admin) Jul 21, 2009
- 2056 views
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
36. Re: CGI help
- Posted by GeorgeWalters Jul 21, 2009
- 2051 views
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
37. Re: CGI help
- Posted by GeorgeWalters Jul 24, 2009
- 2051 views
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
38. Re: CGI help
- Posted by euphoric (admin) Jul 24, 2009
- 2094 views
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.
39. Re: CGI help
- Posted by jeremy (admin) Jul 24, 2009
- 2002 views
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
40. Re: CGI help
- Posted by GeorgeWalters Jul 24, 2009
- 2040 views
Thanks all. It makes a lot of sense.
41. Re: CGI help
- Posted by jeremy (admin) Jul 24, 2009
- 2073 views
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
42. Re: CGI help
- Posted by euphoric (admin) Jul 24, 2009
- 1980 views
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.
43. Re: CGI help
- Posted by GeorgeWalters Jul 24, 2009
- 2030 views
- Last edited Jul 25, 2009
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.
44. Re: CGI help
- Posted by GeorgeWalters Jul 25, 2009
- 2013 views
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
45. Re: CGI help
- Posted by jeremy (admin) Jul 26, 2009
- 1999 views
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
46. Re: CGI help
- Posted by jeremy (admin) Jul 26, 2009
- 1999 views
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
47. Re: CGI help
- Posted by GeorgeWalters Jul 28, 2009
- 1993 views
[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.
48. Re: CGI help
- Posted by jeremy (admin) Jul 28, 2009
- 2027 views
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
49. Re: CGI help
- Posted by GeorgeWalters Jul 28, 2009
- 2028 views
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