Domain name management resolution items such as: Cy.wanggangg.top for wanggangg.top domain name add resolution host record set to CY record value for server IP address
Open Apache configuration file
Added as follows:
<virtualhost *:80>
ServerAdmin [email protected]
Documentroot/webdata/cy
ServerName Cy.wanggangg.top
Serveralias Cy.wanggangg.top
Errorlog "/var/log/httpd/cy.wanggangg.top-error.log"
Customlog "/var/log/httpd/cy.wanggangg.top.log" common
</VirtualHost>
The meaning of each parameter:
ServerAdmin Admin Mailbox
DocumentRoot pointing to the server subdirectory path
ServerName alias, you can set multiple aliases to point to the current directory, you can also do not fill in the alias
Errorlog Error Log save location
Customlog Access Log Save location
Restart Apache Service
Access the subdomain to verify that the resolution configuration is successful! (It is recommended to wait 10 minutes, the domain name resolution needs to take effect this time)
Two level domain name resolution settings and Apache subdomain configuration