我有两个虚拟主机在同一台服务器上运行(IP 地址:123.123.123.123):
虚拟主机 1:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName 123.123.123.123
DocumentRoot "/home/webmaster/development/myNEWsite.co.uk/user/htdocs"
ErrorLog "/home/webmaster/development/myNEWsite.co.uk/logfiles/error_log"
CustomLog "/home/webmaster/development/myNEWsite.co.uk/logfiles/access_log" common
<Directory "/home/webmaster/development/myNEWsite.co.uk/user/htdocs/">
AllowOverride All
</Directory>
</VirtualHost>
和虚拟主机 2:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName temp.co.uk
DocumentRoot "/home/webmaster/development/temp"
ErrorLog "/home/webmaster/development/temp/error_log"
CustomLog "/home/webmaster/development/temp/access_log" common
<Directory "/home/webmaster/development/temp">
AllowOverride All
</Directory>
</VirtualHost>
当我访问 www.temp.co.uk 时,它会显示“temp”网站(这就是我想要的),但是当我想要访问“myNEWsite”时,http://123.123.123.123/
它仍然会显示“temp”网站。
如何获取服务器的实际 IP 地址以显示我正在构建的新站点?