NameVirtualHost *:8081
ServerName 192.168.0.2:8080
ServerAdmin admin@xundahost.cn
DocumentRoot "/home/www/mengxiang/"
ErrorLog "/var/log/apache2/edunuke_errors.log"
CustomLog "/var/log/apache2/edunuke_accesses.log" common
ServerName 192.168.0.2:8081
ServerAdmin admin@xundahost.cn
DocumentRoot "/home/www/mengxiang/"
ErrorLog "/var/log/apache2/edunuke_errors.log"
CustomLog "/var/log/apache2/edunuke_accesses.log" common
这是根据不同端口的两个服务器。
如果是两个域名的(端口可以自己定):
NameVirtualHost www.domain1.com:80
NameVirtualHost www.domain2.com:80
ServerName www.domain1.com:80
ServerAdmin admin@xundahost.cn
DocumentRoot "/home/www/mengxiang/"
ErrorLog "/var/log/apache2/edunuke_errors.log"
CustomLog "/var/log/apache2/edunuke_accesses.log" common
ServerName www.domain2.com:80
ServerAdmin admin@xundahost.cn
DocumentRoot "/home/www/mengxiang/"
ErrorLog "/var/log/apache2/edunuke_errors.log"
CustomLog "/var/log/apache2/edunuke_accesses.log" common
记得加监听端口:
Listen 80
Listen 8080
Listen 8081
建议加在port.conf
也可以加在http.conf、apache2.conf