Answer the question
In order to leave comments, you need to log in
How to properly configure apache on 2 domains?
Generally there are 2 domains. I add the following code to httpd.conf
<VirtualHost domen1.ru:80>
ServerName domen1.ru
DocumentRoot /var/www/domen1.ru
</VirtualHost>
<VirtualHost domen2.ru:80>
ServerName domen2.ru
DocumentRoot "/var/www/html"
</VirtualHost>
Answer the question
In order to leave comments, you need to log in
NameVirtualHost abcd:80
< VirtualHost abcd:80>
ServerName domen1.ru
...
< /VirtualHost>
< VirtualHost abcd:80>
ServerName domen2.ru
...
< /VirtualHost>
you would read the logs of the server, it obviously complains to you about that that domains overlap each other
And it’s better not to call virtual hosts by domain name, but by address
Ruslan Fedoseev : tell me more if it's not difficult. And if I need domen2.ru to still be visible via https. I add code like this
<VirtualHost domen2.ru:443>
ServerName domen2.ru
DocumentRoot /var/www/html
SSLEngine on
SSLCertificateFile /etc/pki/tls/certs/domen2_ru.crt
SSLCertificateKeyFile /etc/pki/tls/private/ca.key
</VirtualHost>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question