Forum

how to use cgi scripting

Shashank
23 February 2009, 15:19
to use the cgi script
i have added the following virtual host

VirtualHost{
Hostname = 127.0.0.1
WebsiteRoot = /usr/localvar/www/hiawatha
AccessLogfile = /usr/local/var/log/hiawatha/access.log
ErrorLogfile = /usr/local/var/log/hiawatha/error.log
CGIhandler = /usr/bin/c++

}
i have kept my c++ compiled file, at the location
/usr/localvar/www/hiawatha.

what else i have to do??
i am not able to understand what next.
i am new to cgi scripting
please help me.

Hugo Leisink
23 February 2009, 16:08
The CGIhandler is used for CGI scripts (like PHP, Python, Ruby, etc). Since you have a program which can directly be run by your OS (no parser needed) you should use CGIextension instead. Make sure your compiled C++ programs have the .cgi extension and are able to 'talk CGI'. Besides that I advice you to search the Internet for information about what CGI is, how it works and what it means to make a program that 'talks CGI'.

CGIextension = cgi

VirtualHost{
Hostname = 127.0.0.1
WebsiteRoot = /usr/localvar/www/hiawatha
AccessLogfile = /usr/local/var/log/hiawatha/access.log
ErrorLogfile = /usr/local/var/log/hiawatha/error.log
ExecuteCGI = yes
}
Shashank
23 February 2009, 20:01
Thanks boss.!!

Shashank
24 February 2009, 12:03
for fast cgi what all things i will have to change to get the change from cgi to fastcgi??
considering i will be using the c or c++ classes for the same.
Hugo Leisink
24 February 2009, 16:30
All the information you need to write a FastCGI program can be found at fastcgi.com [www.fastcgi.com].
This topic has been closed.