different sites get mixed up - due to local hosts file fudge?

Discussion in 'Installation/Configuration' started by tfboy, Dec 21, 2013.

  1. tfboy

    tfboy Member

    Can only access one site

    I'm experimenting with setting up different websites for different potential customers.

    As I haven't actually set up the domains through a registrar, I'm creating "fake" domains in ispconfig and then using my local hosts file to direct to the server where ispconfig is installed.

    This appears to work, but as soon as I start having more than one site, they get mixed up and point to other sites.

    For example, ISP Config is running on a VPS on the internet with ip address
    I have bodged my local hosts file to it says:
    Code:	test1.local	test2.local
    I then set up a Wordpress blog in test1.local/testblog/
    Then I set up another Wordpress blog in test2.local/

    However, when I go to test2.local/, instead of getting the blog of test2, I get the default webpage which is in fact the one of test1.local website. I can do http://test2.local/testblog and it works, showing the content of the test1.local website.

    I'm hoping this is a glitch because I've cheated and don't have fully registered domains, relying on my local hosts file to work. But I'm concerned of course that it's not a glitch and something I have wrong in my setup. I don't really want to migrate live domain names across to my ispconfig setup unless I'm confident they're not going to redirect to each other.


    Many thanks
    Last edited: Dec 21, 2013
  2. tfboy

    tfboy Member

    Ahhhh. I think I've found the cause and it's a configuration error: Apache2 shows the following in the logs:
    VirtualHost overlap on port 80, the first has precedence
    which is the behaviour I'm getting.

    Problem has been fixed: I uncommented the "NameVirtualHost *:80" in the /etc/apache2/ports.conf

    I also edited the thread title so it's clearer and might help in the future.
    Last edited: Dec 21, 2013

Share This Page