E
E
Evgeny Ivanov2016-12-12 13:54:41
Apache HTTP Server
Evgeny Ivanov, 2016-12-12 13:54:41

How to bind two domains to different folders on a web server?

There are vps (time4vps) and there are 2 domains (jino).
On the Debian 7 server, apache + muscle + php is up .... The server has one ip. Full access to the server (root).
In the registrar panel, you can change dns records, add - standard functionality.
In general, full access to everything.
On the server, there are several folders in the /var/www folder.
How to bind two domains to different folders on a web server? So that when entering one domain, the user gets into one folder, and when entering another, into another?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
Max, 2016-12-12
@logpol32

it's called VirtualHost. Configure in /etc/apache2/sites-available

R
Ruslan Fedoseev, 2016-12-12
@martin74ua

virtual hosts

A
axeax, 2016-12-12
@axeax

apache conf

Listen 80
<VirtualHost *:80>
    DocumentRoot "./var/www/domain1"
    ServerName www.domain.ru
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot "/var/www/domain2"
    ServerName www.domain2.ru
</VirtualHost>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question