If I set up a web server in a virtual machine, will
127.0.0.1 be the same on both the virtual and the host machine?
Most likely if
/etc/hosts isn't changed on either of them.
Note that 127.0.0.1 is an address given to the loopback interface, i.e it never leaves the machine.
Read more: http://en.wikipedia.org/wiki/Localhost