Hi!
Preface: Sorry about the spaces and commas in the links, the forum wonāt let me add links to the post because Iām a new user (strange rule, if you ask meā¦)
Iām using NextCloud 14 with Apache2 webserver. If Iām trying to access NextCloud through the default address (https: // mydomain,com/nextcloud), everything is fine.
But I want to make a change and access it through a subdomain (https: // nextcloud,mydomain,com/). Iāve created the subdomain and the Apache virtual host and it seems to work, but NextCloud is unable to stomach the fact that itās being accessed through the subdomain and gives āInternal Server Errorā at the login page (https: // nextcloud,mydomain,com/login).
Do I need to make some configuration changes in NextCloud itself to make it run from the subdomain?
Here is my /var/www/html/nextcloud/config/config.php:
<?php
$CONFIG = array (
'instanceid' => 'EDITED',
'passwordsalt' => 'EDITED',
'secret' => 'EDITED',
'trusted_domains' =>
array (
0 => 'localhost',
1 => 'mydomain.com',
2 => 'nextcloud.mydomain.com',
),
'datadirectory' => '/path/nextcloud',
'dbtype' => 'mysql',
'version' => '14.0.3.0',
'overwrite.cli.url' => 'https: // mydomain,com/ nextcloud',
'htaccess.RewriteBase' => '/nextcloud',
'dbname' => 'nextcloud',
'dbhost' => 'localhost:443',
'dbport' => '',
'dbtableprefix' => 'oc_',
'dbuser' => 'EDITED',
'dbpassword' => 'EDITED',
'installed' => true,
'mail_smtpmode' => 'smtp',
'mail_smtpauthtype' => 'LOGIN',
'mail_smtpauth' => 1,
'mail_from_address' => 'NextCloud',
'mail_domain' => 'mydomain.com',
'mail_smtphost' => 'smtp.gmail.com',
'mail_smtpport' => '587',
'mail_smtpname' => 'EDITED',
'mail_smtppassword' => 'EDITED',
'mail_smtpsecure' => 'tls',
'memcache.local' => '\\OC\\Memcache\\APCu',
'maintenance' => false,
);
Also here is the Apache virtual host config:
Alias /nextcloud "/var/www/html/nextcloud/"
<Directory /var/www/html/nextcloud/>
Options +FollowSymlinks
AllowOverride All
Satisfy Any
<IfModule mod_dav.c>
Dav off
</IfModule>
SetEnv HOME /var/www/html/nextcloud
SetEnv HTTP_HOME /var/www/html/nextcloud
</Directory>
Redirect 301 /.well-known/carddav https: // mydomain,com/nextcloud/remote.php/dav
Redirect 301 /.well-known/caldav https: // mydomain,com/nextcloud/remote.php/dav
<VirtualHost *:80>
ServerAdmin admin@mydomain.com
ServerName nextcloud.mydomain.com
DocumentRoot /var/www/html/nextcloud
Redirect / https: // nextcloud,mydomain,com/
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerAdmin admin@mydomain.com
ServerName nextcloud.mydomain.com
DocumentRoot /var/www/html/nextcloud
<IfModule mod_headers.c>
Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains; preload"
</IfModule>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
SSLCertificateFile /path/fullchain.pem
SSLCertificateKeyFile /path/privkey.pem
</VirtualHost>
</IfModule>
Iām using Ubuntu 18.04.