Page 1 of 1

Cannot access multiple virtual host from host pc's browser

Posted: 28. Nov 2010, 05:04
by feelexit
I have windows 7 as host, and used virutalBox created a Virtual Machine, I installed Ubuntu server 10.04 as guest. the network setting is "Bridged Adapter" not "NAT"

I installed Nginx, php and mysql on the Ubuntu server.

on my windows 7, I modify the "host" file, added this line "192.168.1.100 local.www.test.com"

when I test this web site, it goes to the default site, not the virtual host.

here's my nginx config file.

Code: Select all

server {
    listen 80;
    server_name local.www.test.com;
    access_log /home/feelexit/www/local.www.test.com/log/local.www.test.access$
    error_log /home/feelexit/www/local.www.test.com/log/local.test.error.lo$
    location / {
                root /home/feelexit/www/local.www.test.com/public;
                index index.html index.php;
    }
    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    #
    location ~ \.php$
    {
  fastcgi_pass 127.0.0.1:9000;
  fastcgi_index index.php;
  include /usr/local/nginx/conf/fastcgi_params;
  fastcgi_param SCRIPT_FILENAME /home/feelexit/www/local.www.test.com/public$fa$
    }
}
I pretty sure this config file is fine. is there anything else I have to to make it go to the correct virtual host.

Re: Cannot access multiple virtual host from host pc's browser

Posted: 30. Nov 2010, 23:00
by iamalittlepepper
I think the best is for you to draw out the network layout is currently in relations with the Win7?

Is 192.168.1.* the network segment of Win7?

What is the setting of the Ubuntu network setup? is it also on the 192.168.1.* segment?

AFAIK you should need to add hosts unless you want to resolve domain names, and right now you are just dealing with IP addresses.

I would suggest you deal with the IP addresses and lay it out. If you manually set the Ubuntu guests to the same network segment as your Win7, it should just work with Bridged network (after a reboot to make sure).