Securing and Optimizing Linux: RedHat Edition -A Hands on Guide | ||
---|---|---|
Prev | Chapter 13. Linux -The Compiler functionality | Next |
You will see from the next chapter right through Part 6 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:
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.
After downloading the tarball change to the /var/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:
Example 13-1. Using tar
[root@deep] /#tar xzpf foo.tar.gz |
tells tar to extract all files from the archive.
tells tar that the archive is compressed with gzip.
maintains the original and permissions the files had as the archive was created.
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 build and compile the software package for use. 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. |
make depend strip chown |
command will build and make the necessary dependencies for different files.
command will discard all symbols from the object files. This means that our binary file will be smaller in size, 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.
command will set the correct files owner and group permission for the binaries.
: More commands when necessary will be explained in the concerned installation procedure.
The vi program is a text editor that you can use to edit any text and particularly programs. During installation of software, the user will often have to edit text files like Makefiles or configuration files to make and fit they changes. The following are some of the most important keystroke commands to get around in vi.
To insert text before the cursor.
To append text after the cursor.
To delete the current line.
To delete the current character.
To end the insert or append mode.
To undo the last command.
Scroll up one page.
Scroll down one page.
Search forward for string.
Display filename and current line nmber.
Quit editor.
Quit editor without saving changes.
Save changes and exit editor.
Before proceeding to read the rest of this book, it should be noted that the text assumes that certain files are placed in certain directories. Where they have been specified, the conventions we adopt here for locating these files are those of the Red Hat Linux distribution. If you are using a distribution of Linux or some other operating system that chooses to distribute these files in a different way, you should be careful when copying examples directly from the text. |