Hi,
im running an Ubuntu Server 18.04 with Apache2 and MySQL, running 2 domains. storage.mydomain.com and cloud.mydomain.com
However, when i activate the domain cloud.mydomain.com i cannot open storage.mydomain.com cause it opens the nextcloud website instead of where the vhost says it should go.
Here are my VHost Settings, maybe someone knows why this happens:
cloudmydomaincom
<IfModule mod_ssl.c>
<VirtualHost cloudmydomaincom:443>
ServerName cloudmydomaincom
<IfModule mod_headers.c>
Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains"
</IfModule>
<IfModule mod_env.c>
# Add security and privacy related headers
Header unset Server
Header always unset X-Powered-By
Header unset X-Powered-By
Header unset X-CF-Powered-By
Header unset X-Mod-Pagespeed
Header unset X-Pingback
Header set X-Content-Type-Options "nosniff"
Header set X-XSS-Protection "1; mode=block"
Header set X-Robots-Tag "none"
Header set X-Download-Options "noopen"
Header set X-Permitted-Cross-Domain-Policies "none"
Header set Referrer-Policy "no-referrer"
SetEnv modHeadersAvailable true
</IfModule>
DocumentRoot /var/www/html/nextcloud
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/html/nextcloud/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/cloudmydomaincom.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/cloudmydomaincom.access.log combined
SSLCertificateFile /etc/letsencrypt/live/cloudmydomaincom/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/cloudmydomaincom/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
</IfModule>
storagemydomaincom
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerAdmin info@storagemydomaincom
DocumentRoot /var/www/storage
ServerName storagemydomaincom
ServerAlias storagemydomaincom
<FilesMatch \.php$>
SetHandler "proxy:unix:/var/run/php/php7.2-fpm.sock|fcgi://localhost/"
</FilesMatch>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
Alias /alias /var/www/storage/alias
<Directory /var/www/storage/alias>
DAV On
AuthType Digest
AuthName "alias"
AuthUserFile /etc/apache2/users.password
Require valid-user
RewriteEngine off
</Directory>
RewriteEngine on
RewriteCond %{SERVER_NAME} =storagemydomaincom
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
SSLCertificateFile /etc/letsencrypt/live/storagemydomaincom/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/storagemydomaincom/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
</IfModule>