Can't run a c++ cgi on Kubuntu 10. Checked all apache configurations.
I'm trying to compile my 1st c++ cgi Programm on kubuntu 10 with Apache2 but nothing.
I've Put it to the cgi-bin folder checked the config files, run the programm on command, changed privileges to executable, but nothing. Rekonq says 'No service can handle this file' You can see all configurations and execution in this screenshoot. http://img832.imageshack.us/img832/1659/cgiv.jpg I've apt get instal apache2. Have restarted it also. Nuts Its been all day now and gone desperate. If you have any idea, will save me |
So, you've compiled a 'hello world' program, and want to run it as a CGI? What happens when you run it from the commanline?
The file extension '.cgi' that you've used is technically okay, but is unconventional, and your filesystem browser probably doesn't know how to interpret the meaning of that filename extension. Try renaming the file to something more conventional (and usually, the name of a program reflects the nature of the program's actions, not its source language). --- rod. |
From the command line it runs ok as you clearly see.
Here is also the code of my configiration file My cgi-bin is in /usr/lib/cgi-bin My config file @ etc/apache2/sites-enabled/000-default I've found elsewhere these were the wright for Kub10-12, and not the /var/www/ PHP Code:
|
According to your config file, your server uses "/usr/lib/cgi-bin" for CGI scripts/programs:
Code:
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ I don't see anything to see that your program runs. You did show a build commandline, but I don't see anything as output from the program. Just to be clear, you do not need to build the program each time it is called as a child by the server. --- rod. |
It runs what you see to the command line its the output of the programm. As you see its A clear html code.
How couldnt it ruin its from a tutorial site at tutorial point. So the aphache configuration is all ok? |
No, I think not. You said "My cgi-bin is in etc/apache2/". But the config file says it must be in /usr/lib/cgi-bin.
--- rod. |
No its in /usr/lib/cgi-bin sorry my mistake. But you can see it on the screenshot anyways. (so sorry so sorry :SSSS)
|
When you request a URL of the form 'http://your.web.server/cgi-bin/cplusplus.cgi' from your HTTP client, what exactly is the result? What shows up in the web server logs?
It would be helpful to use a client like wget to fetch from the server, and post the results here (in [CODE][/CODE] tags so we can read it, please). Code:
wget -O - http://your.web.server/cgi-bin/cplusplus.cgi --- rod. |
OMG i found it i was accesing it through the file system and not at local host though apache wasnt involved. so sorry
|
All times are GMT -5. The time now is 11:48 PM. |