Answer the question
In order to leave comments, you need to log in
How to run a website on a second machine?
Hello.
Need help.
I have one static ip, several sites hang on it, for example site1.ru and site2.ru, the machine is behind the router and for it to open port 80 to the local address 192.168.1.2 - everything works fine.
The question
is how to configure Apache so that site2.ru works on the second machine, for example, it will have a local ip 192.168.1.4?
In general, you need to divide sites into several machines with one static ip.
Answer the question
In order to leave comments, you need to log in
Apache has no problems with this, the
separation is not based on IP (well, if you didn’t want it forcibly)
But on the header
In fact, any number of sites can hang on one port and one IP and this will not interfere with Apache.
Just create configs in the virtual host, specify the name of the site and not its ip.
This will be enough.
<Directory /var/www/site2.ru>
</Directory>
<VirtualHost site.ru:80>
.......
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question