Chi.C.J.Rajeeva Lochana

How to install Apache, PHP, and MySQL 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:


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