Nextcloud version:12.0.0
Operating system and version: Ubuntu 16.04
Apache or nginx version: Apache 2.4.18
PHP version: 7.0.18
Mysql version: MariaDB 10.1.25
Is this the first time you’ve seen this error?:
Not really an error, but yes it is (my first time trying to fix a Nextcloud server with LDAP)
Can you reliably replicate it? (If so, please outline steps):
Yes, I can replicate it (Created a test machine with Nextcloud (clean one) and still get’s the same problem)
The issue you are facing:
So… When I’m configuring LDAP it takes around 10 miniutes for it to check if everything is okey, and around 10 min for it to save.
When I after get it to work (Everything OK) and trying to check for all the users, it takes another 10 min for it to load. and you can forget to login to an account from LDAP where it will take around 20 min for it to login and isn’n really acceptable to have it like that in a running environment where over 100 people will use it (Got 6 account that is LDAP at the moment).
Local account don’t face this issue at all, you can login to them instantly without a trace of the same issue as LDAP accounts.
Side note:
Before I enchanced the Nextcloud server with Opcache it tooke it around 10-20 min to just open the browser window for my Nextcloud Client if the LDAP option was enabled.
The output of your Nextcloud log in Admin > Logging:
How do you want the log, mine was to big.
The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):
I don’t know what your problem is. Maybe a network issue. How is the connection working with local ldapsearch command? A side from that, ldap works flawless and fast on my setup which is pretty much the same as yours.
The thing is that it seems like the LDAP config slows down my whole machine (in the browser) when it’s enabled.
we have tried with ldapsearch from the machine (not browser) and it works perfect with no delay or anything, but as soon it’s in the browers, it take ages.
cd /tmp
curl -LO https://download.nextcloud(.)com/server/releases/nextcloud-<version>.tar.bz2
rm nextcloud-<version>.tar.bz2.sha256
Install NextCloud
sudo tar -C /var/www -xvjf /tmp/nextcloud-<version>.tar.bz2
sudo vim /tmp/nextcloud.sh
#!/bin/bash
ocpath='/var/www/html/nextcloud'
htuser='www-data'
htgroup='www-data'
rootuser='root'
printf "Creating possible missing Directories\n"
mkdir -p $ocpath/data
mkdir -p $ocpath/assets
mkdir -p $ocpath/updater
printf "chmod Files and Directories\n"
find ${ocpath}/ -type f -print0 | xargs -0 chmod 0640
find ${ocpath}/ -type d -print0 | xargs -0 chmod 0750
chmod 755 ${ocpath}
printf "chown Directories\n"
chown -R ${rootuser}:${htgroup} ${ocpath}/
chown -R ${htuser}:${htgroup} ${ocpath}/apps/
chown -R ${htuser}:${htgroup} ${ocpath}/assets/
chown -R ${htuser}:${htgroup} ${ocpath}/config/
chown -R ${htuser}:${htgroup} ${ocpath}/data/
chown -R ${htuser}:${htgroup} ${ocpath}/themes/
chown -R ${htuser}:${htgroup} ${ocpath}/updater/
chmod +x ${ocpath}/occ
printf "chmod/chown .htaccess\n"
if [ -f ${ocpath}/.htaccess ]
then
chmod 0644 ${ocpath}/.htaccess
chown ${rootuser}:${htgroup} ${ocpath}/.htaccess
fi
if [ -f ${ocpath}/data/.htaccess ]
then
chmod 0644 ${ocpath}/data/.htaccess
chown ${rootuser}:${htgroup} ${ocpath}/data/.htaccess
fi
EXECUTE THE SCRIPT:
sudo bash /tmp/nextcloud.sh
sudo VIM /etc/apache2/sites-available/nextcloud.conf
CONFIGURE THAT FILE:
Alias /nextcloud "/var/www/html/nextcloud/"
<Directory /var/www/html/nextcloud/>
Options +FollowSymlinks
AllowOverride All
<IfModule mod_dav.c>
Dav off
</IfModule>
SetEnv HOME /var/www/html/nextcloud
SetEnv HTTP_HOME /var/www/html/nextcloud
</Directory>
sudo a2ensite nextcloud
sudo a2enmod rewrite
sudo apt-get update
sudo apt-get install -y php-bz2 php-curl php-gd php-imagick php-intl php-mbstring php-xml php-zip
sudo systemctl reload apache2
Creating a MySQL Database for NextCloud
LOGIN TO THE SQL
mysql -u root -p
CREATE A DATABASE
CREATE DATABASE nextcloud;
CREATE AN USER AND GIVE PERMISSIONS FOR nextcloud:
GRANT ALL ON nextcloud.* to 'nextcloud'@'localhost' IDENTIFIED BY 'set_database_password';
FLUSH THE PRIVILEGES THEN EXIT
FLUSH PRIVILEGES;
EXIT;
Unsure, but afaik LDAP is synced to Nextcloud so there is a local cache. I don’t know how it works in detail though. Many bigger companies use LDAP just fine so I’m unsure if LDAP is the culprit.
I’d take a look at your configuration for searching users, mabe its bonkers
We found what was wrong now. Our FW’s had double DNS posters to the LDAP server which made the request slow. LDAP is working lika a charm now. Closing this thread now.