Answer the question
In order to leave comments, you need to log in
Why does Apache2 open only one site at all addresses?
Good afternoon! There is a server with 3 sites, one of which is the main stub for the server, which is displayed when you access the server by IP address.
Stub Settings
<VirtualHost *:80>
ServerName 123.123.123.123 #внешний ip сервера
ServerAdmin [email protected]
DocumentRoot /var/www/default
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
<VirtualHost *:80>
ServerName dom1.site.ru
ServerAdmin [email protected]
DocumentRoot /var/www/site1
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
<VirtualHost *:80>
ServerName dom2.site.ru
ServerAdmin [email protected]
DocumentRoot /var/www/site2
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question