| View previous topic :: View next topic | 
	
	
		| Author | Message | 
	
		| JoeWest -
 
 
 Joined: 17 Aug 2003
 Posts: 6
 
 
 | 
			
				|  Posted: Tue Aug 19, 2003 10:39 pm    Post subject: SSI not executing a CGI script |   |  
				| 
 |  
				| Hi, I create CGI Scripts as borland C++ console applications and have no problem executing them as cgi scripts. I created a script counter.exe and wanted to call it from an SSI. 
 If I use:
 
 <!-- #include virtual="/cgi_bin/counter.exe" --> I get a binary dump of the file inserted in the shtm page.
 
 If I use:
 <!-- #exec cmd="/cgi_bin/counter.exe" --> the scrip is not executed, but the comment is removed from the source!
 
 Why does the script not execute? I can run it locally or as a normal script, but not as a SSI. I put a beep in the script so I know it has been executed.
 
 What do I need to return from the script to use it in an SSI I currently return "<p>You are visitor number X</p>" (not the quotes). Is this correct?
 |  | 
	
		| Back to top |     | 
	
		|  | 
	
		| JoeWest -
 
 
 Joined: 17 Aug 2003
 Posts: 6
 
 
 | 
			
				|  Posted: Tue Aug 19, 2003 10:53 pm    Post subject: |   |  
				| 
 |  
				| Additional: 
 Abyss web server opens a DOS console on the server (it does not do this for any other script) and closes it again without executing the application/script.
 |  | 
	
		| Back to top |     | 
	
		|  | 
	
		| JoeWest -
 
 
 Joined: 17 Aug 2003
 Posts: 6
 
 
 | 
			
				|  Posted: Wed Aug 20, 2003 9:23 am    Post subject: |   |  
				| 
 |  
				| Additional Additional! 
 Forget the #exec cmd problem above this was a read herring I should RTFM.
 
 However I can only embed the file not execute it.
 
 I have added EXE as a CGI file type although I use the windows registry setting to do this normally for CGI scripts!
 
 Any help?
 
 Regards
 |  | 
	
		| Back to top |     | 
	
		|  | 
	
		| aprelium -
 
 
 Joined: 22 Mar 2002
 Posts: 6800
 
 
 | 
			
				|  Posted: Wed Aug 20, 2003 12:38 pm    Post subject: |   |  
				| 
 |  
				| Try browsing http://127.0.0.1/cgi_bin/counter.exe . What do you get? If you get error 500, the counter is breaking the CGI spec and you should fix your code. Generally, to make a program conform to CGI add some headers in the beginning. The bare minimum is:
 
  	  | Code: |  	  | printf("Content-type: text/html\n\n");
 
 | 
 
 If the counter isn't executed (you get a download screen, or some code dump) this means that the virtual path /cgi_bin/ wasn't declared as a CGI Path. Go to the CGI Parameters and and add /cgi_bin/ as a CGI Path.
 .exe files are executed as CGI if in one of the CGI Paths. No other setting is required (no registry, nothing) to make them work.
 If your http://127.0.0.1/cgi_bin/counter.exe runs correctly, then
 
  	  | Code: |  	  | <!-- #include virtual="/cgi_bin/counter.exe" --> | 
 should work fine.[/code]
 _________________
 Support Team
 Aprelium - http://www.aprelium.com
 |  | 
	
		| Back to top |       | 
	
		|  | 
	
		| JoeWest -
 
 
 Joined: 17 Aug 2003
 Posts: 6
 
 
 | 
			
				|  Posted: Fri Aug 22, 2003 8:38 am    Post subject: |   |  
				| 
 |  
				| Hi, 
 Thanks for the reply and a great program. I too publish free software into the public domain for use in creating DVD subtitles.
 
 The problem was that I was not including /cgi_bin/ as a CGI directory, so your advice has fixed that!
 
 You may not be the person to ask, but how do you pop-up a password box such as when you are accessing a secured virtual directory?
 
 I would like to put this into my scripts!
 
 Thanks
 |  | 
	
		| Back to top |     | 
	
		|  | 
	
		| aprelium -
 
 
 Joined: 22 Mar 2002
 Posts: 6800
 
 
 | 
			
				|  Posted: Fri Aug 22, 2003 12:34 pm    Post subject: |   |  
				| 
 |  
				|  	  | JoeWest wrote: |  	  | You may not be the person to ask, but how do you pop-up a password box such as when you are accessing a secured virtual directory?
 
 I would like to put this into my scripts!
 Thanks
 | 
 We cannot gove you immediatly a code snippet but such a code return satus 401 back to the client to start the authentication. It should process the received password later.
 _________________
 Support Team
 Aprelium - http://www.aprelium.com
 |  | 
	
		| Back to top |       | 
	
		|  | 
	
		|  |