Compiling from Source
Linux distributions come with binary versions of almost everything, however there are good reasons why we want to deinstall the binary versions of the critical server software and reinstall from source :
- We want to fit the software compile-options to the exact needs of our site
- A newer bug-fixing or security-fixing version of the software needs to be applied promptly
- The software is not installed in the standard /usr/local file structure where some other software would expect it to be
Compiling software from source is often simple, however when the software is complex or has many options, can require some additional knowledge to choose the right options. The usual steps are :
- Locate the source package (google…) and download it
- Uncompress the tarball (compressed file) under /usr/local
- Go to the software directory and read the README and INSTALL files
- Check the options using ./configure --help | less
- Configure the package to your system specific needs running the ./configure script, that automatically checks your system to produce all the required Makefiles. This is the step that sometimes may have many options
- Make and make install using the right login and permissions
- Set up configuration files
- Use the software
What you usually need to type on your keyboard is something like that :
# tar -tvf software-x.y.z.tgz # tar -C /usr/local -xvf software-x.y.z.tgz # cd /usr/local # chown -R root:root software-x.y.z # chmod -R o-w software-x.y.z # cd software-x.y.z # vi README … # vi INSTALL … # ./configure -help | less # ./configure -option1 -option2 … # make # make install # cd /etc/software # vi xxx … # cd /etc/rc.d # vi rc.software # ./rc.software restart
Using 64 bits Linux Slackware, unless you install multilib (which seems to break the ability to compile the Kernel BTW), it is not very important where you store the libraries and /usr/local/lib - which is still the default for most software - could be OK. However to keep things in good order *** we *** prefer to always store 64-bits libraries in /usr/local/lib64 using the -libdir option of .configure where available, otherwise copying the libraries manually as part of the installation.
Software not working after installation is often a permission issue. Keep the initial setting of 022 for umask in /etc/profile to make sure files are created with read access for other when installing. For software to be ran under a user other that root (cyrus imap under cyrus, spamAssassin-clamav-mimedefang under milter), su under this user after installation to make sure the software works and launch the software from the console to detect permission issues messages. The /var/log directory is another place to check for errors.
Another major cause of failures is missing libraries because they are searched in the wrong place - for example /usr/lib64 instead of /usr/local/lib - or because they have the wrong name - for example library imap2007/c-client.a actually needs to be linked as imap2007/libc-client.a.
|Compiling the Kernel||Main Page||OpenSSL|