views:

62

answers:

1

Hi, have you struggled with Linux deployment before?

I need to deploy an application into a dedicated Linux box with no outside network access. The configuration should be as simple as possible, robust for different configurations (missing libraries and build tools) and preferably automatic. Another difficulty I need to consider is that I need to connect to an Oracle database.

What would you recommend as the best way for deployment? I have some ideas, but not sure which is the best.

  • I can use Java
    • I will need to install JDK, and that solves mostly everything
    • Another big problem is that the code we presently have in Java is poorly written and slow.
    • I'm not sure if I need to install Instantclient to connect to Oracle under linux
  • I can use C (I do have the source code for a very well-written LGPL program)
    1. And use dpkg to deploy
      • The Linux box is most likely a Ubuntu server, but I'm not sure which version is installed
      • I can't use apt-get, but I can copy all the packages I need
      • I know I can use dpkg -s to check which packages they are, but I'm really not sure if I might miss dependencies.
      • I guess I will need build-essentials and pcap or such
    2. And use static linking
      • I configured it with ./configure LDFLAGS=-static with no errors and it works on my computer now
      • I have chroot into this directory and run it without problems, does this mean this is okay?
      • I really need to test this on a new Linux box to make sure
    3. And use Statifier
      • I browsed stackoverflow and found this app, haven't tried it out yet.
      • Seems like people have used it with mixed success.
    4. And create a build environment and make
      • I have no confidence that this is going to work
  • Using C leaves some problems
    • But the program is incomplete, I have to process this data, preferably not in C.
    • I have to install Instantclient, which is difficult to deploy
  • I can use Perl
    • I can't use CPAN
    • I have already downloaded the libraries, so maybe I could just copy them into the deployed machine, I am not sure how or whether this works
    • Perl is slow
    • I have to install Instantclient anyways

Please share your similar experience.

+1  A: 

C with static linking solves a lot of the portability problems at the expense of a larger executable. To make sure that everything is truly getting statically linked and not secretly depending on any outside libraries, run ldd on your executable and make sure it isn't dynamically loading everything. Note that this won't be 100% portable amoung various linux machines because Oracle instantclient has some dependencies on kernel versions, but it should work on any reasonably new kernel.

Edit: If the box has LAN access and and just no internet access, why not run your own apt repository on the local network. You could even create a .deb for your application and put it on the same server, than on that machine you just need to execute apt-get myApplication and it will pull down your app and any noninstalled dependencies as well. Setting up an apt mirror is actually pretty easy and this would be pretty slick. If network access is missing alltogether, you can still create an install dvd that has all the debs including your app and set up apt-get to pull from there.

bdk
I was considering just mirroring all the packages I needed, and the problem is I'm not sure if I got all right.I just used a virtualbox to emualate a clean install of ubuntu, the static binary is working all right. I think that solve my question
TiansHUo