cancel
Showing results for 
Search instead for 
Did you mean: 

Running a CGI by loading.

phonse
Newbie
Posts: 3
Registered: 30-07-2007

Running a CGI by loading.

I require to execute a CGI file (a perl script) without using a normal link. Usually this is possible in one of two ways :
1) Use of a Server Side INCLUDE command which loads the script and in doing so executes it. ( #INCLUDE not #EXEC)
2) Use of an HTML FRAME into which the script is loaded.
Neither of these methods seem to work.
Has anyone got any experience with this situation ?
On FREE-ONLINE with their set up of Apache how does one execute a CGI perl script on load and not have to use a form or standard click on a link ?

Alec F
16 REPLIES
thehat
Grafter
Posts: 39
Registered: 19-09-2007

Running a CGI by loading.

Both methods work fine.
To enable SSI you will need to add the relevant entries in .htaccess.
N/A

Running a CGI by loading.

SSI should work, but is currently not working... it should be fixed at some point.
thehat
Grafter
Posts: 39
Registered: 19-09-2007

Running a CGI by loading.

OK. I haven't tried it on the new cgi system yet. I'm pretty sure it works on the old one (or used to).
N/A

Running a CGI by loading.

Now working fine on the new platform.
N/A

Running a CGI by loading.

Can I use SSI in pages on the normal server, or do they have to be uploaded to the CGI server?

I'm trying to use SSI to include a common header and menu on a number of pages. I've set up my .htaccess file thus:

AddType text/html .shtml

AddHandler server-parsed .shtml
Options Indexes FollowSymLinks Includes


and named the html files with .shtml suffix

and included the line
<!--#include virtual="titlebar.html" -->

in my html file

but it won't play.

Any suggestions please?
N/A

Running a CGI by loading.

I've added
Options +Includes

to htaccess so it now reads
Options +Includes

AddType text/html .shtml
AddHandler server-parsed .shtml
Options Indexes FollowSymLinks Includes


and now i get an error message
Quote
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@plus.net and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Apache/1.3.33 Server at www.theboxplace.co.uk Port 80


Still trying to work out whats going on. I'm new to pages with anything more than HTML so if anyone wants to help then just short words please!

Theo
thehat
Grafter
Posts: 39
Registered: 19-09-2007

Running a CGI by loading.

It's a while since I played with SSI, but from memory, I think when you use virtual you may need to specify the full pathname of the file.
N/A

Running a CGI by loading.

I checked that on apache.org and followed their guidelines. Virtual allows full pathnames, but does not require them.

Thanks for the suggestion.

Theo
thehat
Grafter
Posts: 39
Registered: 19-09-2007

Running a CGI by loading.

Apache may not require a full path, but if you don't provide a full path, it will be relative to the current directory. The current directory in this context may or may not be the directory in which the shtml file resides.
It is worth trying the full path if you can figure out what that is.
As I said it's been a while since I played with SSI and I have a vague recollection that there was a difference between using virtual and file.
I don't remember ever quite figurnig our exactly what the difference between the two was, except that I managed to get one working and not the other, can't remember which now though. Try using file instead of virtual.
thehat
Grafter
Posts: 39
Registered: 19-09-2007

Running a CGI by loading.

I just found some old html files where I used SSI and I used the following syntax:

<!--#include file="PhilWebNavigator.txt" -->

HTH
Phil.
N/A

Running a CGI by loading.

Using
<!--#include file="titlebar.html" -->


still results in the same error.

The include works ok when I test it in dreamweaver, so I suspect that SSI is not fully activated, either by me, or by FOL.

My understanding of the difference between File and Virtual is that either can be used to refer to a file in the same directory, but only Virtual can use a full pathname to refere to files in other folders.

Thanks for your help

Theo
thehat
Grafter
Posts: 39
Registered: 19-09-2007

Running a CGI by loading.

OK. I just tried it. I get the same error using your .htaccess file, but if I just use the following it works:
AddType text/html .shtml 

AddHandler server-parsed .shtml

It looks like it doesn't like the Options directives.
N/A

Running a CGI by loading.

Well, if I use just that code I get no error message either, but the include does not bring in the code from the called file. The Options directive is there to activate Includes. One possibility is that for some reason FOL has not activated Includes in my webspace.

Can you get an included file corectly placed withing the calling HTML page?
thehat
Grafter
Posts: 39
Registered: 19-09-2007

Running a CGI by loading.

Yes it worked fine, using either file or virtual and no path.
Are you sure you have uploaded .htaccess in ascii mode?
You shouldn't need the Includes directive as it is supposed to be enabled by default. I can't think why it might be disabled on your account.
Note also, you may need to use Ctrl+Refresh to ensure your browser isn't caching the error page.