R

Tutorial How to install Apache from Source on Ubuntu before cPanel starts support for it.

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:
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
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)
Code:
sudo wget -O- <download-link> | tar -zxf -
4. Next go to http://apr.apache.org/download.cgi and copy the link location for Unix Source: apr-1.7.0.tar.gz
Code:
sudo wget -O- <apr-download-link> | tar -zxf -
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
Code:
sudo wget -O- <apr-util-download-link> | tar -zxf -
6. Move the downloaded and extracted apr files to the right location:
Code:
sudo mv apr-<version> httpd-/srclib/apr
7. Move the downloaded and extracted apr-util files to the right location:
Code:
sudo mv apr-util-<version> httpd-/srclib/apr-util
8. Navigate into the httpd directory:
Code:
cd httpd-<version>
9. According to me, this configuration is better than any other. The --prefix is where apache is installed.
Code:
sudo ./configure --prefix=/usr/local/apache2 --enable-mods-shared="reallyall" --enable-mpms-shared="all"
10. Compile the sources:
Code:
sudo make
11. Install the compiled application to your system:
Code:
sudo make install
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
  • Like
Reactions: cPRex
Author
Rajeeva Lochana
Views
6,252
First release
Last update
Rating
0.00 star(s) 0 ratings