CGI scripts in C

  • Follow


I have started using C to make GCI scripts to use on servers (localhost 
now). Examples are there:
http://www.cs.tut.fi/~jkorpela/forms/cgic.html
Did anyone do this before? I can get it working well on localhost but 
still need to find a webserver that supports C CGI; they seem all to 
support perl, php, python but nothing in C (yet). 

0
Reply franco265 (2) 8/14/2010 10:18:03 AM

On 08/14/10 10:18 PM, francogrex wrote:
> I have started using C to make GCI scripts to use on servers (localhost
> now). Examples are there:
> http://www.cs.tut.fi/~jkorpela/forms/cgic.html
> Did anyone do this before? I can get it working well on localhost but
> still need to find a webserver that supports C CGI; they seem all to
> support perl, php, python but nothing in C (yet).

Any web-server will support C CGI applications (I hate to use the term 
"script").  Just compile and copy the binary to the appropriate place 
(cgi-bin for Apache).

-- 
Ian Collins
0
Reply Ian 8/14/2010 10:35:42 AM


In article <20100814-101803.328.0@francogrex.news.eternal-september.org>,
 francogrex <franco@grex-removethis.com> wrote:

> I have started using C to make GCI scripts to use on servers (localhost 
> now). Examples are there:
> http://www.cs.tut.fi/~jkorpela/forms/cgic.html
> Did anyone do this before? I can get it working well on localhost but 
> still need to find a webserver that supports C CGI; they seem all to 
> support perl, php, python but nothing in C (yet). 

Somewhere, over the internet, the CGI interface is defined: what stdin, stdout, 
and stderr are connected to, and what environmental variables are defined. Your 
http server will also have additional requirements where the executable must be 
stored, permissions, and file name. You'll have to look these up for your server.

http://en.wikipedia.org/wiki/Common_Gateway_Interface
For Apache: http://httpd.apache.org/docs/1.3/howto/cgi.html

-- 
Damn the living - It's a lovely life.           I'm whoever you want me to be.
Silver silverware - Where is the love?       At least I can stay in character.
Oval swimming pool - Where is the love?    Annoying Usenet one post at a time.
Damn the living - It's a lovely life.                     chine.bleu@yahoo.com
0
Reply Where 8/14/2010 11:22:00 AM

Ian Collins <ian-news@hotmail.com> writes:

> On 08/14/10 10:18 PM, francogrex wrote:
>> I have started using C to make GCI scripts to use on servers (localhost
>> now). Examples are there:
>> http://www.cs.tut.fi/~jkorpela/forms/cgic.html
>> Did anyone do this before? I can get it working well on localhost but
>> still need to find a webserver that supports C CGI; they seem all to
>> support perl, php, python but nothing in C (yet).
>
> Any web-server will support C CGI applications (I hate to use the term
> "script").  Just compile and copy the binary to the appropriate place
> (cgi-bin for Apache).

I think the OP meant "hosting company" when he said "webserver".
Webservers don't care what language the CGI programs are written in, but
(at least at the cheaper end of the market) it is not easy to find
hosting companies that offer a C compiler.

-- 
Ben.
0
Reply Ben 8/14/2010 11:29:31 AM

On Aug 14, 1:29=A0pm, Ben Bacarisse <ben.use...@bsb.me.uk> wrote:
> Ian Collins <ian-n...@hotmail.com> writes:
> > On 08/14/10 10:18 PM, francogrex wrote:
> >> I have started using C to make GCI scripts to use on servers (localhos=
t
> >> now). Examples are there:
> >>http://www.cs.tut.fi/~jkorpela/forms/cgic.html
> >> Did anyone do this before? I can get it working well on localhost but
> >> still need to find a webserver that supports C CGI; they seem all to
> >> support perl, php, python but nothing in C (yet).
>
> > Any web-server will support C CGI applications (I hate to use the term
> > "script"). =A0Just compile and copy the binary to the appropriate place
> > (cgi-bin for Apache).
>
> I think the OP meant "hosting company" when he said "webserver".
> Webservers don't care what language the CGI programs are written in, but
> (at least at the cheaper end of the market) it is not easy to find
> hosting companies that offer a C compiler.

Yes exactly, that's what I meant. I can set up my local server and it
works very fine but in hosting companies like Tripod, 10xhosting
etc... they don't seem to offer the C CGI possibility, very
unfortunately.
0
Reply Francogrex 8/14/2010 12:43:22 PM

On 2010-08-14, Francogrex <franco@grex.org> wrote:
> On Aug 14, 1:29�pm, Ben Bacarisse <ben.use...@bsb.me.uk> wrote:
>> Ian Collins <ian-n...@hotmail.com> writes:
>> > On 08/14/10 10:18 PM, francogrex wrote:
>> >> I have started using C to make GCI scripts to use on servers (localhost
>> >> now). Examples are there:
>> >>http://www.cs.tut.fi/~jkorpela/forms/cgic.html
>> >> Did anyone do this before? I can get it working well on localhost but
>> >> still need to find a webserver that supports C CGI; they seem all to
>> >> support perl, php, python but nothing in C (yet).
>>
>> > Any web-server will support C CGI applications (I hate to use the term
>> > "script"). �Just compile and copy the binary to the appropriate place
>> > (cgi-bin for Apache).
>>
>> I think the OP meant "hosting company" when he said "webserver".
>> Webservers don't care what language the CGI programs are written in, but
>> (at least at the cheaper end of the market) it is not easy to find
>> hosting companies that offer a C compiler.
>
> Yes exactly, that's what I meant. I can set up my local server and it
> works very fine but in hosting companies like Tripod, 10xhosting
> etc... they don't seem to offer the C CGI possibility, very
> unfortunately.

You are unlikely to find many hosting companies to allow you to execute a
random binary on their systems.  The hosting companies that allow you any
kind of CGI support at all have created secured versions of their
interpeter's that prevent you from doing anything that would allow you to
break out of the jail that they have created.  When you have 1000+ accounts
all hosted on a physical server, you can't have one of them being able to
compromise or disrupt the rest.  Furthermore, the server very well may not
be running on the same architecture that you are using as your development
platform.

If you want to be able to run C CGI programs, you are going to need your
own server.  Today, with the plethora of virtualization technologies, you
can get virtual servers (google "VPS hosting") starting at about $20.
0
Reply Tim 8/14/2010 2:07:37 PM

"Francogrex" <franco@grex.org> wrote in message 
news:096632ed-38db-4e6c-81bd-56772773102a@x25g2000yqj.googlegroups.com...


-quote-
Yes exactly, that's what I meant. I can set up my local server and it
works very fine but in hosting companies like Tripod, 10xhosting
etc... they don't seem to offer the C CGI possibility, very
unfortunately.
-endquote-

As others have mentioned, it can be difficult to find a hosting company that 
allows both terminal access and a C compiler. Here is one that I used many 
years ago. Looks like they still offer gcc.

http://www.pwebtech.com/unixbasic.html

The site is long gone, so I haven't used them in a long time.

Otherwise, you can call or email and ask providers. Also, if you find a host 
running, say Linux, at a certain rev level, you might be able to set up a 
parallel machine at home to compile the binaries, then install them via FTP.



Brian



0
Reply Default 8/18/2010 10:06:14 PM

6 Replies
145 Views

(page loaded in 3.09 seconds)

Similiar Articles:













7/18/2012 7:05:21 AM


Reply: