Forum Moderators: phranque

Message Too Old, No Replies

C++ script & Apache

How should I run my C++ script on Apache?

         

Mareq

2:22 pm on Dec 31, 2004 (gmt 0)

10+ Year Member



I need to run my C++ script on Apache, but I'm total newbie to Apache and also Linux itself... Should I compile my script (how?), should I install some additional packages and how should I tell Apache to run my C++ scripts?

Presently my server is running on an old Debian Woody (but without direct internet connection, so I can't use dselect), with Apache 1.3.31, PHP 5, mod_perl and I've also installed some CgiCC packages, but it still doesn't work... Please help!

moltar

2:58 pm on Dec 31, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You need to use g++ (gpp) compiler on your linux box to compile the C++ file.
Chmod it to 755.
Now you can use it as any other CGI application.

Mareq

4:32 pm on Dec 31, 2004 (gmt 0)

10+ Year Member



What does it mean "use it as any other CGI application"? How should I make my Apache to run that compiled script? (I found only manuals about perl, but no one about C++)

moltar

1:28 pm on Jan 5, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You compile the code. Place the compiled program to cgi-bin. Chmod it 755. And run it in your browser like you would run any other page/script/image file.

The key is to chmod it to 755 - that tells apache that it's an executable.