Apache Optimization:
Modify configuration file: httpd.conf
The version number is not displayed:
Description: In general, the use of site points, advantages: security
Port-based virtual Host: (Add a listening port in the following two profiles)
Master configuration file:/application/apache/conf/httpd.conf
Extension Profile:/application/apache/conf/extra/httpd-vhosts.conf
:/listen
1. Use the Vim editor to search for listen and add ports below listen 80
2. Then return to the virtual host profile of the site before you configure it
PS: If you are adding a site to the master profile, return to the main profile httpd.conf
Similarly, if the site configuration is in the extension configuration file, return to the httpd-vhosts.conf
The following is an example of a httpd-vhosts.conf file: (need to add port name and assign port)
:/namevirtualhost *:80
Search for Namevirtualhost, and add the previously configured listening port information (adding port name) below
Then assign the port to the desired site: (Assigning a port number to the site)
After configuration,: Wq Save and exit,
Then check the syntax and restart the Apache service
/application/apache/bin/apachectl-t
/application/apache/bin/apachectl Graceful
To configure a virtual host based on an IP address
Configure an IP alias: (The following settings take effect temporarily)
Ifconfig eno16777736:0 172.17.0.111/24 up
Modify a site profile vim httpd-vhosts.conf
Use the # number to comment out the previously configured port line.
3. Assign the IP address to the specified site and restore the listening port to: 80
4. Last: Wq Save and exit, check syntax and restart Apache
5. Enter the IP address in the browser to see if the site is configured successfully.
Apache configuration for Port/IP-based virtual hosts