First of all, this is only useful if you want to know more about how programs work, and it might help you if you want to use an OS, which is not supported by cPanel, like for example, Ubuntu is not yet supported by cPanel but, going to be supported in the future, which was mentioned in this blog post here: Cent OS 8 End-of-Life Announcement | cPanel Blog.
Be aware that installation might differ depending on your OS install.
Lets first start now:
APACHE
1. Install some required libraries:
2. Navigate to the directory from which we will be compiling apache.
3. In your browser, go to http://httpd.apache.org/download.cgi.
Right click and copy the link location of the link looking like Source: httpd-2.4.46.tar.gz (make sure it ends with .tar.gz)
4. Next go to http://apr.apache.org/download.cgi and copy the link location for Unix Source: apr-1.7.0.tar.gz
5. And lastly Go to http://apr.apache.org/download.cgi and copy the link location for Unix Source: apr-util-1.6.1.tar.gz
6. Move the downloaded and extracted apr files to the right location:
7. Move the downloaded and extracted apr-util files to the right location:
8. Navigate into the httpd directory:
9. According to me, this configuration is better than any other. The --prefix is where apache is installed.
10. Compile the sources:
11. Install the compiled application to your system:
These directories could be altered using different arguments in step 9. (the sudo ./configure command).
The apache directory is /usr/local/apache2.
The apache conf directory is /usr/local/apache2/conf.
The apache main conf file is /usr/local/apache2/conf/httpd.conf.
For more info go to http://httpd.apache.org/docs/current/install.html
Be aware that installation might differ depending on your OS install.
Lets first start now:
APACHE
1. Install some required libraries:
Code:
sudo apt update && sudo apt upgrade -y && sudo apt install libnghttp2 libpcre3 libssl build-essential -y
2. Navigate to the directory from which we will be compiling apache.
Code:
cd /usr/local/src
Right click and copy the link location of the link looking like Source: httpd-2.4.46.tar.gz (make sure it ends with .tar.gz)
Code:
sudo wget -O- <download-link> | tar -zxf -
Code:
sudo wget -O- <apr-download-link> | tar -zxf -
Code:
sudo wget -O- <apr-util-download-link> | tar -zxf -
Code:
sudo mv apr-<version> httpd-/srclib/apr
Code:
sudo mv apr-util-<version> httpd-/srclib/apr-util
Code:
cd httpd-<version>
Code:
sudo ./configure --prefix=/usr/local/apache2 --enable-mods-shared="reallyall" --enable-mpms-shared="all"
Code:
sudo make
Code:
sudo make install
The apache directory is /usr/local/apache2.
The apache conf directory is /usr/local/apache2/conf.
The apache main conf file is /usr/local/apache2/conf/httpd.conf.
For more info go to http://httpd.apache.org/docs/current/install.html