У меня 2 сайта. Site1.com и Site2.com (примеры)
Когда я посещаю http://site2.com и https://site2.com Он работает как задумано, но когда я открываю www*1010*. Site2.com Я вижу содержимое сайта 1 .com
Используемые команды
sudo a2ensite site1.com.conf
sudo a2ensite site2.com.conf
sudo a2dissite 000-default.conf
sudo systemctl restart apache2
My apache vhosts.
site2.com.conf
<VirtualHost *:80>
AllowEncodedSlashes On
ServerName Site2.com
ServerAlias www.Site2.com
DocumentRoot /var/www/php74/Site2
Protocols h2 h2c http/1.1
<Directory /var/www/php74/Site2>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
<FilesMatch \.php$>
# Apache 2.4.10+ can proxy to unix socket
SetHandler "proxy:unix:/var/run/php/php7.4-fpm.sock|fcgi://localhost"
</FilesMatch>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<IfModule mod_dir.c>
DirectoryIndex index.php index.pl index.cgi index.html index.xhtml index.htm
</IfModule>
RewriteCond %{SERVER_NAME} =www.Site2.com [OR]
RewriteCond %{SERVER_NAME} =Site2.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
<VirtualHost *:443>
ServerName Site2.com
ServerAlias www.Site1.com
AllowEncodedSlashes On
DocumentRoot /var/www/php74/Site2
Protocols h2 h2c http/1.1
<Directory /var/www/php74/Site2>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
<FilesMatch \.php$>
# Apache 2.4.10+ can proxy to unix socket
SetHandler "proxy:unix:/var/run/php/php7.4-fpm.sock|fcgi://localhost"
</FilesMatch>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<IfModule mod_dir.c>
DirectoryIndex index.php index.pl index.cgi index.html index.xhtml index.htm
</IfModule>
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/Site2.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/Site2.com/privkey.pem
RewriteCond %{SERVER_NAME} =www.Site2.com [OR]
RewriteCond %{SERVER_NAME} =Site2.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
site1.com.conf
<VirtualHost *:80>
AllowEncodedSlashes On
ServerName Site1.com
ServerAlias www.Site1.com
DocumentRoot /var/www/php74/Site1
Protocols h2 h2c http/1.1
<Directory /var/www/php74/Site2>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
<FilesMatch \.php$>
# Apache 2.4.10+ can proxy to unix socket
SetHandler "proxy:unix:/var/run/php/php7.4-fpm.sock|fcgi://localhost"
</FilesMatch>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<IfModule mod_dir.c>
DirectoryIndex index.php index.pl index.cgi index.html index.xhtml index.htm
</IfModule>
RewriteCond %{SERVER_NAME} =www.Site1.com [OR]
RewriteCond %{SERVER_NAME} =Site1.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
<VirtualHost *:443>
ServerName Site1.com
ServerAlias www.Site1.com
AllowEncodedSlashes On
DocumentRoot /var/www/php74/Site1
Protocols h2 h2c http/1.1
<Directory /var/www/php74/Site1>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
<FilesMatch \.php$>
# Apache 2.4.10+ can proxy to unix socket
SetHandler "proxy:unix:/var/run/php/php7.4-fpm.sock|fcgi://localhost"
</FilesMatch>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<IfModule mod_dir.c>
DirectoryIndex index.php index.pl index.cgi index.html index.xhtml index.htm
</IfModule>
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/Site1.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/Site1.com/privkey.pem
RewriteCond %{SERVER_NAME} =www.Site2.com [OR]
RewriteCond %{SERVER_NAME} =Site2.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
Я не могу найти причину проблемы, так как vhost мне кажется нормальным