Installing Apache by Compiling the Source Code
|
Software Version |
Whether to Support CentOS 7.6 |
Whether to Support CentOS 8.1 |
Whether to Support openEuler 20.03 (LTS-SP1) |
|---|---|---|---|
|
Apache httpd 2.4.39 |
Yes |
Yes |
Yes |
- Obtain the Apache source code.
- Download the source code from the local browser.
Download address: https://archive.apache.org/dist/httpd/httpd-2.4.39.tar.bz2
- Upload the source package to the /home directory on the server.
If the server is connected to the Internet, run the wget command to download the source code.1 2
cd /home wget https://archive.apache.org/dist/httpd/httpd-2.4.39.tar.bz2 --no-check-certificate
- Download the source code from the local browser.
- Decompress the Apache installation package.
1 2
cd /home/ tar -xvf httpd-2.4.39.tar.bz2

- Go to the httpd-2.4.39 directory and view files in it.
1 2
cd /home/httpd-2.4.39/ ls

- Configure Apache.
1./configure --build=arm --prefix=/usr/local/apache2 --enable-so --with-mpm=worker
- --prefix=PATH: specifies the Apache installation directory.
- --with-mpm=worker: specifies the Apache working mode.
- Perform compilation.
1make -j60-j60 leverages the multi-core CPUs to speed up the compilation.

- Start the installation.
1make install
- View the installation directory.
1ls /usr/local/apache2 - View the version.
1/usr/local/apache2/bin/apachectl -v
Parent topic: Installing Apache