So Iām somewhat new to Linux. Iāve been around the block with various OSās thoughout the years, but this problem just keeps stumping me. Iāve tried just about every āsure fixā Iāve found on the forums here, reddit, etc. to no avail.
This should be simple enough, so I am missing something, and could really use some help finding it.
Background
Iām going to explain everything Iāve done, in an attempt to paint a picture of my current setup, in the hopes that maybe something stands out to the people who know more than me, ha.
Brand new Ubuntu 20.04.2.0 Server installation. 3 drives total. 1 SSD for OS. 2 NAS drives for RAID. Soft RAID created by Linux installer during OS installation. Usual update/upgrade packages as soon as I get to CL for the first time. Then installed GNOME. (ubuntu-desktop) variant.
Other than that, itās a blank canvas. Then proceed to install LAMP stack. Using LinuxBabe instructions for reference. Move on to Nextcloud Installation. Also using LinuxBabe instructions. I should note the instructions work flawlessly when using default locations listed in the instructions. (/var/www & /var/www/nextcloud etc.)
Trying to change the ādataā directory to the RAID is not as simple as it āshouldā be. So I feel I am missing something. First issue was that the nextcloud web interface during initial setup would kick back a message saying it couldnāt access the directory of my choosing (RAID). I had set www-data as the owner:group for the RAID itself, not just a folder within. Well technically I tried both, after a folder didnāt work I tried just giving the whole partition to www-data. No luck. I changed the directory in every .conf file. Apache, PHP, Nextcloud etc. to no avail. At one point in doing so, I lost the browser installation interface to a 403 forbidden error. Even though ports 80 and 443 where set the same as previous attempts that worked.
So, if someone whoās well versed could maybe explain it like Iām 5, because Iām missing something, and itās most likely something simple. I hope. I can include links to the two install instructions at the bottom that I followed if it helps at all. Any help is appreciated.
Ideally, donāt install a desktop on your server.
The ONLY steps you need to do for this are:
Mount your filesystem e.g. /mnt/raid
Create your data folder on it e.g. /mnt/raid/nextcloud-data
Chown it to the user your web server runs as (on Ubuntu this is www-data:www-data)
Set it as the data folder path when setting up Nextcloud
Under NO CIRCUMSTANCES change any permissions on/under the data folder from this point forward.
Also quite often this kind of problem is the result of ātrying too hardā and changing stuff that shouldnāt be changed when the answer is something simple like a typo or a skipped step. What you described above should have worked, so I suspect thereās some other detail thatās out of place.
Why donāt you try this again doing only what was described above, and if you get to the NC setup wizard and it wonāt work, stop there and post some info. Donāt change any config files or permissions or move anything else. Show the output of āmountā and āls -lā of your data folder path and a screenshot of the error.
Thank you for the detailed response. I will try your method and report back!
The reason for GNOME installation is for 2 reasons. 1: It helps ease the learning curve a bit when Iām stuck. (Still learning the ropes with CL, although I have ācheat sheetsā hanging all over ha) I started ālearningā on a VM install to play around and break for fun but found that I was having trouble retaining the information without a practical use/application of the commands. Having to use CL to actually get results in a real working environment has helped me retain the commands and functions. 2: the machine will primarily house a large amount of images and itās made navigating through them much easier. However, I do understand that the general consensus is to not have desktop on server. Just curious, why is that the case? I genuinely do not know.
It worked! Thank you again. Funny enough, I kind of answered my own question as to why you shouldnāt have desktop as well. I think I figured out why it didnāt work the first time, even though I did what you recommended. I feel this is worth mentioning for others having trouble, if it is not obvious. Due to having desktop installed, when I use āDisksā to mount my RAID for the first time, by default, GNOME placed the mount point in my users media folder and even though I created a folder for ānextcloud-dataā with www-data having ownership, the parent folder was owned by me (user) and not root. Even having changed ownership after the fact, I was still getting errors.
Either way, thank you for ridding me of a 3 week headache.
Youāll get different answers as to why you donāt want a desktop on your server. The most common one being attack surface. The less code is running on your server, the more secure itāll be. It also uses resources unnecessarily. The general consensus among server admins is that the GUI interface is simply not needed.
And, as you have discovered, the desktop environment changes the way certain things are done where the desktop software may handle things in a ānon-serverā way. Another good example is configuration of your network interfaces. On Ubuntu Server this is done with netplan whereas the GUI uses a completely different method.
So having the GUI installed will also cause you confusion as all the guides are written for a CLI-only server and youāll run across things such as the disk mounting that are just not handled the same way.