-1

I hosted multiple websites on a single VPS server, with single IP address when I entered IP address in as url it shows default website page that fine

but i hosted multiple website in a single server by creating different directories for each domain
and hosted

eg1.com at- /var/www/eg1.com

eg2.com at- /var/www/eg2.com

eg3.com at- /var/www/eg3.com

it's wont work in this wa - ip/var/www/eg1.com

how can I access my website eg1.com, eg2.com, eg3.com using my IP address I want to check website status before changing the DNS

please guys this default answer by editing hosts file in drivers, is not the solution for accessing multiple site form the same ip address

#   129.0.0.2       eg1.com

as this address only one website

Hosted multiple websites in a single ip address server. and have to access multiple site

bhv
  • 99
  • 2
  • Hi @hbruijn as i hosted multiple websites on a single server, think this is not a duplicate question. i didn't get the solution from the answers what you marked as duplicate. – bhv Aug 14 '16 at 02:19
  • 1
    you can add all of the hosts names after the IP address in your host file: `1.2.3.4 eg1.com eg2.com eg3.com` – David Aug 14 '16 at 04:57
  • @David did you mean myip_address/eg1.com , its not working – bhv Aug 14 '16 at 11:03
  • 1
    IP address followed by the names all on one line with spaces or tabs between them. This will work exactly the same as changing the DNS entry except it is local to the computer with the host file (the computer you are testing from). – David Aug 14 '16 at 17:01
  • @David can you make this as an answer so that viewers can find the answer easily – bhv Sep 08 '16 at 02:49

2 Answers2

2

I can't mark an answer as a duplicate or comment yet so this'll have to go in as an answer.

This question has already been answered here:

How do I "test" name-based virtual hosting?

In summary, you can edit your hosts file to point a name at the IP address. This should let the name based configuration respond to the correct host name.

The other option is to use curl with the parameters provided in the link.

nelgin
  • 89
  • 1
  • 3
1

As mentioned in answer above, you can change hosts file on your computer. Great guild: http://www.howtogeek.com/howto/27350/beginner-geek-how-to-edit-your-hosts-file/

Also, my favourite for quick website check on new/test/dev server: http://propagationproxy.com/

Enter domain name in first box and IP of new server in second and there you are!

RonanW.
  • 429
  • 2
  • 7