UB 18.04.2 LTS Nextcloud install (SMB and https:// .... config issues)

So linux and me wont be best buds ever …

I Installed Ubuntu Server 18.04.2 LTS and chose to install nextcloud alongside it. It runs fine so far but as a linux noob im facing problems configuring it the “right” way…

  1. Problem:
    Adding SMB Shares is impossible since the “External Storage” tab displays a warning that smbclient is not installed.

Tried to manually install smb client and php-smbclient but that didn’t work.
Even after a reboot i can’t connect to SMB Shares on my network.

I had an owncloud installation where this feature was enabled by default and working ootb. Searching the forum, i found out that this issue is a bug which is not beeing fixed atm?

  1. Problem:
    At the moment nextcloud responds only to http:// … but i want it to redirect to https:// …
    The Helpfiles tell me to configure this inside of the virtual hosts file.
    Im currently unable to locate that file. Every guide i find out there tells me i have to either do it in apache2 or install this service.
    The specified folder etc/apache2/ does not exist?ß Does that impy that apache is ot running?

Since my installation is currently running i would like to know on what webserver it is running currently? nginx ?
The helpfiles only display a portion out of the vitrtualhosts file not the path to the file (not very helpful for us noobs)

If you run ngnix you can check this doku: https://docs.nextcloud.com/server/15/admin_manual/installation/nginx.html

To find out who is your server provider you can check who exposed port 80 (http) and port 443 (https) in your server by command:

netstat -peanut | grep '443\|80'


Then you can find out where is the config of Apache2 by command:

dpkg --listfiles apache2 | grep enabled

image

if you have something else then apache2, try to run without grep: dpkg --listfiles packagename

By the way try to use SMB connection test application https://apps.nextcloud.com/apps/smb_test

You need to fill in a Domain, e.g. IDONTLIKEBUGS
:wink:

1 Like

Thank you:)

Sanok: That is impossible since my nextloud installation displays this error message

"smbclient" is not installed. Mounting of "SMB / CIFS", "SMB / CIFS using OC login" is not possible. Please ask your system administrator to install it.

and won’t even let me choose a SMB share as an option.

I somehow destroyed my installation and while doing so i found out ubuntu must be running apache2…

BUT… /var/www/… does not exist and i can’t control apache2 via service stop/start (etc) since the service is not known

This is not a manual installation of nextcloud… its the ?snap? installation that the ubuntu server dvd offers while installing unbuntu server …

Maybe installing nextcloud that way si not the best way?

Working installation:

dpkg --list|grep 'smb\|samba'

ii  libsmbclient:amd64                    2:4.7.6+dfsg~ubuntu-0ubuntu2.11            amd64        shared library for communication with SMB/CIFS servers
ii  php-smbclient                         0.8.0-3build2                              amd64        PHP wrapper for libsmbclient
ii  python-samba                          2:4.7.6+dfsg~ubuntu-0ubuntu2.11            amd64        Python bindings for Samba
ii  samba                                 2:4.7.6+dfsg~ubuntu-0ubuntu2.11            amd64        SMB/CIFS file, print, and login server for Unix
ii  samba-common                          2:4.7.6+dfsg~ubuntu-0ubuntu2.11            all          common files used by both the Samba server and client
ii  samba-common-bin                      2:4.7.6+dfsg~ubuntu-0ubuntu2.11            amd64        Samba common files used by both the server and the client
ii  samba-dsdb-modules                    2:4.7.6+dfsg~ubuntu-0ubuntu2.11            amd64        Samba Directory Services Database
ii  samba-libs:amd64                      2:4.7.6+dfsg~ubuntu-0ubuntu2.11            amd64        Samba core libraries
ii  samba-vfs-modules                     2:4.7.6+dfsg~ubuntu-0ubuntu2.11            amd64        Samba Virtual FileSystem plugins
ii  smbclient                             2:4.7.6+dfsg~ubuntu-0ubuntu2.11            amd64        command-line SMB/CIFS clients for Unix

Hi there,

what im loking for is a really easy noob proof guide to install nextcloud on ubuntu 18.04 that does not need additional knwowledge and doesn’t stop randomly in between or skips important steps to accomplish sidegoal that i’ ll never use or understand?

Maybe you know of such a guide?

How about this? For Ubuntu 18.04 is the same with snap.

Thank you ill try that out

Hi there, my output looks like this (After installing smbclient and php-smbclient):

It seems i’m missing additional plugins?

thank you for your support and patience :slight_smile:

Hi there tried that and i got it working right away, including https. I assume this is the same install procedure you can select directly from the live cd (you get the option to install nextcloud with the ubuntu server installation itself). Snap i guess?

Sadly the error with smb is still not gone

May be you can try to added it? Because it is not listed on your screenshot.

Tried adding it but even after a restart the problem is still there.The function smb in nextcloud snap is not working and still displaying thta smbclient is not installed.

Im currently trying to mount a smb share from linux. Got that working today but not permanently
How to i make shure this smb share is connected at boot and is listed in nextcloud? (fstab)

Try to added in /etc/fstab something like this if you are using guest account:

//192.168.1.209/public /media/NAS cifs guest,uid=1000,iocharset=utf8 0 0

–> Source.
Or like this if you have to authorize yourself:

//server/share /pathto/mountpoint cifs credentials=/home/username/.smbcredentials,uid=shareuser,gid=sharegroup 0 0

With .smbcredentials file in your home directory:

username=shareuser
password=sharepassword
domain=domain_or_workgroupname

–> Source.

Do not forget to rescan it periodically, e.g. via OS cronjob:

Otherwise it will be updated only when you accessing it.

Cool thank you very much i’ll try that:)

Tried it and it kinda works but now im unable to scan the data via

“sudo nextcloud.occ files:scan --all”

The outpot after runing that is:

“cannot stat path of the current working directory: Permission denied”

And it seems as if i do not have premissions to write to that folder.

Damn this is not easy and not user (especially noob) friendly…

Thank you for the help!

Check this out, looks like it is exatly the same issue was solved here:

Hi thank you i’ll try that out.

In the meantime im fighting with fstab which mounted my share once and i could even write to it but after a reboot (without changing fsatb) ist won’t mount again…

I edited fstab , rebooted , was able to create a folder and a file, did another reboot and it broke…?

Now its throwing error 22 at me. if i run this:

tail -f  /var/log/kern.log

It complains about the SMBversion i guess ?

I believe you have 2 problems:

  1. Apparmor (or snap) give no access to nextlcoud, so it is “protecting” your folder.
  2. CIFS you should specify version of SMB, e.g. vers=1.0 for old one, e.g. try to put credentials directly without file .smbcredentials if it does not work -o username=username,password=password,vers=3.0. To be honest, I never added Samba via fstab, so I have no working config on hands.

Thank you for helping anyways :slight_smile:

I’ll try that out…

I need to find out what apparmour is… Must be some sort of protection but what folder is it protecting the share or the mountpoint folder. Andy why im doing this as sudo user?