|
CGI does not work [solved]
|
| Author |
Message |
spamsuxx
Posts: 4
Group: Registered
Joined: Mar 2008
Status:
Offline
Reputation: 0
|
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 +)
<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
#!/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:
[Fri Apr 25 21:06:14 2008] [error] [client 77.184.196.236] Premature end of script headers: test.cgi
vhost config:
# 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 |
|
 |
joximu
Moderator
    
Posts: 3,537
Group: Moderators
Joined: Jan 2007
Status:
Offline
Reputation: 47
|
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?
2008-03-16 ispCP RC4 released!!!
|
|
| 04-26-2008 05:50 AM |
|
 |
spamsuxx
Posts: 4
Group: Registered
Joined: Mar 2008
Status:
Offline
Reputation: 0
|
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 |
|
 |
blocker
Junior Member

Posts: 81
Group: Registered
Joined: Apr 2007
Status:
Offline
Reputation: 1
|
RE: CGI does not work
hmm maybe perl is not allowed in openbase path ?
OS: FreeBSD 7.0, 6.3, 6.2 - ISPCP Omega Dev. Version =T-W-S= Blocker
|
|
| 04-28-2008 11:26 AM |
|
 |
joximu
Moderator
    
Posts: 3,537
Group: Moderators
Joined: Jan 2007
Status:
Offline
Reputation: 47
|
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
2008-03-16 ispCP RC4 released!!!
|
|
| 04-28-2008 11:44 AM |
|
 |
rbtux
Member
  
Posts: 1,200
Group: Registered
Joined: Feb 2007
Status:
Away
Reputation: 22
|
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...
OS: Debian Lenny
ispCP Version: Trunk r1033
Activated: AWStats dynamic, Dovecot, Avelsieve, Selective Greylisting, Bogus MX Filter,
No Webtools, Roundcube, Some own modifications
|
|
| 04-28-2008 05:00 PM |
|
 |
spamsuxx
Posts: 4
Group: Registered
Joined: Mar 2008
Status:
Offline
Reputation: 0
|
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...
I will check this and see what is happening
Sory for the my late reply.
|
|
| 05-02-2008 12:53 AM |
|
 |
spamsuxx
Posts: 4
Group: Registered
Joined: Mar 2008
Status:
Offline
Reputation: 0
|
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 |
|
 |