My NEW server IP address is 123.456.789.123
.
Pointing my browser to 123.456.789.123
(http://123.456.789.123
) the server serves me site alpha
.
Now, on the same NEW server I've configured a second site: beta
.
Site beta
is still online served from my OLD server with IP 321.987.654.321
.
So, to reinstall and reconfigure it on the NEW server, I edited my hosts
file this way, so it calls the NEW server when I go to domain beta.com
:
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
123.456.789.123 beta.com www.beta.com
The problem is that when I point my browser to http://www.beta.com
, I see alpha.com
on the New server, the same site I see if I go to http://123.456.789.123
(this is the NEW server).
So, practically, the hosts
file correctly points me to the NEW server, but instead of showing me the site beta.com
, shows me always the site alpha.com
.
On 123.456.789.123
, I have two different vhosts
file: one for alpha
and one for beta
.
This is the vhost
for alpha
:
<VirtualHost *:80>
ServerName alpha.com
ServerAlias www.alpha.com
ServerAdmin [email protected]
DocumentRoot /var/www/alpha.com/public_html
ErrorLog /var/www/alpha.com/log/error.log
CustomLog /var/www/alpha.com/log/access.log combined
<Directory /var/www/alpha.com>
AllowOverride All
</Directory>
</VirtualHost>
This is the vhost
for beta
:
<VirtualHost *:80>
ServerName beta.com
ServerAlias www.beta.com
ServerAdmin [email protected]
DocumentRoot /var/www/beta.com/public_html
ErrorLog /var/www/beta.com/log/error.log
CustomLog /var/www/beta.com/log/access.log combined
<Directory /var/www/beta.com>
AllowOverride All
</Directory>
</VirtualHost>
Any ideas about how can I see the site beta
when pointing my browser (and my hosts
file) to the NEW server?
It seems that the hosts
file simply calls 123.456.789.123
, but without passing the domain I'm asking for and so the server responds with the default one and not with the site I'm asking for: beta.com
.