Parameter Configuration
- Modify the httpd.conf file.
- Open the file.
1vim /usr/local/apache2/conf/httpd.conf
If you install Apache in RPM mode on CentOS 8.1, the file path is /etc/httpd/conf/httpd.conf.
- Modify the following content:
- Change the listen port number in line 52 to 80.
Listen 0.0.0.0:80
- Delete the comment tag (#) from line 89.
- If you install Apache in RPM mode on CentOS 8.1, this code is in line 92.
LoadModule socache_shmcb_module modules/mod_socache_shmcb.so
- In line 198, change ServerName to the actual server IP address and port number.
You can run the ip a or ifconfig command to query the server IP address.
- If you install Apache in RPM mode on CentOS 8.1, this code is in line 221.
ServerName IP:80
- Delete the comment tag (#) from line 463.
If you install Apache in RPM mode on CentOS 8.1, this code is in line 486.
Include conf/extra/httpd-mpm.conf
- Delete the comment tag (#) from line 490.
- If you install Apache in RPM mode on CentOS 8.1, this code is in line 513.
Include conf/extra/httpd-default.conf
- Change the listen port number in line 52 to 80.
- Press Esc, type :wq!, and press Enter to save the file and exit.
- Open the file.
- Modify the httpd-default.conf file.
- Open the file.
1vim /usr/local/apache2/conf/extra/httpd-default.conf
If you install Apache in RPM mode on CentOS 8.1, the file path is /etc/httpd/conf/extra/httpd-default.conf.
- Modify the following content:
Change the value of MaxKeepAliveRequests in line 23 to 0.
MaxKeepAliveRequests 0
- Press Esc, type :wq!, and press Enter to save the file and exit.
- Open the file.
Parent topic: Running and Verifying Apache