I am using Active Perl and am looking for ways to set up a local repository to install various modules. Main reason behind is the production server has no internet access.
Can anyone point me any quick start or step-by-step tutorials on this?
There is a tutorial on how to install from a local repository (manually) here
There are descriptions how someone did it here (perlmonks) and here (perl.com)
To use the GUI ppm manager most likely requires a httpd (a.k. web server) that gives PPM access to the *.ppd and *.tgz files over http. I'm not sure I'd choose that over doing it from the command line.
Related
I am trying to install a few Perl modules, one of them being Time::Format. My corporate group policy does not allow me to use CPAN (since it uses FTP) to install modules. Tried using makefile.pl, but nmake.exe (I am using windows cygwin) seems to be missing too. The policy does not allow to download the nmake.exe executable too. PPM isn't available too.
How do I go about installing module manually? Is there a way where I could manually copy files from this module on to individual folders in my Perl directory? If yes, which files, go where?
You might be able to get around the FTP restriction by using a minicpan. Basically this lets you build your own local CPAN mirror, for example on a USB key drive. It's intended to carry a snapshot of CPAN with you, e.g. when you are in transatlantic flights and just really need that module you didn't install.
However, those restrictions are probably there for a reason. Downloading and installing/copying stuff from the internet might be against the corporate policy just the same as it's an external source. You should check that. On the other hand, those policies are often intended for the average office user that is not a developer, so you might be able to talk to them and explain why you and your team should be excepted from this policy, and how reusing code from CPAN would save your company a lot of time, which equals money.
When I turn on syntax checking for Perl in Eclipse (with EPIC plugin), it shows errors in use directives, because I edit Perl remotely (through FTP with Remote Systems Explorer plugin) and some modules available on the remote FTP server are not available on my local machine.
Can Perl syntax checking be restricted not to show an error in the case of a missing module?
If no, I'd disable Perl syntax checking completely. By the way, how to do this?
From my googling, I don't think there is a way to do this. The best workaround seems to be creating dummy modules to make the errors go away. I've found 2 sources that recommended the use of dummy modules for this purpose; an answer on Stack Overflow and a forum post on Source Forge.
If you have ssh access to remote server than you can mount your lib directory from remote server to your local machine, for example if you're using linux you can do this with sshfs or if you're Windows user than use Samba.
Now go to project properties in Eclipse and in Perl Include Path section add your path to previously mounted directory.
Is it possible to set the path where the berkshelf plugin puts the cookbooks it installs? (As in the .berkshelf folder)
I am running Windows 7.
I am currently trying to install a mysql server using an opscode cookbook to a vm and here at work they have the %HOMEDRIVE% system variable set to a network drive. So when .berkshelf starts at the beginning of the Vagrantfile, it pushes the cookbooks to the network drive and it causes it to be slow and well, its not where it should be. Is there a fix to this?
VirtualBox did this as well, but I fixed it by altering the settings. I tried looking for some sort of equivalent settings for berkshelf, but the closest I got was for the standard berkshelf (thats not a vagrant plugin), it appears you can set this environment variable:
ENV['BERKSHELF_PATH']
Found here:
http://www.rubydoc.info/github/RiotGames/berkshelf/Berkshelf#berkshelf_path-class_method
I need to be able to have the cookbooks it reads from the berksfile store to my laptops local drive instead, as in my scenario I cannot have the mobility of the VM limited to the building because of files that are stored on the network.
Any incite would be much appreciated.
Perhaps its better to use the actual berkshelf over the vagrant plugin?
Thanks.
If you want to have the portability - a full chef-repo ready for chef-solo runs, better off using standalone berkshelf instead of the vagrant-berkshelf plugin - which is NOT that flexibly.
For complex cookbooks, I prefer to use standalone berkshelf as it allows me to do berks install --path chef/cookbooks to copy all cookbooks required from ~/.berkshelf/cookbooks, then I can just tar the whole thing and transfer to other machines for the same chef-solo run. some people use capistrano automate the tar and scp/rsync over the network. I just use rysnc/scp;-)
HTH
I have a Linux server that has no access to the internet (access is prevented by a firewall). I would like to install a new Perl. What are my options and what is the best way to do this? The system Perl (included in OS installation) must remain unchanged.
I have been using perlbrew and I think it is the best way to do an online installation. But all the steps involved in perlbrew seem to require internet access: you download it from the net, it downloads new Perl versions from the net etc. and I haven't found a glue how to make it work offline.
If perlbrew is out of question I could build Perl from source into a custom location on the server. I assume that this could end up being complicated, time-consuming and error-prone. And every time I update Perl I have make a new build manually.
There can also be other ways to install that I'm not currently aware of. And of course I could stick with the system Perl but it is an outdated version and I'm already using the new syntax features. Or I could start negotiations to change the firewall policy to allow internet access for perlbrew.
But all the steps involved in perlbrew seem to require internet access
Not if properly configured.
To install perlbrew itself off-line, install the App-perlbrew dist. Following its dependencies manually is a chore, so instead prepare a MiniCPAN mirror (with -p to include Perl dists), take it over to the target machine and configure CPAN to use the local mirror. Run cpan App::perlbrew to install.
After perlbrew is installed, run its mirror command to configure a CPAN mirror into $PERLBREWROOT/Config.pm. Edit this file to change it to the local MiniCPAN mirror. Drop Perl dist tarballs into $PERLBREWROOT/dists/.
Be aware that compiling Perl requires a working C compiler toolchain, and optionally the development files for libdb (BerkeleyDB) and gdbm. (Read the INSTALL file once over, even though perlbrew's autoconfiguration and Perl's configure.SH defaults hide these details from you.)
The compiler toolchain is probably much more difficult to procure off-line, unless the OS installation has already been used before for compiling other C stuff.
There's nothing that special about perlbrew. If you aren't going to use it to download the Perl sources, it's not saving you that much. Once you have the Perl sources, you just need to configure and install it:
% ./Configure -des -Dprefix=/path/to/installation
% make install
Once done, everything for that Perl is under that installation path.
I dislike perlbrew mostly because it hides from people how amazingly simple this task is so they feel like they can't do it on their own.
Have you considered attacking it from a different direction? Keeping this up-to-date is going to be a pain if you have to request internet access each time. Likewise, if you've missed out/misconfigured any packages in your CPAN mirror it's difficult to correct once you're actually trying to use them.
Perhaps just build a small VM with a cut-down linux + perl + modules. Keep that up-to-date at your end and just take the whole lot in on a USB stick. You'd have a known-working easy-to-setup installation.
What I personally do is using git checkout when I'm offline (and not on vacation). Once you have the whole git work directory, it's trivial to build any released version by checking out the tags:
git checkout v5.17.4
git clean -f # cleanup previously compiled .o files etc
sh ./Configure ...
Depending on how you can transfer files to your host, this can be handy, since you you can also setup a private git repo there so other computer can git push new commits to there.
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 sources 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