Current time: 04-24-2024, 01:52 PM Hello There, Guest! (LoginRegister)


Post Reply 
Perl + Non-standard cgi-bin folder + Perl inside .html file + Many hours
Author Message
zatara Offline
Newbie
*

Posts: 7
Joined: Jan 2010
Reputation: 0
Post: #1
Perl + Non-standard cgi-bin folder + Perl inside .html file + Many hours
Ok, I am going to run down the quick version here. I am moving files from a Fedora webserver that did not have ISPCP or anything else on it. It idid have virtual hosts. I have installed (successfully) IspCP to manage the sites. In the moving process I discovered that a large number of the web files are Perl or Perl embedded in .html files.

I have tried modifying the site-enabled/ispcp.conf file, the apache2.conf file and many more. For a thorough listing of my attempts, checkout my blog:
http://www.mikespicer.net/wp/?p=12

Here is the issue, I need to execute Perl scripts in .pl and in .html from any directory. Right now, I can only get this working if I change the .htaccess file of one sub directory. If I change anything else, I get an Internal Error 500. The suexec.log tells me that "file is writable by others: "

There is just one issue with the above error explanation, I am looking at the configuration and not seeing anything that make sense as far as permissions go.

Further more, when I try adding the .htaccess file to another subdomain, everything breaks and I get internal error.

My .htaccess file has the following 2 lines in it:
AddHandler cgi-script .pl .html
Options +ExecCGI

Basically, all I want to do is execute Perl from most directories. And yes I have tried using the <file> directive in apache2.conf and have tried adding directory to ispcp.conf. It seems like suexec is fighting the conf files and then who knows where ispcp is trying to fight its way in.

Let me know if you have any thoughts.

Thanks

-z
01-31-2010 06:06 PM
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: Perl + Non-standard cgi-bin folder + Perl inside .html file + Many hours
Add the settings in /etc/apache2/ispcp/*.conf or directly in the tpl files in /tec/ispcp/apache/parts. Otherwise they will be overwritten by ispcp.

Often - when moving from an older server to ispcp it's the problem of the file owner and permission (suexec).
Make sure that the owner of all files insider htdocs is the domain-user (vu20xx)... - the group either www-data (html) or only the vu20xx-group (but then the htmm files need to be world readable).

In short: the php files (run though suexec) can stay with vu20xx:vu20xx and permissions 644 - the files that need to be readable by apache (all others - if not another handler is defined) need to be readable by group www-data.

If still errors - please post the errors (log files!)

/J
01-31-2010 07:17 PM
Visit this user's website Find all posts by this user Quote this message in a reply
zatara Offline
Newbie
*

Posts: 7
Joined: Jan 2010
Reputation: 0
Post: #3
RE: Perl + Non-standard cgi-bin folder + Perl inside .html file + Many hours
Hey Joximu,

I appreciate your very fast reply! I am pretty sure I have all of the user permissions and groups figured out. What permissions will I need to set for the htaccess file (if I use them)?

Thanks for the advice on making things persistent too. I will test this out more tomorrow and get back to you. I did find in a few perl files, some invalid hard coded references to perl libraries. Ugh, I hate being clean up for other people.

Will get back you soon.

-z
02-01-2010 03:58 PM
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: #4
RE: Perl + Non-standard cgi-bin folder + Perl inside .html file + Many hours
the .ht* files should also be readable by apache - since they contain commands for apache.

/J
02-01-2010 06:19 PM
Visit this user's website Find all posts by this user Quote this message in a reply
zatara Offline
Newbie
*

Posts: 7
Joined: Jan 2010
Reputation: 0
Post: #5
RE: Perl + Non-standard cgi-bin folder + Perl inside .html file + Many hours
I am having errors with ISPCP error 500 for one of my Perl Scripts. I have looked at the logs here: /var/log/apache2/users/ and have been digging through the other log files, but haven't found any that is helpful. I have checked the scripts functionality with perl -wc [scriptname] and it returns no errors. I have no idea what else to check. Any help would be awesome!

Thanks,

-z
02-17-2010 05:18 PM
Find all posts by this user Quote this message in a reply
kilburn Offline
Development Team
*****
Dev Team

Posts: 2,182
Joined: Feb 2007
Reputation: 34
Post: #6
RE: Perl + Non-standard cgi-bin folder + Perl inside .html file + Many hours
It is probably a permission thing (your script being blocked by suexec). Look at /var/log/apache2/suexec.log to see if it complaints about something. You might also be able to get some info in the /var/log/apache2/users/default-error.log if you haven't looked at it...
(This post was last modified: 02-17-2010 05:37 PM by kilburn.)
02-17-2010 05:33 PM
Visit this user's website Find all posts by this user Quote this message in a reply
zatara Offline
Newbie
*

Posts: 7
Joined: Jan 2010
Reputation: 0
Post: #7
RE: Perl + Non-standard cgi-bin folder + Perl inside .html file + Many hours
(02-17-2010 05:33 PM)kilburn Wrote:  It is probably a permission thing (your script being blocked by suexec). Look at /var/log/apache2/suexec.log to see if it complaints about something. You might also be able to get some info in the /var/log/apache2/users/default-error.log if you haven't looked at it...

I think your right, here is the output of /var/log/apache2/suexec

Code:
[2010-02-17 01:42:01]: uid: (2003/vu2003) gid: (2003/vu2003) cmd: funcs.pl
[2010-02-17 01:42:01]: (2)No such file or directory: exec failed (funcs.pl)

Now the problem is, I have no idea why it is saying no file or directory. It is clearly in the directory and the owner and group is vu2003. Very strange.

Ok, I solved one part of the issue, My Perl directive was set wrong.... Do'H, I should be flogged... but now I have an uninitialized variable error:

Code:
Use of uninitialized value $m_lpszDecision in string eq at funcs.pl line 33.

This is a pain. I wish people would have just authored good Perl code to start with.


Thanks for you help!

-z
(This post was last modified: 02-17-2010 06:43 PM by zatara.)
02-17-2010 06:15 PM
Find all posts by this user Quote this message in a reply
kilburn Offline
Development Team
*****
Dev Team

Posts: 2,182
Joined: Feb 2007
Reputation: 34
Post: #8
RE: Perl + Non-standard cgi-bin folder + Perl inside .html file + Many hours
You remind me the days when I switched my servers from php4 to php5... But remember, all bad things come to an end too!
02-17-2010 06:47 PM
Visit this user's website 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: #9
RE: Perl + Non-standard cgi-bin folder + Perl inside .html file + Many hours
Since we don't know the code, you need at least post some lines around the error... (33)

/J
02-18-2010 08:54 AM
Visit this user's website Find all posts by this user Quote this message in a reply
kilburn Offline
Development Team
*****
Dev Team

Posts: 2,182
Joined: Feb 2007
Reputation: 34
Post: #10
RE: Perl + Non-standard cgi-bin folder + Perl inside .html file + Many hours
@joxi: I don't think he's asking for further help... he was only complaining about his clients' bad code Wink
02-18-2010 02:49 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


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