ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Install NextCloud 10.X on CentOS 7 Minimal

    IT Discussion
    nextcloud nextcloud 10 centos centos 7 installation real instructions guides how to
    5
    11
    5.0k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • JaredBuschJ
      JaredBusch
      last edited by JaredBusch

      As with my guide for installing ownCloud on CentOS 7, here is a guide for installing NextCloud 10 on CentOS 7.

      This is not a migration guide. I will be writing one though when I migrate my production systems.

      #Update centos
      yum -y update
      
      #install firewall (assuming r1511 minimal) and helper packages
      yum install -y wget nano firewalld
      
      #install EPEL
      yum install -y epel-release
      
      #start the firewall and enable it on reboot
      systemctl start firewalld
      systemctl enable firewalld
      
      #Install all required and optional packages
      yum -y install httpd mariadb mariadb-server php php-gd php-pdo php-pear php-mbstring php-xml php-pear-Net-Curl php-mcrypt php-intl php-ldap php-smbclient php-imap php-mysql php-pear-MDB2 php-pear-MDB2-Driver-mysqli bzip2
      
      #Create directory
      mkdir -p /var/www/html/nextcloud
      
      #Get NextCloud
      wget https://download.nextcloud.com/server/releases/nextcloud-10.0.1.tar.bz2
      
      #Extract NextCloud
      tar xvf nextcloud-10.0.1.tar.bz2 -C /var/www/html
      
      #Create directories not created by extract
      mkdir -p /var/www/html/nextcloud/data
      mkdir -p /var/www/html/nextcloud/etc
      mkdir -p /var/www/html/nextcloud/assets
      
      #get the nextcloud apache config file
      wget -O /etc/httpd/conf.d/nextcloud.conf https://raw.githubusercontent.com/nextcloud/server-packages/master/centos/nextcloud.conf
      
      #default everything to root:apache
      chown -R root:apache /var/www/html/nextcloud/.
      
      #set default directory and file permissions
      find /var/www/html/nextcloud -type d -exec chmod 0750 {} \;
      find /var/www/html/nextcloud -type f -exec chmod 0640 {} \;
      
      #change ownership of folders and files
      chmod 0755 /var/www/html/nextcloud
      chmod 0755 /var/www/html/nextcloud/occ
      chown apache:apache /var/www/html/nextcloud/occ
      chmod 0644 /var/www/html/nextcloud/.htaccess
      chown apache:apache /var/www/html/nextcloud/.htaccess
      find /var/www/html/nextcloud/apps -exec chmod 0750 {} \;
      chown -R apache:apache /var/www/html/nextcloud/apps
      find /var/www/html/nextcloud/assets -exec chmod 0750 {} \;
      chown -R apache:apache /var/www/html/nextcloud/assets
      find /var/www/html/nextcloud/updater -exec chmod 0750 {} \;
      chown -R apache:apache /var/www/html/nextcloud/updater
      find /var/www/html/nextcloud/data -exec chmod 0755 {} \;
      chown -R apache:apache /var/www/html/nextcloud/data
      find /var/www/html/nextcloud/config -exec chmod 0755 {} \;
      chown -R apache:apache /var/www/html/nextcloud/config
      
      #open the firewall for http/https
      firewall-cmd --zone=public --add-port=http/tcp --permanent
      firewall-cmd --zone=public --add-port=https/tcp --permanent
      firewall-cmd --reload
      
      #start the mariadb and set to start on boot
      systemctl start mariadb
      systemctl enable mariadb
      
      #setup mariadb
      mysql_secure_installation
      
      #Create db and db user
      mysql -uroot -p
      create database nextcloud;
      create user 'ncuser'@'localhost' identified by 'ncuserpassword';
      grant all on nextcloud.* to 'ncuser'@'localhost';
      flush privileges;
      exit
      
      #Disable SELinux for now
      setenforce 0
      
      #Restart Apache and enable for reboot.
      systemctl restart httpd
      systemctl enable httpd
      

      Now point your browser to the IP or DNS name of your NextCloud instance and fill things out appropriately. I'll do screenshots later.

      1 Reply Last reply Reply Quote 6
      • JaredBuschJ
        JaredBusch
        last edited by

        Post to be updated with SELinux instructions.

        1 Reply Last reply Reply Quote 0
        • JaredBuschJ
          JaredBusch
          last edited by

          Post to be updated with setting up SSL.

          travisdh1T 1 Reply Last reply Reply Quote 0
          • JaredBuschJ
            JaredBusch
            last edited by

            And ready to log in.
            0_1475465705539_upload-16865fd1-fb00-462b-940f-9969f19b3580

            1 Reply Last reply Reply Quote 0
            • iroalI
              iroal
              last edited by

              Thanks for the guide, works perfect.

              Any solution to avoid enter setenforce 0 after restart the server?

              JaredBuschJ 1 Reply Last reply Reply Quote 0
              • dafyreD
                dafyre
                last edited by

                Check /etc/selinux/conf

                change the line that says:

                selinux = enforcing

                to

                selinux = permissive

                JaredBuschJ 1 Reply Last reply Reply Quote -1
                • JaredBuschJ
                  JaredBusch @dafyre
                  last edited by

                  @dafyre said in Install NextCloud 10.X on CentOS 7 Minimal:

                  Check /etc/selinux/conf

                  change the line that says:

                  selinux = enforcing

                  to

                  selinux = permissive

                  Never.

                  1 Reply Last reply Reply Quote 2
                  • JaredBuschJ
                    JaredBusch @iroal
                    last edited by

                    @iroal said in Install NextCloud 10.X on CentOS 7 Minimal:

                    Thanks for the guide, works perfect.

                    Any solution to avoid enter setenforce 0 after restart the server?

                    Look at my ownCloud Guide. I expect it to be basically the same. But I have not had time to test it yet.
                    https://mangolassi.it/topic/6938/install-owncloud-8-x-on-centos-7

                    1 Reply Last reply Reply Quote 3
                    • travisdh1T
                      travisdh1 @JaredBusch
                      last edited by

                      @JaredBusch said in Install NextCloud 10.X on CentOS 7 Minimal:

                      Post to be updated with setting up SSL.

                      sudo yum install python-certbot-apache
                      sudo certbot --apache
                      

                      Accept defaults in certbot, and I forget the update options off the top of my head.

                      JaredBuschJ 1 Reply Last reply Reply Quote 0
                      • scottalanmillerS
                        scottalanmiller
                        last edited by

                        Worked like a charm. NextCloud 10 on CentOS 7 is up and running.

                        1 Reply Last reply Reply Quote 0
                        • JaredBuschJ
                          JaredBusch @travisdh1
                          last edited by

                          @travisdh1 said in Install NextCloud 10.X on CentOS 7 Minimal:

                          @JaredBusch said in Install NextCloud 10.X on CentOS 7 Minimal:

                          Post to be updated with setting up SSL.

                          sudo yum install python-certbot-apache
                          sudo certbot --apache
                          

                          Accept defaults in certbot, and I forget the update options off the top of my head.

                          Just FYI for anyone finding this thread. The above does not work because there is not a vhost file.

                          Call certbot like this.

                          certbot --apache --email [email protected] --domain nexcloud.domain.com --agree-tos --non-interactive
                          
                          1 Reply Last reply Reply Quote 1
                          • 1 / 1
                          • First post
                            Last post