Current time: 12-24-2024, 06:34 AM Hello There, Guest! (LoginRegister)


Post Reply 
CGI does not work [solved]
Author Message
spamsuxx Offline
Newbie
*

Posts: 6
Joined: Mar 2008
Reputation: 0
Post: #1
CGI does not work [solved]
Hi folks,

I tried all to get CGI working, but no go so far:
http://spamsuxx.de/cgi-bin/test.cgi

Could anyone help me out?

CGI is enabled.[/code]
I even tried to add the following to
/etc/apache2/ispcp/spamsuxx.de.conf but after a apache restart... no go..
( Options +ExecCGI wit and without the +)
Code:
<Directory /var/www/virtual/spamsuxx.de/cgi-bin>
        AllowOverride None
        Options +ExecCGI
        Order allow,deny
        Allow from all
    </Directory>

/var/www/virtual/spamsuxx.de/cgi-bin/test.cgi
Code:
#!/usr/bin/perl -w

print "Content-type: text/html\n\n";
print "<html><head>";
print "<title>CGI Test</title>";
print "</head>";
print "<body><h1>CGI is working!</h1>";
print "</body></html>";

Error log:
Code:
[Fri Apr 25 21:06:14 2008] [error] [client 77.184.196.236] Premature end of script headers: test.cgi

vhost config:
Code:
# httpd [spamsuxx.de] dmn entry BEGIN.
<VirtualHost 78.47.73.50:80>

    <IfModule suexec_module>
           SuexecUserGroup vu2001 vu2001
    </IfModule>

    ServerAdmin     webmaster@spamsuxx.de
    DocumentRoot    /var/www/virtual/spamsuxx.de/htdocs

    ServerName      spamsuxx.de
    ServerAlias     www.spamsuxx.de spamsuxx.de *.spamsuxx.de

    ErrorLog        /var/log/apache2/users/spamsuxx.de-error.log
    TransferLog     /var/log/apache2/users/spamsuxx.de-access.log

    CustomLog       /var/log/apache2/spamsuxx.de-traf.log traff
    CustomLog       /var/log/apache2/spamsuxx.de-combined.log combined

    Alias /errors   /var/www/virtual/spamsuxx.de/errors/

    RedirectMatch permanent /ftp([\/]?)         http://ispcp.spamsuxx.de/ftp/
    RedirectMatch permanent /pma([\/]?)         http://ispcp.spamsuxx.de/pma/
    RedirectMatch permanent /webmail([\/]?)     http://ispcp.spamsuxx.de/webmail/

    ErrorDocument 401 /errors/401.html
    ErrorDocument 403 /errors/403.html
    ErrorDocument 404 /errors/404.html
    ErrorDocument 500 /errors/500.html
    ErrorDocument 503 /errors/503.html

    <IfModule mod_cband.c>
        CBandUser spamsuxx.de
    </IfModule>

    # httpd awstats support BEGIN.

   ProxyRequests Off

   <Proxy *>
      Order deny,allow
      Allow from all
   </Proxy>

   ProxyPass                    /stats  http://localhost/stats/spamsuxx.de
   ProxyPassReverse     /stats  http://localhost/stats/spamsuxx.de
   # httpd awstats support END.

    # httpd dmn entry cgi support BEGIN.
    ScriptAlias /cgi-bin/ /var/www/virtual/spamsuxx.de/cgi-bin/
    <Directory /var/www/virtual/spamsuxx.de/cgi-bin>
        AllowOverride None
        #Options ExecCGI
        Order allow,deny
        Allow from all
    </Directory>
    # httpd dmn entry cgi support END.
    # httpd dmn entry PHP2 support BEGIN.
    <IfModule mod_php4.c>
        php_admin_value open_basedir "/var/www/virtual/spamsuxx.de:/var/www/virtual/spamsuxx.de/phptmp:/usr/share/php"
        php_admin_value upload_tmp_dir "/var/www/virtual/spamsuxx.de/phptmp"
        php_admin_value session.save_path "/var/www/virtual/spamsuxx.de/phptmp"
        php_admin_value sendmail_path '/usr/sbin/sendmail -f vu2001 -t -i'
    </IfModule>
    <IfModule mod_php5.c>
        php_admin_value open_basedir "/var/www/virtual/spamsuxx.de:/var/www/virtual/spamsuxx.de/phptmp:/usr/share/php"
        php_admin_value upload_tmp_dir "/var/www/virtual/spamsuxx.de/phptmp"
        php_admin_value session.save_path "/var/www/virtual/spamsuxx.de/phptmp"
        php_admin_value sendmail_path '/usr/sbin/sendmail -f vu2001 -t -i'
    </IfModule>
    <IfModule mod_fastcgi.c>
        ScriptAlias /php4/ /var/www/fcgi/spamsuxx.de/
        ScriptAlias /php5/ /var/www/fcgi/spamsuxx.de/
        <Directory "/var/www/fcgi/spamsuxx.de">
            AllowOverride None
            Options +ExecCGI -MultiViews -Indexes
            Order allow,deny
            Allow from all
        </Directory>
    </IfModule>
    # httpd dmn entry PHP2 support END.

    <Directory /var/www/virtual/spamsuxx.de/htdocs>
        # httpd dmn entry PHP support BEGIN.
        # httpd dmn entry PHP support END.
        Options -Indexes Includes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>

    Include /etc/apache2/ispcp/spamsuxx.de.conf

</VirtualHost>
# httpd [spamsuxx.de] dmn entry END.
(This post was last modified: 05-02-2008 12:57 AM by spamsuxx.)
04-26-2008 05:14 AM
Find all posts by this user Quote this message in a reply
joximu Offline
helper
*****
Moderators

Posts: 7,024
Joined: Jan 2007
Reputation: 92
Post: #2
RE: CGI does not work
The "premature end of script" is typical.

Do you have a mac or windows on the client where you upload the file?
have you tried uploading with FTP ASCII mode?
04-26-2008 05:50 AM
Visit this user's website Find all posts by this user Quote this message in a reply
spamsuxx Offline
Newbie
*

Posts: 6
Joined: Mar 2008
Reputation: 0
Post: #3
RE: CGI does not work
Nope, no upload, i wrote the script "de novo" on the server, so there is no issue with bin/ASCII upload. The permissions are, for testing purpose, set to 777 on the script.

On the client side I am using Linux.

Neither new written scripts nore downloaded scripts do work
04-27-2008 08:06 PM
Find all posts by this user Quote this message in a reply
blocker Offline
Junior Member
*

Posts: 123
Joined: Apr 2007
Reputation: 2
Post: #4
RE: CGI does not work
hmm maybe perl is not allowed in openbase path ?
04-28-2008 11:26 AM
Find all posts by this user Quote this message in a reply
joximu Offline
helper
*****
Moderators

Posts: 7,024
Joined: Jan 2007
Reputation: 92
Post: #5
RE: CGI does not work
openbase = php != perl

I also have had some problems with perl cgis - the permissions must be set correctly and the newline has to be correct. But I don't know what exactly the rules were (somewhere in the forum but I fear it was before September 07 - so it's gone).

/J
04-28-2008 11:44 AM
Visit this user's website Find all posts by this user Quote this message in a reply
rbtux Offline
Moderator
*****
Moderators

Posts: 1,847
Joined: Feb 2007
Reputation: 33
Post: #6
RE: CGI does not work
well for me there were three problems i can remember... Script must be executable, Script must belong to the correct user and group (vu2xxx/vu2xxx) and the path to the interpreter in the shebang has to be correct.

With these three conditions met I never had any problems...
04-28-2008 05:00 PM
Visit this user's website Find all posts by this user Quote this message in a reply
spamsuxx Offline
Newbie
*

Posts: 6
Joined: Mar 2008
Reputation: 0
Post: #7
RE: CGI does not work
rbtux Wrote:well for me there were three problems i can remember... Script must be executable, Script must belong to the correct user and group (vu2xxx/vu2xxx) and the path to the interpreter in the shebang has to be correct.

With these three conditions met I never had any problems...

I will check this and see what is happening

Sory for the my late reply.
05-02-2008 12:53 AM
Find all posts by this user Quote this message in a reply
spamsuxx Offline
Newbie
*

Posts: 6
Joined: Mar 2008
Reputation: 0
Post: #8
RE: CGI does not work
Okay, the permissions had to be 755 (777 does not work, thats fine!)

Thanks for your help!
05-02-2008 12:57 AM
Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 2 Guest(s)