Я настраиваю LestEncrypt для домена с поддоменами.Он отлично работает с основным доменом, но не работает со всеми поддоменами.В app2 и app3 SSL не применяется, приложения показывают, что они небезопасны.Для app4 он перенаправляет в корневую папку appui, отображает каталог appui.Как мне применить SSL для поддоменов?
NameVirtualHost xxx.xxx.xxx.xxx
<VirtualHost xxx.xxx.xxx.xxx>
ServerName www.example.com
ServerAlias example.com
DocumentRoot /var/www/html/appui
ServerAdmin contacts@example.com
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
RewriteEngine on
RewriteCond %{SERVER_NAME} =example.com [OR]
RewriteCond %{SERVER_NAME} =www.example.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
<VirtualHost xxx.xxx.xxx.xxx>
ServerName www.schools.example.com
ServerAlias schools.example.com
DocumentRoot /var/www/html/app2
ServerAdmin contacts@example.com
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
RewriteEngine on
RewriteCond %{SERVER_NAME} =www.example.com [OR]
RewriteCond %{SERVER_NAME} =mingle.example.com [OR]
RewriteCond %{SERVER_NAME} =schools.example.com [OR]
RewriteCond %{SERVER_NAME} =example.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
<VirtualHost xxx.xxx.xxx.xxx>
ServerName www.homes.example.com
ServerAlias homes.example.com
DocumentRoot /var/www/html/app3
ServerAdmin contacts@example.com
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
RewriteEngine on
RewriteCond %{SERVER_NAME} =schools.example.com [OR]
RewriteCond %{SERVER_NAME} =www.example.com [OR]
RewriteCond %{SERVER_NAME} =mingle.example.com [OR]
RewriteCond %{SERVER_NAME} =homes.example.com [OR]
RewriteCond %{SERVER_NAME} =example.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
<VirtualHost xxx.xxx.xxx.xxx>
ServerName www.mingle.example.com
ServerAlias mingle.example.com
DocumentRoot /var/www/html/mega/app4
ServerAdmin contacts@example.com
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
RewriteEngine on
RewriteCond %{SERVER_NAME} =example.com [OR]
RewriteCond %{SERVER_NAME} =mingle.example.com [OR]
RewriteCond %{SERVER_NAME} =www.example.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>