HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   General (http://www.howtoforge.com/forums/forumdisplay.php?f=15)
-   -   Ispconfig cgi hosting (http://www.howtoforge.com/forums/showthread.php?t=912)

Mahir 19th October 2005 15:01

Ispconfig cgi hosting
 
Sorry to make again topic :D i am trying to setup little hosting server but i got another little problem i can't get solved the problem is CGI scripts based on perl :( i maked a website gived rights to cgi (with installation on my fc4 machine i used teh suexec directory /var/www) but i can't run a single cgi script i don't know what i am doing wrong every script i wanne run i get the following:

http://www.ulyaoth.com/cgi-bin/users.cgi
(for if url not works error is: 500 error - Internal Server Error!)

I get this error on every cgi script i wanne run the log files say the following:

access_log:
83.98.249.83 - - [19/Oct/2005:14:45:48 +0200] "GET /cgi-bin/users.cgi HTTP/1.1" 500 1215 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; WOW64; SV1; .NET CLR 1.1.4322)"
83.98.249.83 - - [19/Oct/2005:14:46:41 +0200] "GET /cgi-bin/users.cgi HTTP/1.1" 500 1215 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; WOW64; SV1; .NET CLR 1.1.4322)"
83.98.249.83 - - [19/Oct/2005:14:50:26 +0200] "GET /cgi-bin/users.cgi HTTP/1.1" 500 1215 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; WOW64; SV1; .NET CLR 1.1.4322)"

error_log:
[Wed Oct 19 12:18:26 2005] [notice] SIGHUP received. Attempting to restart
[Wed Oct 19 12:18:27 2005] [warn] NameVirtualHost 192.168.2.110:80 has no VirtualHosts
[Wed Oct 19 12:18:27 2005] [notice] Digest: generating secret for digest authentication ...
[Wed Oct 19 12:18:27 2005] [notice] Digest: done
[Wed Oct 19 12:18:27 2005] [notice] LDAP: Built with OpenLDAP LDAP SDK
[Wed Oct 19 12:18:27 2005] [notice] LDAP: SSL support unavailable
[Wed Oct 19 12:18:27 2005] [notice] mod_python: Creating 4 session mutexes based on 256 max processes and 0 max threads.
[Wed Oct 19 12:18:27 2005] [notice] Apache/2.0.54 (Fedora) configured -- resuming normal operations
[Wed Oct 19 12:18:35 2005] [notice] caught SIGTERM, shutting down
[Wed Oct 19 12:18:36 2005] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Wed Oct 19 12:18:36 2005] [notice] Digest: generating secret for digest authentication ...
[Wed Oct 19 12:18:36 2005] [notice] Digest: done
[Wed Oct 19 12:18:36 2005] [notice] LDAP: Built with OpenLDAP LDAP SDK
[Wed Oct 19 12:18:36 2005] [notice] LDAP: SSL support unavailable
[Wed Oct 19 12:18:36 2005] [notice] mod_python: Creating 4 session mutexes based on 256 max processes and 0 max threads.
[Wed Oct 19 12:18:36 2005] [notice] Apache/2.0.54 (Fedora) configured -- resuming normal operations


suexec.log:
[2005-10-18 15:05:34]: uid: (10008/web11_mahir) gid: (10011/10011) cmd: users.cgi
[2005-10-18 15:06:37]: uid: (10008/web11_mahir) gid: (10011/10011) cmd: users.cgi
[2005-10-19 14:45:48]: uid: (10008/web11_mahir) gid: (10011/10011) cmd: users.cgi
[2005-10-19 14:46:41]: uid: (10008/web11_mahir) gid: (10011/10011) cmd: users.cgi
[2005-10-19 14:50:26]: uid: (10008/web11_mahir) gid: (10011/10011) cmd: users.cgi

Wel i don't understand where it goes wrong also in my script nothing wrong on my other server it runs with no problem but it is not that big so i sall post source also:

users.cgi:
#!/usr/bin/perl

use DB_File;

print "Content-type: text/html\n\n";
print "<pre>\n\n";
opendir(USERDIR,"/DIRECTORY PATH/online/users/");
$c = 0;
foreach $user (sort(grep !/^\./, readdir USERDIR)) {
$user =~ s/.db//;
dbmopen(%USER,"/DIRECTORY PATH/online/users/$user.db",0777);
$nik = $USER{'nick'};
$nik =~ s/>(.*)<\/A>//ig;
printf " <b>%-15s</b> %-17s %-20s %-10s\n",$1, $USER{'ip'},$USER{'room'},$USER{'mode'};
dbmclose(%USER);
$c++;
}
print "\n</pre>\n\n";
print "there are total of <b>$c</b> users online.<p>\n";


Directory Path is normally filled in i leaved it out here for private reason :)

Wel i hope anyone can help me with this problem.

falko 19th October 2005 17:07

Does users.cgi have execute permissions, and does it belong to the right user and group?

BTW, did you use the test scripts I provided? http://www.howtoforge.com/forums/showthread.php?t=171

Mahir 19th October 2005 17:14

Will try the test script but maked simulair script only called test.cgi but also not worked i did chmod 755 on all the cgi files and directory's in the cgi-bin folder. maybe problem is that i have to make the file with VI instead of ftping it because that is on my other server also a problem i have to make every file with vi but i gues it is not smart to give everyone ssh access to the server?

falko 19th October 2005 17:32

Quote:

Originally Posted by Mahir
Will try the test script but maked simulair script only called test.cgi but also not worked i did chmod 755 on all the cgi files and directory's in the cgi-bin folder. maybe problem is that i have to make the file with VI instead of ftping it because that is on my other server also a problem i have to make every file with vi but i gues it is not smart to give everyone ssh access to the server?

You should make sure that you save the Perl file with Unix line breaks, not Windows line breaks. Maybe that causes the error.

Mahir 19th October 2005 17:43

Yeah thank u very much i found the error,

1 i wasn't uploading in right format (very noobies)
2 it was full of windows line breaks.

But it is now working as intended thnx for reply falko :)

misterm 21st November 2005 15:29

Premature end of script headers
 
Somebody could give me the exact definition of this "Premature end of script headers", because that prevents me from sleeping, because I would like to have myself, how, I could arrange this problem.


MM :mad: :mad:

till 21st November 2005 15:40

Premature end of script headers means that no HTML headers where send to the browser.


All times are GMT +2. The time now is 10:29.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.