LinuxBabe has a tutorial. The first step is to install the LEMP Stack (Nginx, MariaDB, PHP7.2-FPM) on Ubuntu 18.04. No joy. Then I tried snap using the Digital Ocean tutorial. No joy.
OK, Tech Republic came through with this one and it worked. I started out with a patched ubuntu 18.04 lts server the followed the script. I wanted to use my file server as the data store. I exported the top directory of my file server then mounted the nfs share on the NextCloud server. Then I added permissions on the file server for NextCloud. I added www-data to the group with permissions for the top directory and changed permissions to 770 to allow the group to write and prevent other users from listing the directory.
Next, port forwarding must be enabled. Cox Communications, my ISP, blocks port 80 (HTTP) so I used port 8080 and forwarded it to port 80 on the NextCloud server. This works, but is insecure. I need to use HTTPS (port 443) which also removes the need for translating ports in port forwarding.
Most tutorials for NextCloud use the snappy package manager for installation. Subsequent SSL/TLS installations also use snappy which doesn’t work with my apt installation. The next hurdle was an connection error when requesting a certificate from Let’s Encrypt. My next tact is to create a self-signed SSL certificate using the Digital Ocean tutorial. Because this certificate is not signed by a trusted certificate authority, you get the “Your Connection is not Private” error. However, your data is still encrypted and you can trust it.
Add File Server Files to NextCloud
Wouldn’t it be nice to have all my file server files available to NextCloud. NextCloud gives you access to userid/files. My file organization is //fileserver/storage/protected with categories of files next. These categories include documents, downloads, manuals, movies, manuals, pictures, tv, utilities and video. It also includes my userid, lynn, which is the root directory for NextCloud. Below lynn is files which is what you see in NextCloud, aka //fileserver/storage/protected/lynn/files.
I had to move documents, downloads, manuals, movies, manuals, music, pictures, tv, utilities, and movies under //fileserver/media/storage/protected/lynn/files. I was able to retain my directory structure by creating symbolic links for each of these directories, e.g.,
sudo ln -s /media/storage/protected/lynn/files/movies /media/storage/protected/movies
Because I didn’t use the NextCloud interface to add files, these files did not appear. I had to rescan the files as the NextCloud user to see them:
sudo -u www-data php /var/www/html/nextcloud/occ files:scan –all