Permission issues with mounted folder over CIFS/SMB

Hi all,

I have installed Nextcloud on a VM in Proxmox following mainly this guide:
https://www.ladislavbrezovnik.com/2018/03/09/install-nextcloud-13-on-centos-7/

I can login into nextcloud as a normal user account which I’ve created without issues. The problem I’m facing now is with the data permissions. In particular, I’m trying to mount a ZFS dataset on Proxmox on the data folder of the normal user (/var/www/html/nextcloud/data/myuser/files). This is the fstab of the VM:

//PVE/pepool_shares_nextcloud_data /var/www/html/nextcloud/data/myuser/files cifs rw,auto,nobrl,user=myuser,credentials=/home/myuser/.smbcredentials,iocharset=utf8,uid=1000,gid=1000 0 0

In the guide the owner of the nextcloud folder including subfolders is apache:
# chown -R apache:apache nextcloud

I’ve changed the owner of files like this:
# chown -R myuser:myuser /var/www/html/nextcloud/data/myuser/files

And here’s the problem:
If I create a file on Proxmox I can see the created file on the VM but only with sudo. The same in the opposite direction without sudo. In the nextcloud GUI appear no files. Also I cannot create a file or folder using the GUI.

So, how should I configure the VM and Proxmox to have my data synced and file operations with the GUI work?

[UPDATE]
I have activated the “External storages” app and mounted my share as “SMB”. It works fine but I can’t find neither “SMB” or the files I’ve uploaded to it when I ssh to the VM. Can someone enlighten me?

NextCloud, like Wordpress, is a web application, they run on a web server.
Apache web server is a directory/sub-directory/sub-sub-directory/… managed by the apache daemon thru linux.user.account “apache”. In other words, it is the user “apache” who do all the read/write on those directories to feed browsers with content. What you had done is kick away user “apache”. The result is obvious.

Your problem is a general web server set up one, not nextcloud specific. Suggest you post your question to forum of the operating system you picked (CentOS) because they know how to set up their packaged web server better than nextcloud guys.

Thanks for the reply.
I have removed the entry from the fstab and changed the ownership of /var/www/html/nextcloud/data/myuser/files
back to apache:apache.

Like I mentioned before I have mounted the share via the provided app “External storages” and it works. I can upload and see my files in the NC GUI. What I found weird is that I cannot find the mounted share with ssh. When I run “mount” there is not such mount point. So how does it work?