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

    Setup Nextcloud 19.0.4 on Fedora 32

    IT Discussion
    fedora fedora 32 nextcloud nextcloud 19 how to real instructions
    3
    46
    3.4k
    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.
    • 1
      1337 @JaredBusch
      last edited by 1337

      @JaredBusch said in Setup Nextcloud 19.0.4 on Fedora 32:

      Because you cannot sudo cat >> /restricted/folder/fuck.conf << EOF

      I wouldn't know. I just go root and go to work. I'm too lazy to type sudo a hundred times. Probably frowned upon but I don't care.

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

        @Pete-S said in Setup Nextcloud 19.0.4 on Fedora 32:

        @JaredBusch said in Setup Nextcloud 19.0.4 on Fedora 32:

        Because you cannot sudo cat >> /restricted/folder/fuck.conf << EOF

        I wouldn't know. I just go root and go to work. I'm too lazy to type sudo a hundred times. Probably frowned upon but I don't care.

        I'm so used to typing sudo, I type it even when I sudo su - into root.

        1 1 Reply Last reply Reply Quote 1
        • 1
          1337 @JaredBusch
          last edited by 1337

          @JaredBusch said in Setup Nextcloud 19.0.4 on Fedora 32:

          @Pete-S said in Setup Nextcloud 19.0.4 on Fedora 32:

          @JaredBusch said in Setup Nextcloud 19.0.4 on Fedora 32:

          Because you cannot sudo cat >> /restricted/folder/fuck.conf << EOF

          I wouldn't know. I just go root and go to work. I'm too lazy to type sudo a hundred times. Probably frowned upon but I don't care.

          I'm so used to typing sudo, I type it even when I sudo su - into root.

          I've used debian a lot and sudo isn't even installed by default. Well, in a minimal install that is.

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

            @Pete-S said in Setup Nextcloud 19.0.4 on Fedora 32:

            I've used debian a lot and sudo isn't even installed by default. Well, in a minimal install that is.

            Yeah, I learned that when I setup my current Unifi and UNMS controllers.

            I run those on Debian, and no matter the OS, I always do minimal installs for server instances.

            1 Reply Last reply Reply Quote 1
            • black3dynamiteB
              black3dynamite @JaredBusch
              last edited by

              @JaredBusch said in Setup Nextcloud 19.0.4 on Fedora 32:

              @Pete-S said in Setup Nextcloud 19.0.4 on Fedora 32:

              And I think you need to be root to create conf files under apache as well:
              "Create the nextcloud apache config file" section

              No, because it is created in the local folder and then moved and permissions fixed.

              Because you cannot sudo cat >> /restricted/folder/fuck.conf << EOF

              Using sudo with tee works well.

              sudo tee -a config.php  <<EOF
                'memcache.locking' => '\\OC\\Memcache\\Redis',
                'memcache.local' => '\\OC\\Memcache\\Redis',
                'redis' =>
                array (
                  'host' => 'localhost',
                  'port' => 6379,
                ),
              );
              EOF
              
              JaredBuschJ 2 Replies Last reply Reply Quote 2
              • JaredBuschJ
                JaredBusch @black3dynamite
                last edited by

                @black3dynamite said in Setup Nextcloud 19.0.4 on Fedora 32:

                Using sudo with tee works well.

                I'll try that when I redo the install.

                I know I tried tee a couple years ago and things did not work right. I might have just screwed up the syntax, causing my own problems.

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

                  @black3dynamite said in Setup Nextcloud 19.0.4 on Fedora 32:

                  Using sudo with tee works well.

                  Yeah, that works for the apache vhost file, and will work with the nextcloud config file once I work out what to do instead of head -n 1 for that.

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

                    ok fixed. thanks.

                    sed '$d' for the win there.

                    black3dynamiteB 1 Reply Last reply Reply Quote 1
                    • black3dynamiteB
                      black3dynamite @JaredBusch
                      last edited by

                      @JaredBusch said in Setup Nextcloud 19.0.4 on Fedora 32:

                      ok fixed. thanks.

                      sed '$d' for the win there.

                      Nice! I was about to post that command.

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

                        @black3dynamite since you are better with sed than I am... Or at least better with Google and the man pages than I am..

                        How can I fix this to use the environment variables instead of manual.

                        This is part of the next step to use the "pretty URL" as it is called.
                        It works fine like this.

                        sudo sed -i -e 's/\(^DocumentRoot\s*\).*$/\1"\/var\/www\/html\/nextcloud"/' /etc/httpd/conf/httpd.conf
                        

                        But I want it to use the above $WWW_PATH and $APP_FOLDER variables.

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

                          @JaredBusch said in Setup Nextcloud 19.0.4 on Fedora 32:

                          @black3dynamite since you are better with sed than I am... Or at least better with Google and the man pages than I am..

                          How can I fix this to use the environment variables instead of manual.

                          This is part of the next step to use the "pretty URL" as it is called.
                          It works fine like this.

                          sudo sed -i -e 's/\(^DocumentRoot\s*\).*$/\1"\/var\/www\/html\/nextcloud"/' /etc/httpd/conf/httpd.conf
                          

                          But I want it to use the above $WWW_PATH and $APP_FOLDER variables.

                          What does the line do exactly?
                          Sets the DocumentRoot parameter to /var/www/html/nextcloud ?

                          What does $WWW_PATH and $APP_FOLDER contain?
                          Ah, the first post says: /var/www/html and nextcloud

                          JaredBuschJ 2 Replies Last reply Reply Quote 0
                          • JaredBuschJ
                            JaredBusch @1337
                            last edited by

                            @Pete-S said in Setup Nextcloud 19.0.4 on Fedora 32:

                            What does the line do exactly?
                            Sets the DocumentRoot parameter to /var/www/html/nextcloud ?

                            Correct.

                            (      # Start a capture group
                            ^      # Matches the start of the line 
                            DocumentRoot  # Matches the word I am want
                            \s     # a space character I should probably remove that. came from an example I found
                            *      # umm everything maybe? not sure inside the capture group also likely need removed
                            )      # End capture group 
                            .*     # Matches anything
                            $      # Matches the end of the line
                            

                            So, sed should find any instance of DocumentRoot at the beging of a line. This happens only once in a default Apache config file.

                            The capture group means to capture the term within the parentheses in a variable. This is the 1 in the replacement section of the s/// command.

                            I am then appending "/var/www/html/nextcloud" to the captured string "DocumentRoot" to end up with his
                            a7813a10-f6c7-4e2b-bbb8-9faa43d02bc9-image.png

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

                              @Pete-S said in Setup Nextcloud 19.0.4 on Fedora 32:

                              What does $WWW_PATH and $APP_FOLDER contain?
                              Ah, the first post says: /var/www/html and nextcloud

                              And that is why I want to use the environment variables. Not everyone installs everything to the default location.

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

                                @Pete-S said in Setup Nextcloud 19.0.4 on Fedora 32:

                                sudo sed -i -e 's/(^DocumentRoot\s*).*$/\1"/var/www/html/nextcloud"/' /etc/httpd/conf/httpd.conf

                                Better sed. I removed the \s*

                                1e498b1a-06b5-46f6-90a6-c7a3dee31f99-image.png

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

                                  @JaredBusch said in Setup Nextcloud 19.0.4 on Fedora 32:

                                  @Pete-S said in Setup Nextcloud 19.0.4 on Fedora 32:

                                  sudo sed -i -e 's/(^DocumentRoot\s*).*$/\1"/var/www/html/nextcloud"/' /etc/httpd/conf/httpd.conf

                                  Better sed. I removed the \s*

                                  1e498b1a-06b5-46f6-90a6-c7a3dee31f99-image.png

                                  I think you can simplify it way more.

                                  • you don't need -e
                                  • don't use the / separator, use for instance #. So s#expression#replacement#. Then you don't have to escape your paths. And then you can put your variables straight in.
                                  1 JaredBuschJ 2 Replies Last reply Reply Quote 1
                                  • 1
                                    1337 @1337
                                    last edited by 1337

                                    @Pete-S said in Setup Nextcloud 19.0.4 on Fedora 32:

                                    @JaredBusch said in Setup Nextcloud 19.0.4 on Fedora 32:

                                    @Pete-S said in Setup Nextcloud 19.0.4 on Fedora 32:

                                    sudo sed -i -e 's/(^DocumentRoot\s*).*$/\1"/var/www/html/nextcloud"/' /etc/httpd/conf/httpd.conf

                                    Better sed. I removed the \s*

                                    1e498b1a-06b5-46f6-90a6-c7a3dee31f99-image.png

                                    I think you can simplify it way more.

                                    • you don't need -e
                                    • don't use the / separator, use for instance #. So s#expression#replacement#. Then you don't have to escape your paths. And then you can put your variables straight in.

                                    Don't think you need the sed script inside a quoted string either.

                                    Maybe something like this:

                                    sudo sed -i s#\(^DocumentRoot\).*$#\1$WWW_PATH/$APP_FOLDER# /etc/httpd/conf/httpd.conf
                                    

                                    If you want quotes around the sed "instructions" use " so you get variable expansion, and not '.
                                    But you don't need to quote a string as long as it doesn't contain spaces.

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

                                      @Pete-S said in Setup Nextcloud 19.0.4 on Fedora 32:

                                      you don't need -e

                                      You just trying to fix all my old habits?

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

                                        @Pete-S said in Setup Nextcloud 19.0.4 on Fedora 32:

                                        @Pete-S said in Setup Nextcloud 19.0.4 on Fedora 32:

                                        @JaredBusch said in Setup Nextcloud 19.0.4 on Fedora 32:

                                        @Pete-S said in Setup Nextcloud 19.0.4 on Fedora 32:

                                        sudo sed -i -e 's/(^DocumentRoot\s*).*$/\1"/var/www/html/nextcloud"/' /etc/httpd/conf/httpd.conf

                                        Better sed. I removed the \s*

                                        1e498b1a-06b5-46f6-90a6-c7a3dee31f99-image.png

                                        I think you can simplify it way more.

                                        • you don't need -e
                                        • don't use the / separator, use for instance #. So s#expression#replacement#. Then you don't have to escape your paths. And then you can put your variables straight in.

                                        Don't think you need the sed script inside a quoted string either.

                                        Maybe something like this:

                                        sudo sed -i s#\(^DocumentRoot\).*$#\1$WWW_PATH/$APP_FOLDER# /etc/httpd/conf/httpd.conf
                                        

                                        If you want quotes around the sed "instructions" use " so you get variable expansion, and not '.
                                        But you don't need to quote a string as long as it doesn't contain spaces.

                                        I'll try it in a bit on my local test instance.

                                        I'm in the middle of migrating the CentOS 7 system to the Fedora 32 system that caused me to write this in the first place.

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

                                          Could not make it execute without the quotes
                                          But this works.

                                          sudo sed -i 's#\(^DocumentRoot\).*$#\1 "'"$WWW_PATH"'/'"$APP_FOLDER"'"#' /etc/httpd/conf/httpd.conf
                                          
                                          1 1 Reply Last reply Reply Quote 0
                                          • 1
                                            1337 @JaredBusch
                                            last edited by

                                            @JaredBusch said in Setup Nextcloud 19.0.4 on Fedora 32:

                                            @Pete-S said in Setup Nextcloud 19.0.4 on Fedora 32:

                                            @Pete-S said in Setup Nextcloud 19.0.4 on Fedora 32:

                                            @JaredBusch said in Setup Nextcloud 19.0.4 on Fedora 32:

                                            @Pete-S said in Setup Nextcloud 19.0.4 on Fedora 32:

                                            sudo sed -i -e 's/(^DocumentRoot\s*).*$/\1"/var/www/html/nextcloud"/' /etc/httpd/conf/httpd.conf

                                            Better sed. I removed the \s*

                                            1e498b1a-06b5-46f6-90a6-c7a3dee31f99-image.png

                                            I think you can simplify it way more.

                                            • you don't need -e
                                            • don't use the / separator, use for instance #. So s#expression#replacement#. Then you don't have to escape your paths. And then you can put your variables straight in.

                                            Don't think you need the sed script inside a quoted string either.

                                            Maybe something like this:

                                            sudo sed -i s#\(^DocumentRoot\).*$#\1$WWW_PATH/$APP_FOLDER# /etc/httpd/conf/httpd.conf
                                            

                                            If you want quotes around the sed "instructions" use " so you get variable expansion, and not '.
                                            But you don't need to quote a string as long as it doesn't contain spaces.

                                            I'll try it in a bit on my local test instance.

                                            I'm in the middle of migrating the CentOS 7 system to the Fedora 32 system that caused me to write this in the first place.

                                            Hmm, maybe you need some quotes anyway,

                                            The sed thing is really s#regexp#\1 /www/whatever# (using `# as delimiter).
                                            Where \1 tell sed to use the capture result of the first group which is "DocumentRoot".
                                            Then a space and then the new path.

                                            1 Reply Last reply Reply Quote 0
                                            • 1
                                            • 2
                                            • 3
                                            • 1 / 3
                                            • First post
                                              Last post