Compile on testbox then move to production

Posted on 2005-05-01
Last Modified: 2013-11-13
Im looking for information on how to compile software on a test box then move it to our production servers.  This software would include Apache, PHP, FreeTDS and others.  I know how to compile and install all this software, but I want to avoid having to have the compile tools (make etc) on the production servers.
Can anyone tell me how I can compile on a test box, then move the binaries and required files to the production servers.
Question by:maunded
    LVL 48

    Expert Comment

    A very common method is to package up the tools using whatever packaging tool you prefer, eg: RPM, YUM, etc.  That way you can build in the dependencies and any pre/post install/uninstall steps.
    LVL 38

    Accepted Solution

    If the OS on the testbox has the same version as the OS on the production server,
    then I would suggestion you compile and install them on a separate directory ( usually default path is /usr/local).

    You can refer what I did for gcc in other post.

    Basically, say you install then all under /opt/local with
    ./configure --prefix=/opt/local/<package name>   # <===pacakge name like apache213, php411...
    Then you make the symbolic link from /opt/local/<package name>/bin/<executeable filename> to /opt/local/bin
    such as
    cd /opt/local/bin
    ln -s ../apache213/bin/httpd  .    # <=== use related path instead of absolutely path.

    If everything test ok, then you just copy over /opt/local to the production server.
    Or put /opt/local on NFS server and mount on the production as /opt/local.
    LVL 1

    Author Comment

    Excellent!  So is it safe to assume, that if I, for example, compile Apache without the --prefix switch, that ALL the required files will be in /usr/local/apache2?  Will using the prefix switch build a directory structure, that, like PHP for example, puts files in other directorys?  Like /usr/lib etc.
    LVL 38

    Expert Comment

    > compile Apache without the --prefix switch, that ALL the required files will be in /usr/local/apache2
    As my experience, no.
    It will install in /usr/local, not /usr/local/apache2.
    You need to specify as --prefix=/usr/local/apache2

    > puts files in other directorys?  Like /usr/lib etc.
    Most of cases, no. They are all under /usr/local/php4....
    Only glibc is different, as I know.
    LVL 1

    Author Comment

    Fantastic, thank you very much

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Join & Write a Comment

    One of the most frequently asked questions on EE in the "Windows Installer" zone is how to eliminate self-triggered installation of some product.  The problem occurs when, suddenly, whenever a certain application is launched, or even when a folder i…
    Installations often have prerequisites, such as “Microsoft .Net framework is required for this product”. The usual implementation in MSI installations is system search for a particular registry setting representing the required prerequisite, followe…
    Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now