Build and Install software on your system
You will see from chapter 10 through chapter 20 below that we use many different compile commands to build and install programs on the server. These commands are UNIX compatible and are used on all variant off *nix machines to compile and install software.
The procedures to compile and install software tarballs on your server follow:
1. First of all, you must download the tarball from your trusted software archive site. Usually
from the main site of the software you hope to install.
2. After downloading the tarball change to the 7var/tmp/” directory (note that other paths are
possible, as personal discretion) and untar the archive by typing the commands (as root)
as in the following example:
[root@deep /]# tar xzpf foo.tar.gz
The above command will extract all files from the example “foo.tar.gz” compressed archive and will create a new directory for them with the name of this software from the path where you are executing the command.
The “x” option tells tar to extract all files from the archive.
The “z” option tells tar that the archive is compressed with gzip.
The “p” option maintains the original and permissions the files had as the archive was created.
The “f” option tells tar that the very next argument is the file name.
Once the tarball has been decompressed into the appropriate directory, you will almost certainly find a “README” and/or an “INSTALL” file included with the newly decompressed files, with further instructions on how to prepare the software package for use. Likely, you will need to enter commands similar to the following example:
./configure make make install
The above commands “./configure” will configure the software to ensure your system has the necessary functionality and libraries to successfully compile the package, “make” will compile all the source files into executable binaries. Finally, “make install” will install the binaries and any supporting files into the appropriate locations. Other specifics commands that you’ll see on our book for compilation and installation procedure will be:
make depend
strip
chown
The “make depend” command will build and make the necessary dependencies for different files. The “strip” command will discard all symbols from the object files. This means that our binary file will be smaller in size. This will improve a bit the performance hit to the program since there will be fewer lines to read by the system when it executes the binary. The “chown” command will set the correct files owner and group permission for the binaries.
NOTE: More commands will be explained in the concerned installation parts.