Answer the question
In order to leave comments, you need to log in
How to set VirtualHost in Apache2 which will be used if there is no matching ServerName?
Actually, subject. There is a task to deny access to the site by server IP, the solution of which I implemented through the 0000-direct.conf file with the following content:
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName IP_моего_сервера
Redirect 403 /
DocumentRoot /dev/null
</VirtualHost>
</IfModule>
<VirtualHost *:80>
ServerName IP_моего_сервера
Redirect 403 /
DocumentRoot /dev/null
</VirtualHost>
Answer the question
In order to leave comments, you need to log in
Usually, the config is written based on the following Apache behavior - if there are no hosts that satisfy the condition, then show the first available host.
Accordingly, the first thing in the config is to specify the host on which the stub will be.
From the set of rows of the first table, we subtract the set of rows of the second table and write the result into the third table. In MySQL this is done with a single INSERT ... SELECT SQL statement. But since SQL-command EXCEPT (set difference) is not implemented in MySQL, its emulation is used by the standard technique (described in any textbook) through LEFT JOIN and IS NULL:
INSERT INTO table3
SELECT table1.*
FROM table1
LEFT JOIN table2
ON table1.id = table2.id
WHERE table2.id IS NULL
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question