Jump to content

Recommended Posts

Posted

I've developed and tested on a server at home a Perl script that I'd like to use on my (shared hosting) website, but it requires a module that isn't installed on the TCH server. Is it permissible to upload the module to my own cgi-bin and use it from there?

 

If so, is this the correct way to do it? It's working for me at home, but I'm not sure it's the best way:

 

In the file that uses the module, instead of:

 

>use HTML::Scrubber;

 

I'm trying this:

 

>do '/full/path/to/cgi-bin/Scrubber.pm';

Posted (edited)

This also appears to be a possibility :

>use lib '/full/path/to/cgi-bin/';
use Scrubber;

 

It's working (at least in tests at home), and looks like it might be preferable because it allows using "USE".

Edited by SteveW
Posted

Thanks, Bruce. I would have discovered that many weeks from now and had a "doh" moment. :oops:

 

Before trying cPanel, I went ahead and uploaded Scrubber.pm to cgi-bin and used the 2 lines I posted previously:

 

>use lib '/home/USER/public_html/cgi-bin/';
use Scrubber;    # rather than HTML::Scrubber because it's not in an /HTML/ subdirectory.

 

Plus, added this code to cgi-bin/.htaccess to prevent web access to any Perl modules in cgi-bin:

 

><FilesMatch ".+\.pm$">
order allow,deny
deny from all
</FilesMatch>

 

It's working! :)

 

Then I tried installing the module via cPanel, but did encounter some issues. So Alex, unless those are issues that the staff would really want to know about (that is, it would benefit the whole server), or unless there are important reasons why I shouldn't do this by the method I worked out, I'd prefer to stay with what I've got and not bother the support desk.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...