0

I want to create 2 ip addresses, which every single one leads to a diffrent website, I tried to do it with virtual hosts, but I couldnt configure it the way I want it to work.

I want it to look like this:

(192.168.1.41) goes to var/www/html/sitea/hs.html

(192.168.1.46) goes to var/www/html/siteb/index.html

I tried adding an IP address , with this tutorial, and it worked fine: How can I (from CLI) assign multiple IP addresses to one interface? I can now access my diffrent serverpages on both internal IP addresses.

but I tried to forward the second IP to use it with my external IP, and now when I want to get on my page from the www, it just displays me siteb on both ports.

1
  • Telling the system what site listens where is specific to your web server software. But you can get them to all listen on one IP which makes things easier.
    – Thomas Ward
    Feb 28, 2016 at 23:38

1 Answer 1

-1

I've made it work with giving the virtual host (etc/apache2/sites-enabled) an specific IP like so:

<VirtualHost 192.168.1.41:*>
..
(sitea)
..
<VirtualHost/>

<VirtualHost 192.168.1.46:*>
..
(siteb)
..
<VirtualHost/>

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .