Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 2 > Installation/Configuration

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 23rd March 2006, 11:58
MathieuMa MathieuMa is offline
Junior Member
 
Join Date: Feb 2006
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy CGI issue (SUExec as well maybe)

Hi,


I'm running ISPConfig 2.2 on a Debian Sarge perfect setup.
I'm trying to get CGI to work on a site but for now, after trying many things, I didn't manage.

In addition to checking "Enable CGI" for that host, here are the relevant additional configurations I added (they should be redundant, but well) :
Code:
ScriptAlias /calendar/ /var/www/web3/web/calendar/
<Directory /var/www/web3/web/calendar>
	Options +ExecCGI +FollowSymLinks
</Directory>
For my tests I'm trying to run a simple perl cgi which sends the html doctype and prints a nice hello world - it works locally.
The permissions are as follow :
Code:
-rwxr-xr-x   1 web3_xxx web3     78 Mar 23 10:45 test.cgi
The error log shows the following when hitting the CGI :
Code:
[error] (13)Permission denied: exec of '/var/www/web3/web/calendar/test.cgi' failed
[error] Premature end of script headers: test.cgi
I then decided to enable suexec, and here are the errors I get :
Code:
[error] Premature end of script headers: test.cgi
[error] failed to open log file
[error] fopen: Permission denied
The corresponding suexec log :
Code:
uid: (10008/web3_xxx) gid: (10003/10003) cmd: test.cgi
I also tested with falko's hello_world.pl in case, in the cgi-bin directory and in my calendar directory -> no go ...

Thanks in advance for any hint which could help

Last edited by MathieuMa; 23rd March 2006 at 12:09.
Reply With Quote
Sponsored Links
  #2  
Old 23rd March 2006, 18:39
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,747 Times in 2,578 Posts
Default

You must put all Perl scripts into the cgi-bin directory, and you must make them executable.
If you edited the scripts on a Windows PC before, you must save them with Unix linebreaks, not Windows linebreaks.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 23rd March 2006, 19:15
MathieuMa MathieuMa is offline
Junior Member
 
Join Date: Feb 2006
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by falko
You must put all Perl scripts into the cgi-bin directory, and you must make them executable.
Putting the script in cgi-bin gave me the same result - but the additional directive I added should make them fine in the calendar directory.
Oh, and the script was executable : -rwxr-xr-x

Quote:
Originally Posted by falko
If you edited the scripts on a Windows PC before, you must save them with Unix linebreaks, not Windows linebreaks.
I used vi on the server to edit my test - and unzipped your tests file directly on the server.
Reply With Quote
  #4  
Old 23rd March 2006, 19:51
MathieuMa MathieuMa is offline
Junior Member
 
Join Date: Feb 2006
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Did another test to be sure, placed my cgi in the cgi-bin directory.

suexec log tells me :
Code:
[2006-03-23 18:50:37]: uid: (10008/web3_claudem) gid: (10003/10003) cmd: test.cgi
Error log tells me :
Code:
[Thu Mar 23 18:51:25 2006] [error] [client xxx] failed to open log file
[Thu Mar 23 18:51:25 2006] [error] [client xxx] fopen: Permission denied
[Thu Mar 23 18:51:25 2006] [error] [client xxx] Premature end of script headers: test.cgi
Permissions are as follow :
Code:
web3_claudem@ns33446:/var/www/web3/cgi-bin$ ll
total 12
drwxr-xr-x   2 web3_claudem web3 4096 Mar 23 11:12 .
drwxr-xr-x  12 web3_claudem web3 4096 Mar 23 10:48 ..
-r--------   1 root         root    0 Feb 11 13:10 .no_delete
-rwxr-xr-x   1 web3_claudem web3   78 Mar 23 10:47 test.cgi
And I didn't changed the config

Test.cgi is as follow, written using vi in a term :
Code:
#!/usr/bin/perl
#
print "Content-type:text/html\n\n";
print "Hello World!!!";
Reply With Quote
  #5  
Old 11th April 2006, 10:59
MathieuMa MathieuMa is offline
Junior Member
 
Join Date: Feb 2006
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
 
Default

Found my issue - the /var/www partition had the noexec option (I'm used to do that as I never used cgi before)
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Perl and cgi script installation linuxuser1 General 30 27th April 2006 00:09
Internal Server Error 500 cgi script mphayesuk General 6 8th February 2006 23:53
suExec? lerra Installation/Configuration 1 8th February 2006 17:40
Ispconfig cgi hosting Mahir General 6 21st November 2005 16:40
SuExec linutzy Server Operation 1 17th August 2005 00:09


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


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