Linux Tutorial
Linux File/Directory Management
Linux Packaging And Compression
Vim Text Editor
Linux Text Processing
Linux Software Installation
Linux User/User Group Management
Linux Permission Management
Linux Filesystem Management
Linux Advanced Filesystem Management
Linux System Management
Linux Backup and Recovery
Linux System Service Management
Linux System Log Management
Linux Boot Management
LAMP/LNMP Environment
SELinux Management
In this tutorial, we'll learn how to install and uninstall a Linux source package, using Apache HTTP Server as an example. Installing from source code allows you to have the latest features and custom configuration options that may not be available in the pre-built packages.
Prerequisites
For Debian/Ubuntu-based systems:
sudo apt update && sudo apt upgrade
For CentOS/RHEL-based systems:
sudo yum update
For Debian/Ubuntu-based systems:
sudo apt install build-essential
For CentOS/RHEL-based systems:
sudo yum groupinstall "Development Tools"
Installing Apache HTTP Server from Source
wget
to download it:wget https://downloads.apache.org/httpd/httpd-2.4.51.tar.gz
tar xvf httpd-2.4.51.tar.gz
cd httpd-2.4.51
For Debian/Ubuntu-based systems:
sudo apt-get install libapr1-dev libaprutil1-dev libpcre3-dev libssl-dev
For CentOS/RHEL-based systems:
sudo yum install apr-devel apr-util-devel pcre-devel openssl-devel
/usr/local/apache2
:./configure --prefix=/usr/local/apache2
make
sudo make install
sudo /usr/local/apache2/bin/apachectl start
Apache HTTP Server is now installed and running. You can access the default page by visiting http://localhost
in your browser.
Uninstalling Apache HTTP Server
To uninstall the Apache HTTP Server installed from the source, follow these steps:
sudo /usr/local/apache2/bin/apachectl stop
sudo rm -rf /usr/local/apache2
rm -rf httpd-2.4.51
By following this tutorial, you have learned how to install and uninstall a Linux source package using Apache HTTP Server as an example. This method can be applied to other software packages when you need the latest features or custom configuration options not available in the pre-built packages. Keep in mind that installing from source requires more time and effort compared to using package managers, and you'll need to manually manage updates and dependencies.