Installing Apache by Using a Script
|
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 |
No |
CentOS 7.6
- Obtain the Apache script package.
- Download the script package using the local browser.
Download address: https://mirrors.huaweicloud.com/kunpeng/archive/kunpeng_solution/web/Scripts/apache_automation.tar.gz
- Save the script package to the /home directory.
If the server can access the Internet, you can run the wget command on the server to download the script package.
1 2
cd /home wget https://mirrors.huaweicloud.com/kunpeng/archive/kunpeng_solution/web/Scripts/apache_automation.tar.gz --no-check-certificate
- Download the script package using the local browser.
- Decompress the script package.
1 2
cd /home/ tar -xzvf apache_automation.tar.gz

- Go to the apache_automation directory and run the ll command to view the files in the directory.
1 2
cd apache_automation ll

Table 1 describes the overall script directory structure.
Table 1 Overall script directory structure Directory
Description
deps
Directory used for compilation and installation.
NOTE:The installation script first obtains the Apache source code using the wget command. If the server is not connected to the Internet, download the Apache source code (see Installing Apache by Compiling the Source Code) and save the source code to this directory.
scripts
Optimization script directory, which contains common optimization scripts.
install.sh
Script used to compile, deploy, and tune Apache.
rollback.sh
Rollback script, which is used to roll back all operations of the script.
- Run the install.sh script. After the script is executed, restart the device for the optimization to take effect.
1sh install.sh
If the environment needs to be rolled back or the deployment using a script fails, run the rollback script to roll back the script operation and restart the device.
1sh rollback.sh
CentOS 8.1
- Obtain the Apache one-click installation script package.
- Download the script package using the local browser.
https://repo.huaweicloud.com/kunpeng/archive/kunpeng_solution/web/Scripts/httpd-2.4.39-install.sh
- Upload the script package to the /home directory on the server.
If the server is connected to the Internet, run the wget command to download the Apache installation script package.
1 2
cd /home wget https://repo.huaweicloud.com/kunpeng/archive/kunpeng_solution/web/Scripts/httpd-2.4.39-install.sh --no-check-certificate
- Download the script package using the local browser.
- Execute the script.
sh httpd-2.4.39-install.sh

- View the installation directory.
ls /usr/local/apache2
