Open the Apache configuration file httpd. conf, for example,/etc/httpd/conf/httpd by default. conf # vi/etc/httpd/conf/httpd. conf adds the following virtual machine configurations to httpd. the end of the conf file can be NameVirtualHost *: 80 & nbsp
Open the Apache configuration file httpd. conf, for example,/etc/httpd/conf/httpd. conf by default.
# Vi/etc/httpd/conf/httpd. conf
Add the following virtual machine configurations to the end of the httpd. conf file.
NameVirtualHost *: 80 // Note: This line has the # number by default. remember to remove it.
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# Match a ServerName or ServerAlias in any block.
# ServerAdmin admin@centoscn.com
ServerAdmin admin@centoscn.com
DocumentRoot/var/www/html/centos
ServerName www.centoscn.com
ServerAlias www.centoscn.com
ErrorLog logs/centoscn.com-error_log
CustomLog log/centoscn.com-access_log common
ServerAdmin admin@gamekey.com.cn
DocumentRoot/var/www/html/gamekey.com.cn
ServerName www.gamekey.com.cn
ServerAlias www.gamekey.com.cn
ErrorLog logs/gamekey.com.cn-error_log
CustomLog logs/gamekey.com.cn-access_log common