Hi,
I am new to Ubuntu. My python cgi-scripts work but my c++ cgi does not. How do I fix?
\
In the apache error logs I get premature end of headers error.
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webmaster@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log
Below is my simple cgi script. I also did a chmod a+x and 755. In the http.conf file I have
ScriptAlias /cgi-bin /usr/lib/cgi-bin/
<Directory /usr/lib/cgi-bin>
Options +ExecCGI
Order allow,deny
Allow from all
AddHandler cgi-script cgi o py
</Directory>
#include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include <vector>
#include <string>
#include <time.h>
#include <malloc.h>
using namespace std;
int main() {
cout << "content-type: text/html" << endl << endl;
cout << "<html>" << endl;
cout << "</html>" << endl;
//cout << "Hello! You sent " << lpszContentLength << " bytes of data which read: <br>" << endl;
return 0;
}