I have a server that I can ssh into but that's it. Otherwise it is totally closed off from the outside world. I'm trying to deploy some scripts I wrote to it but they have several Perl dependencies (Params::Validate, XML::Simple, etc.) I can't get them via yum since our satellite server doesn't have those packages and the normal CPAN install won't work either since the host is so restricted. Moving the module so开发者_C百科urces over and compiling is extremely tedious. I've been doing that for over a day, trying to resolve dependencies, with no end in sight. Is there any way around this? Any help is greatly appreciated.
If you can, set up a parallel system as close as possible (as far as architecture, and perl version) to your closed system, and install all your dependencies there into a separate lib directory using local::lib. Then you can simply scp over that directory to your closed system, and again using local::lib (and setting up some environment variables), your code will be able to utilize that directory.
See this, it explains multiple methods that you can use to get CPAN modules into production.
Have you tried cpan minus? If not, here's how to get it.
curl -L http://cpanmin.us | perl - App::cpanminus
You can use it with local::lib. :-D
Chromatic has a great post on how to even get a newer(and multiple) version(s) of perl onto a restricted system.
If you can change your hosting provider, this would be a good time to switch ;-) (I personally think Linode rocks!).
Assuming that is not the case, you can try to go with the option of setting a parallel system as @Ether suggested.
On the other hand, if the modules you are using and their dependencies are pure Perl modules, you should be able to use PAR::Packer to package your script and its dependencies and scp
a single file over to the host.
I use SSH tunneling to tunnel from the remote server back to a local proxy server. That way you can install whatever Modules you need. Just set the http_proxy variable to the local port that is remote forwarded (If that makes sense) from your local machine.
i.e.
ssh user@remote -R 3128:proxy_ip:3128 (for a tunnelling a Squid setup)
then on the remote server in cpan
o conf http_proxy=http://localhost:3128
o conf commit
精彩评论