Hello Im having an issue on configuring nextcloud with ssl certificate:
Nextcloud version _19.0.3
Operating system and version _Ubuntu 20.04
Apache _Apache 2.4.25
PHP version _7.4
I was able to install and configure it correctly, below find the vhost config:
path: /etc/apache2/sites-available/nextcloud.conf
<VirtualHost *:80>
DocumentRoot "/var/www/nextcloud"
ServerName adf.projectcloud.site
ServerAlias www.adf.projectcloud.site
ServerAdmin adf.contracts@gmail.com
ErrorLog ${APACHE_LOG_DIR}/nextcloud.error
CustomLog ${APACHE_LOG_DIR}/nextcloud.access combined
<Directory /var/www/nextcloud/>
Require all granted
Options FollowSymlinks MultiViews
AllowOverride All
<IfModule mod_dav.c>
Dav off
</IfModule>
SetEnv HOME /var/www/nextcloud
SetEnv HTTP_HOME /var/www/nextcloud
Satisfy Any
</Directory>
RewriteEngine on
RewriteCond %{SERVER_NAME} =adf.projectcloud.site [OR]
RewriteCond %{SERVER_NAME} =www.adf.projectcloud.site
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
The Rewrite was added after installing ssl. So After Installing the ssl with lets encrypt my site was broken:
path: /etc/apache2/sites-available/nextcloud-le-ssl.conf
<IfModule mod_ssl.c>
<VirtualHost *:443>
DocumentRoot "/var/www/nextcloud"
ServerName adf.projectcloud.site
ServerAlias www.adf.projectcloud.site
ServerAdmin adf.contracts@gmail.com
ErrorLog ${APACHE_LOG_DIR}/nextcloud.error
CustomLog ${APACHE_LOG_DIR}/nextcloud.access combined
<Directory /var/www/nextcloud/>
Require all granted
Options FollowSymlinks MultiViews
AllowOverride All
<IfModule mod_dav.c>
Dav off
</IfModule>
SetEnv HOME /var/www/nextcloud
SetEnv HTTP_HOME /var/www/nextcloud
Satisfy Any
</Directory>
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/adf.projectcloud.site/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/adf.projectcloud.site/privkey.pem
</VirtualHost>
</IfModule>
The issue im facing:
The site doesnt respond after installing ssl. I am new in Linux System so please can u help me to solve these problem. I am hosting app on my own server.
The output of config.php file in /var/www/nextcloud/config/config.php
<?php
$CONFIG = array (
'instanceid' => '',
'passwordsalt' => '',
'secret' => '',
'trusted_domains' =>
array (
0 => 'adf.projectcloud.site',
),
'datadirectory' => '/var/www/nextcloud/data',
'dbtype' => 'mysql',
'version' => '19.0.3.1',
'overwrite.cli.url' => 'http://adf.projectcloud.site',
'dbname' => 'nextcloud',
'dbhost' => 'localhost',
'dbport' => '',
'dbtableprefix' => 'oc_',
'mysql.utf8mb4' => true,
'dbuser' => 'user',
'dbpassword' => 'password',
'installed' => true,
'allow_local_remote_servers' => true,
'ldapIgnoreNamingRules' => false,
'ldapProviderFactory' => 'OCA\\User_LDAP\\LDAPProviderFactory',
);
Thanx in advance.