[SOLVED] Can't run a c++ cgi on Kubuntu 10. Checked all apache configurations.
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
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).
Alias /doc/ "/usr/share/doc/" <Directory "/usr/share/doc/"> Options Indexes MultiViews FollowSymLinks AllowOverride None Order deny,allow Deny from all Allow from 127.0.0.0/255.0.0.0 ::1/128 </Directory>
According to your config file, your server uses "/usr/lib/cgi-bin" for CGI scripts/programs:
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Allow from all
The alias is the name that browsers will use to request a CGI URL. The <Directory> tag identifies the actual absolute directory name on your server host.
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.
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).