CGI scripts in C

F

francogrex

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).
 
I

Ian Collins

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).
 
B

Ben Bacarisse

Ian Collins said:
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.
 
F

Francogrex

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.
 
T

Tim Harig

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.
 
D

Default User

-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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top