R
R
Rosh1ck2016-04-12 09:59:59
linux
Rosh1ck, 2016-04-12 09:59:59

How to set limits for Apache?

Good afternoon.
Please tell a newbie. Installed LAMP on my VDS. Set up CMS and hosted the site. Faced the problem that any other domain directed to the IP address of my VDS displays my site.
From here the question. How to set restrictions in such a way that the content displays only one specific domain, and all the others give an error.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
U
Ulrich, 2016-04-12
@Rosh1ck

You need to use virtual hosts. Google will help with manuals.

R
Rosh1ck, 2016-04-14
@Rosh1ck

The issue was resolved by specifying multiple virtual hosts.
Thanks to all.

V
Victor Taran, 2016-04-12
@shambler81

you have a problem in a virtual host.
To solve it, you really need to go to the admin panel, create a new site by specifying it explicitly and not in the default folder, and then you will be happy.
If not, then you need to do something like this.

RewriteCond %{HTTP_HOST} ^!(www|)\.site\.ru [NC]
RewriteRule ^(.*)$ http://%{HTTP_HOST}/404.php [R=301,L]

Krivanko, of course, but better than nothing.
In general, your problem is that you put the site in a default trap, in fact, any requests go to it like /dev/null only for site requests.
You need to create a separate virtual host with an explicitly specified site, for this, go to the admin panel and create a site.
Most likely you put it in the base folder.
In my opinion, it should be banned altogether.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question