0
votes

i have apache configured with tomcat with two virtual hosts

<Host name="site1.com" appBase="/site1".../>

<Host name="site2.com" appBase="/site2".../>

Now site1 query data from site2 using http and both are on the same server. is there a way to make site1 query site2 using localhost or 127.0.0.1 IP? will 127.0.0.1:8080/site2 work?

1

1 Answers

1
votes

When you use virtual hosts, you will have to connect to the server using a host-name, and not the numeric IP.

If you want to access site2 on 127.0.0.1, you will make sure that "site2.com" resolves to 127.0.0.1 (on that machine).

An easy way of doing this on a single machine, can be to edit your /etc/hosts-file and simply add an entry that says "site2.com" has IP-address 127.0.0.1.