[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.
Notices
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.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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).
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/
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:
Code:
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
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.
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.
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).
This will print the details to your console, where you can see everything, and copy it here. Also, observe and post the log file entries from the server access log, and the server error log.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.