Install Nextcloud 13.0.0 on Fedora 27
-
@brandon220 said in Install Nextcloud 13.0.0 on Fedora 27:
I have a 2 Tb Nextcloud install on Ubuntu (16.04) from a couple years ago. I need to migrate everything to a new server using Fedora but a migration seems harder than it should be. Hopefully I will tackle it soon. I've not had any issues with Ubuntu but everyone here seems to dislike it.
"Dislike" is strong. "Don't like compared to common alternatives" is better.
-
Whats the best way to configure the data directory? Do I create a large VM or a separate disk mounted on the data folder?
-
@mattbagan said in Install Nextcloud 13.0.0 on Fedora 27:
Whats the best way to configure the data directory? Do I create a large VM or a separate disk mounted on the data folder?
For a file server, I'd have a separate .VHDX for the file storage, and mount it as /DATA
-
@mattbagan said in Install Nextcloud 13.0.0 on Fedora 27:
Whats the best way to configure the data directory? Do I create a large VM or a separate disk mounted on the data folder?
Varies on your needs. NextCloud recommends separate BtrFS volume. I like a separate LVM2 volume with XFS.
-
@scottalanmiller @Tim_G Thanks for the info. I will have a separate disk for the data. I will be using this guide to migrate from ubuntu to fedora.
-
Very nice! I've done this before on Fedora 23 with OwnCloud, but the procedure was confusing.
I wanted to add something for users who might have an issue like I did. I have a separate physical disk I wanted to setup for the data disk, but found myself running through most of your procedure without having setup or mounted the disk. I took your advice and used the default /var/www/html/nextcloud/data path.
At the NextCloud wizard, I received a "can't read or write into the data directory" message. I knew it had something to do with permissions. First, I had to re-issue the chown apache:apache -R /var/www/html/nextcloud command because once the disk was mounted the data folder reverted back to root:root - that's a given. But the same error came up. So, I figured it was SELINUX and I re-ran the selinux_config.sh script, which gave me an error for each folder saying it was already defined. Even so, I tried NextCloud again and had the same data directory error.
A little poking around and I found this out: you have 2 commands in SELINUX: "semanage fcontext" and "restorecon" ...
The "already defined" error was coming from the semanage fcontext command, so I read a bit about restorecon and discovered that if you add an "-F" parameter, it will force the command rather than bypass it if it's already been run. There is no error from restorecon, it just silently doesn't work. Adding the -F parameter worked: restorecon -R -F ${ocpath}/data.Thank you, I have a nicely running NextCloud system now!
-
@sopdahl said in Install Nextcloud 13.0.0 on Fedora 27:
Very nice! I've done this before on Fedora 23 with OwnCloud, but the procedure was confusing.
I wanted to add something for users who might have an issue like I did. I have a separate physical disk I wanted to setup for the data disk, but found myself running through most of your procedure without having setup or mounted the disk. I took your advice and used the default /var/www/html/nextcloud/data path.
At the NextCloud wizard, I received a "can't read or write into the data directory" message. I knew it had something to do with permissions. First, I had to re-issue the chown apache:apache -R /var/www/html/nextcloud command because once the disk was mounted the data folder reverted back to root:root - that's a given. But the same error came up. So, I figured it was SELINUX and I re-ran the selinux_config.sh script, which gave me an error for each folder saying it was already defined. Even so, I tried NextCloud again and had the same data directory error.
A little poking around and I found this out: you have 2 commands in SELINUX: "semanage fcontext" and "restorecon" ...
The "already defined" error was coming from the semanage fcontext command, so I read a bit about restorecon and discovered that if you add an "-F" parameter, it will force the command rather than bypass it if it's already been run. There is no error from restorecon, it just silently doesn't work. Adding the -F parameter worked: restorecon -R -F ${ocpath}/data.Thank you, I have a nicely running NextCloud system now!
No problem. I am happy you figured it out.
I did not think about the -F paramter to force it to redo it. That is a good idea to add to the instructions in case someone redoes something like you did.
-
The one additional step I also did was to have what Nextcloud calls "pretty URLs"
Add these lines to the config.php file (https if you've secured your instance with certs, http if you haven't)
'overwrite.cli.url' => 'https://www.mydomain.com', 'htaccess.RewriteBase' => '/', 'overwriteprotocol' => 'https',
Then from terminal, run this command.
sudo -u apache php /var/www/nextcloud/occ maintenance:update:htaccess
My URL then changed from
https://www.mydomain.com/nextcloud
tohttps://www/mydomain.com
and it removed the "index.php" from shared links. -
@nashbrydges Did you have to set
Require all granted
in your httpd.conf too? -
@bnrstnr said in Install Nextcloud 13.0.0 on Fedora 27:
@nashbrydges Did you have to set
Require all granted
in your httpd.conf too?You should not touch
httpd.conf
That is the reason thatnextcloud.conf
exists. -
@bnrstnr said in Install Nextcloud 13.0.0 on Fedora 27:
@nashbrydges Did you have to set
Require all granted
in your httpd.conf too?I didn't, no. All changes are done in nextcloud.conf and it does not need
Require all granted
. -
I guess I should make a dedicated post for this..
Here are the instructions to pretty the URL.https://mangolassi.it/topic/12878/install-nextcloud-11-0-2-on-centos-7-with-php-7-1-from-remi/2
-
@jaredbusch Ah, I was confusing this with SAM's install script. I was about to say that the script didn't create a nextcloud.conf in my conf.d folder. I ran his script last night on a new server and it was only going to serve this one nextcloud install so I just modified the httpd.conf
-
The only change that I do that isn't really covered anywhere in any documentation I've seen is to change the favicon. I replace the Nexcloud one with mine just to complete the theming.
-
@bnrstnr said in Install Nextcloud 13.0.0 on Fedora 27:
@jaredbusch Ah, I was confusing this with SAM's install script. I was about to say that the script didn't create a nextcloud.conf in my conf.d folder. I ran his script last night on a new server and it was only going to serve this one nextcloud install so I just modified the httpd.conf
@scottalanmiller is a slacker.
-
@bnrstnr said in Install Nextcloud 13.0.0 on Fedora 27:
@jaredbusch Ah, I was confusing this with SAM's install script. I was about to say that the script didn't create a nextcloud.conf in my conf.d folder. I ran his script last night on a new server and it was only going to serve this one nextcloud install so I just modified the httpd.conf
I do one application per VM, so no need for individual configuration files
-
@scottalanmiller said in Install Nextcloud 13.0.0 on Fedora 27:
@bnrstnr said in Install Nextcloud 13.0.0 on Fedora 27:
@jaredbusch Ah, I was confusing this with SAM's install script. I was about to say that the script didn't create a nextcloud.conf in my conf.d folder. I ran his script last night on a new server and it was only going to serve this one nextcloud install so I just modified the httpd.conf
I do one application per VM, so no need for individual configuration files
Not true. Using a vhost config keeps things simple compared to editing the default config file.
Granted neither need to happen here unless you are doing the pretty URL bit.
-
@jaredbusch & @scottalanmiller : the vhost thing is likely the correct way to do this as "letsencrypt --apache" fails unless there is a vhost configured for port 80.
The default httpd.conf included with Fedora does not have this configured.So you both know, Fedora 28 installs NC 13.0.3 in exactly the same manner but fails during installation due to missing php-json. Once installed, it installs without issue.
-
This post is deleted! -
@manxam said in Install Nextcloud 13.0.0 on Fedora 27:
@jaredbusch & @scottalanmiller : the vhost thing is likely the correct way to do this as "letsencrypt --apache" fails unless there is a vhost configured for port 80.
The default httpd.conf included with Fedora does not have this configured.So you both know, Fedora 28 installs NC 13.0.3 in exactly the same manner but fails during installation due to missing php-json. Once installed, it installs without issue.
Thanks. I'm on Fed 28 with 13.0.4 now, but it was an update, not a fresh install.