Install ownCloud stable (currently 9.0.2) on CentOS 7
-
Based on my original how to Install ownCloud 8.x on CentOS 7
A number of people have been saying that they cannot get ownCloud 9 to install correctly so I decided to give it a go based on a clean CentOS 7 Minimal install. The base OS is still the 1511 release.
Install CentOS 7 and then log in as root. If you choose not to do that, then be prepared to prepend almost every command that follows with
sudo
.First things first, you always update to current.
yum -y update
Now we need to install a few additional packages. It is required to instal
wget
in order to complete the install of ownCloud per their instructions. I additionally always installnano
because I hatevi
but it is not required. Finally you need to install a database because the ownCloud documentation itself clearly tells you not to use the built in SQLite database if you are using a desktop sync client. The default database for CentOS ismariadb
. Finally the 1511 release of CentOS did not includefirewalld
in a minimal install for unknown reasons.yum -y install wget nano mariadb mariadb-server firewalld
SELinux is something a lot of people like to just permanently set to permissive mode. I disagree with disabling security just because it is easy. OwnCloud has specific instructions for SELinux that do not work, but we will fix it correctly. For now, set it to permissive. This will not survive a reboot. If you reboot prior to completing the install you will have to set this again.
setenforce permissive
Start the firewall and enable it to start on boot and then allow http traffic.
systemctl enable firewalld systemctl start firewalld firewall-cmd --zone=public --add-port=http/tcp --permanent firewall-cmd --reload
Start the database and set it to start on reboot
systemctl enable mariadb systemctl start mariadb
This step is optional, but I never run a database that anyone can access with out a password. Secure the database install
mysql_secure_installation
This will start a wizard to enable typical security measure for the database. The capitalized letter is the default, and is the choice you want to make, so you can simply hit enter through all of these except for setting the new password, obviously.
Enter current password for root (enter for none): Set root password? [Y/n] New password: databaserootpassword Re-enter new password: databaserootpassword Remove anonymous users? [Y/n] Disallow root login remotely? [Y/n] Remove test database and access to it? [Y/n] Reload privilege tables now? [Y/n]
Sign in to the database and create the ownCloud instance and user.
You will be prompted to enter your database root password.mysql -uroot -p
Now you will run 4 SQL commands, please note the
;
at the end of each. It is a required part of the SQL syntax . These are simplified defaults, I would generally recommend you set them to something a little less obvious just to help with security.create database ownclouddb; create user 'ownclouduser'@'localhost' identified by 'ownclouduserpassword'; grant all on ownclouddb.* to 'ownclouduser'@'localhost'; flush privileges; quit
Now, we can finally have the base OS ready for ownCloud. If you are doing this in a location that you can make snapshots, this is a great point to do it.
OwnCloud has setup a "stable" repository that you can use, or you can choose to use a repository for a specific version. We will use the stable repository for this example.
Import the owncloud repository key.
rpm --import https://download.owncloud.org/download/repositories/stable/CentOS_7/repodata/repomd.xml.key
Install the EPEL repository
yum -y install epel-release
Download the ownCloud repository into the yum repos folder and force yum to clean up.
wget http://download.owncloud.org/download/repositories/stable/CentOS_7/ce:stable.repo -O /etc/yum.repos.d/ce:stable.repo yum clean expire-cache
Finally, we can install ownCloud itself. Beginning with version 9 it has been split into two parts.
owncloud-deps
andowncloud-files
. You can read about why here if you desire.
I install both theowncloud
metapackage as well as theowncloud-files
just in case they add something to the files but neglect to make sure the metapackage pulls the change correctly.yum -y install owncloud owncloud-files
But wait, there is more. The ownCloud install does not tell the web server to start on reboot. So do that now.
systemctl enable httpd
With version 8.2 that was it. With version 9.0.2 when I was at this point and tried to load the webpage, I received a connection refused. I shutdown
firewalld
and made sure SELinux was passive, and still no luck.So when in doubt reboot.
After rebooting, the webpage came up but told me it could not access the config directory. This is the result of SELinux now being on (because I rebooted).
So time to resolve SELinux
semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/owncloud/apps(/.*)?' restorecon -R /var/www/html/owncloud/apps semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/owncloud/config(/.*)?' restorecon -R /var/www/html/owncloud/config
Now we are done and we can log into to our instance at
http://X.X.X.X/owncloud
If you did everything correct, you will see this screen, with all the DB config hidden, click the "Storage & database" text to expand it. Create an admin username and password for the GUI and then fill out to the database section match what you used above for the database name, database user, and database user password.
-
After installing this on a vanilla CentOS install, I added Remi's and updated to PHP 5.6 with no issues either.
Instructions: https://mangolassi.it/topic/8433/adding-remi-s-rpm-repository-to-centos-7-and-updating-to-php-5-6
-
so it's still not working with PHP 7.x?
-
@Dashrender said in Install ownCloud stable (currently 9.0.2) on CentOS 7:
so it's still not working with PHP 7.x?
You are conflating different issues.
People said they cannot install ownCloud 9.0.X. Here are the instructions.
Performing a repo based install of ownCloud means it is supposed to work with PHP 5.4. It does. It also works fine with PHP 5.6 from Remi.
-
@JaredBusch said in Install ownCloud stable (currently 9.0.2) on CentOS 7:
@Dashrender said in Install ownCloud stable (currently 9.0.2) on CentOS 7:
so it's still not working with PHP 7.x?
You are conflating different issues.
People said they cannot install ownCloud 9.0.X. Here are the instructions.
Performing a repo based install of ownCloud means it is supposed to work with PHP 5.4. It does. It also works fine with PHP 5.6 from Remi.
I've always gotten to that screen. It falls down only after entering the information for the database/storage location/admin login. Did you try to login, and then check that it's using the correct database?
-
@travisdh1 said in Install ownCloud stable (currently 9.0.2) on CentOS 7:
@JaredBusch said in Install ownCloud stable (currently 9.0.2) on CentOS 7:
@Dashrender said in Install ownCloud stable (currently 9.0.2) on CentOS 7:
so it's still not working with PHP 7.x?
You are conflating different issues.
People said they cannot install ownCloud 9.0.X. Here are the instructions.
Performing a repo based install of ownCloud means it is supposed to work with PHP 5.4. It does. It also works fine with PHP 5.6 from Remi.
I've always gotten to that screen. It falls down only after entering the information for the database/storage location/admin login. Did you try to login, and then check that it's using the correct database?
logged in and apparently working, yes.
-
here is the config.php
<?php $CONFIG = array ( 'updatechecker' => false, 'instanceid' => 'ocjzbyol54q4', 'passwordsalt' => 'qkkoyjmPcte41C1BpjzhYTac/1Py9b', 'secret' => 'CrSGOCsYZxgCoqOYeliSqLFZVkjSlDQbc3nS8ZGpmUJdsZnn', 'trusted_domains' => array ( 0 => '10.254.0.55', ), 'datadirectory' => '/var/www/html/owncloud/data', 'overwrite.cli.url' => 'http://10.254.0.55/owncloud', 'dbtype' => 'mysql', 'version' => '9.0.2.2', 'dbname' => 'ownclouddb', 'dbhost' => 'localhost', 'dbtableprefix' => 'oc_', 'dbuser' => 'ownclouduser', 'dbpassword' => 'ownclouduserpassword', 'logtimezone' => 'UTC', 'installed' => true, );
-
@JaredBusch Well, what the hell was falling over for me? I'm thinking my problems were mostly caused by RamNode doing non-standard things with their CentOS installs from the looks of things. I'm gonna try building one in VirtualBox just to see.
-
@travisdh1 i did one in VBOX and had the same issue, curious...
-
@JaredBusch Now this is just odd. Worked just fine on a local VirtualBox VM. Wouldn't work for anything on my ramnode instance. Now I want to know how broken RamNode made their system images!
-
It appears the testing line of ownCloud will install php7 dependencies even tho the only dependency package looks like php5. Runs much better, and nothing unexpected is happening to me this time. When the stable branch fails, apparently testing could be better!
-
So Vultr has SELinux disabled by default. I attempted to check how to enable it here. It has you edit /etc/sysconfig/selinux but when I go to it it's empty. I entered all of the information, essentially creating a new document but SELinux is still disabled. I'm guessing this probably isn't accurate?
-
@wirestyle22 said in Install ownCloud stable (currently 9.0.2) on CentOS 7:
So Vultr has SELinux disabled by default. I attempted to check how to enable it here. It has you edit /etc/sysconfig/selinux but when I go to it it's empty. I entered all of the information, essentially creating a new document but SELinux is still disabled. I'm guessing this probably isn't accurate?
Why are you trying to enable it? While it is certainly best to have it enabled, by being disabled, there would be no impact on your install.
-
@JaredBusch said in Install ownCloud stable (currently 9.0.2) on CentOS 7:
@wirestyle22 said in Install ownCloud stable (currently 9.0.2) on CentOS 7:
So Vultr has SELinux disabled by default. I attempted to check how to enable it here. It has you edit /etc/sysconfig/selinux but when I go to it it's empty. I entered all of the information, essentially creating a new document but SELinux is still disabled. I'm guessing this probably isn't accurate?
Why are you trying to enable it? While it is certainly best to have it enabled, by being disabled, there would be no impact on your install.
You said in your guide that you disagree with SELinux being put into permissive mode or disabled. I want everything to be JB best practice
-
@wirestyle22 said in Install ownCloud stable (currently 9.0.2) on CentOS 7:
@JaredBusch said in Install ownCloud stable (currently 9.0.2) on CentOS 7:
@wirestyle22 said in Install ownCloud stable (currently 9.0.2) on CentOS 7:
So Vultr has SELinux disabled by default. I attempted to check how to enable it here. It has you edit /etc/sysconfig/selinux but when I go to it it's empty. I entered all of the information, essentially creating a new document but SELinux is still disabled. I'm guessing this probably isn't accurate?
Why are you trying to enable it? While it is certainly best to have it enabled, by being disabled, there would be no impact on your install.
You said in your guide that you disagree with SELinux being put into permissive mode or disabled. I want everything to be JB best practice
Then you should not start from a system that has it permanently gone.
-
@JaredBusch said in Install ownCloud stable (currently 9.0.2) on CentOS 7:
@wirestyle22 said in Install ownCloud stable (currently 9.0.2) on CentOS 7:
@JaredBusch said in Install ownCloud stable (currently 9.0.2) on CentOS 7:
@wirestyle22 said in Install ownCloud stable (currently 9.0.2) on CentOS 7:
So Vultr has SELinux disabled by default. I attempted to check how to enable it here. It has you edit /etc/sysconfig/selinux but when I go to it it's empty. I entered all of the information, essentially creating a new document but SELinux is still disabled. I'm guessing this probably isn't accurate?
Why are you trying to enable it? While it is certainly best to have it enabled, by being disabled, there would be no impact on your install.
You said in your guide that you disagree with SELinux being put into permissive mode or disabled. I want everything to be JB best practice
Then you should not start from a system that has it permanently gone.
I wasn't sure if that was the case or not. There is no way for me to enable it? I thought it might just come disabled by default but not permanently.
-
@wirestyle22 said in Install ownCloud stable (currently 9.0.2) on CentOS 7:
@JaredBusch said in Install ownCloud stable (currently 9.0.2) on CentOS 7:
@wirestyle22 said in Install ownCloud stable (currently 9.0.2) on CentOS 7:
@JaredBusch said in Install ownCloud stable (currently 9.0.2) on CentOS 7:
@wirestyle22 said in Install ownCloud stable (currently 9.0.2) on CentOS 7:
So Vultr has SELinux disabled by default. I attempted to check how to enable it here. It has you edit /etc/sysconfig/selinux but when I go to it it's empty. I entered all of the information, essentially creating a new document but SELinux is still disabled. I'm guessing this probably isn't accurate?
Why are you trying to enable it? While it is certainly best to have it enabled, by being disabled, there would be no impact on your install.
You said in your guide that you disagree with SELinux being put into permissive mode or disabled. I want everything to be JB best practice
Then you should not start from a system that has it permanently gone.
I wasn't sure if that was the case or not. There is no way for me to enable it? I thought it might just come disabled by default but not permanently.
I have never tried. I do not have any production systems on Vultr. I have only used it for testing FreePBX to date.
-
@wirestyle22 said in Install ownCloud stable (currently 9.0.2) on CentOS 7:
@JaredBusch said in Install ownCloud stable (currently 9.0.2) on CentOS 7:
@wirestyle22 said in Install ownCloud stable (currently 9.0.2) on CentOS 7:
@JaredBusch said in Install ownCloud stable (currently 9.0.2) on CentOS 7:
@wirestyle22 said in Install ownCloud stable (currently 9.0.2) on CentOS 7:
So Vultr has SELinux disabled by default. I attempted to check how to enable it here. It has you edit /etc/sysconfig/selinux but when I go to it it's empty. I entered all of the information, essentially creating a new document but SELinux is still disabled. I'm guessing this probably isn't accurate?
Why are you trying to enable it? While it is certainly best to have it enabled, by being disabled, there would be no impact on your install.
You said in your guide that you disagree with SELinux being put into permissive mode or disabled. I want everything to be JB best practice
Then you should not start from a system that has it permanently gone.
I wasn't sure if that was the case or not. There is no way for me to enable it? I thought it might just come disabled by default but not permanently.
You could get around it by not using their default CentOS image and load your own from an uploaded ISO.
-
@JaredBusch said in Install ownCloud stable (currently 9.0.2) on CentOS 7:
@wirestyle22 said in Install ownCloud stable (currently 9.0.2) on CentOS 7:
@JaredBusch said in Install ownCloud stable (currently 9.0.2) on CentOS 7:
@wirestyle22 said in Install ownCloud stable (currently 9.0.2) on CentOS 7:
@JaredBusch said in Install ownCloud stable (currently 9.0.2) on CentOS 7:
@wirestyle22 said in Install ownCloud stable (currently 9.0.2) on CentOS 7:
So Vultr has SELinux disabled by default. I attempted to check how to enable it here. It has you edit /etc/sysconfig/selinux but when I go to it it's empty. I entered all of the information, essentially creating a new document but SELinux is still disabled. I'm guessing this probably isn't accurate?
Why are you trying to enable it? While it is certainly best to have it enabled, by being disabled, there would be no impact on your install.
You said in your guide that you disagree with SELinux being put into permissive mode or disabled. I want everything to be JB best practice
Then you should not start from a system that has it permanently gone.
I wasn't sure if that was the case or not. There is no way for me to enable it? I thought it might just come disabled by default but not permanently.
You could get around it by not using their default CentOS image and load your own from an uploaded ISO.
That makes sense. Thanks!
-
Followed the instructions to the letter except for Remi PHP 5.6 (will do next week), and worked flawlessly. Thanks. Quick question. Under Admin File Handling, the default is 513MB. Changing is greyed out with message of "Missing permissions to edit from here." Did quick google and see a few that have that issue and a couple of workarounds that, TBH, confuse. Care to note how to change that?