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.5k
    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 @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
              1337 @JaredBusch
              last edited by

              @JaredBusch said in Setup Nextcloud 19.0.4 on Fedora 32:

              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
              

              OK try this then:

              sudo sed -i 's#\(^DocumentRoot\).*$#\1 '$WWW_PATH/$APP_FOLDER# /etc/httpd/conf/httpd.conf
              
              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:

                @JaredBusch said in Setup Nextcloud 19.0.4 on Fedora 32:

                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
                

                OK try this then:

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

                That is missing the " that need to be around the value. But did make me realize I did not need to do all the quoting around the / since I changed the delimeter.. habits

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

                47d7a0cd-466f-4ff8-9b41-7a2b81ae1e35-image.png

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

                  \"# also works to end it.

                  6198218f-2035-409b-86d6-983f5637123f-image.png

                  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:

                    @JaredBusch said in Setup Nextcloud 19.0.4 on Fedora 32:

                    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
                    

                    OK try this then:

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

                    That is missing the " that need to be around the value. But did make me realize I did not need to do all the quoting around the / since I changed the delimeter.. habits

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

                    47d7a0cd-466f-4ff8-9b41-7a2b81ae1e35-image.png

                    Starting to look pretty good I think.

                    I wonder about the ^DocumentRoot though. Apache don't need it to be the start of the line. There could be some whitespace first.

                    JaredBuschJ 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:

                      I wonder about the ^DocumentRoot though. Apache don't need it to be the start of the line. There could be some whitespace first.

                      That is because there are 3 instances in the file. But only that one matters.
                      d01fc01b-9f82-44b8-9939-1c293cbfd751-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:

                        I wonder about the ^DocumentRoot though. Apache don't need it to be the start of the line. There could be some whitespace first.

                        That is because there are 3 instances in the file. But only that one matters.
                        d01fc01b-9f82-44b8-9939-1c293cbfd751-image.png

                        I understand I'm just thinking about whitespace. It's very common to have indentation in the conf files. Especially when you are putting it under virtualhost.

                        Then the regex wont match but works fine in apache.

                        JaredBuschJ 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:

                          @JaredBusch said in Setup Nextcloud 19.0.4 on Fedora 32:

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

                          I wonder about the ^DocumentRoot though. Apache don't need it to be the start of the line. There could be some whitespace first.

                          That is because there are 3 instances in the file. But only that one matters.
                          d01fc01b-9f82-44b8-9939-1c293cbfd751-image.png

                          I understand I'm just thinking about whitespace. It's very common to have indentation in the conf files. Especially when you are putting it under virtualhost.

                          This is not in a vhost. this is the main apache config file. Assumption is a single purpose server. anything else is advanced beyond this guide.

                          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:

                            @JaredBusch said in Setup Nextcloud 19.0.4 on Fedora 32:

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

                            I wonder about the ^DocumentRoot though. Apache don't need it to be the start of the line. There could be some whitespace first.

                            That is because there are 3 instances in the file. But only that one matters.
                            d01fc01b-9f82-44b8-9939-1c293cbfd751-image.png

                            I understand I'm just thinking about whitespace. It's very common to have indentation in the conf files. Especially when you are putting it under virtualhost.

                            This is not in a vhost. this is the main apache config file. Assumption is a single purpose server. anything else is advanced beyond this guide.

                            Yeah, makes sense.

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

                              @JaredBusch

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

                              I wonder if the capture group is actually worth it. You're just capturing the static "DocumentRoot".
                              It's much cleaner without it and less escaping and quoting.

                              sudo sed -i "s#^DocumentRoot.*$#DocumentRoot $WWW_PATH/$APP_FOLDER#" /etc/httpd/conf/httpd.conf
                              

                              Never mind, not much of an improvement.

                              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:

                                @JaredBusch

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

                                I wonder if the capture group is actually worth it. You're just capturing the static "DocumentRoot".
                                It's much cleaner without it and less escaping and quoting.

                                sudo sed -i "s#^DocumentRoot.*$#DocumentRoot $WWW_PATH/$APP_FOLDER#" /etc/httpd/conf/httpd.conf
                                

                                ee801eea-6087-437c-93a7-2e66d5bea864-image.png

                                and you are still missing the point that the default file has double quotes around it.
                                required or not, if it is the default format, I will keep it.

                                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:

                                  @JaredBusch

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

                                  I wonder if the capture group is actually worth it. You're just capturing the static "DocumentRoot".
                                  It's much cleaner without it and less escaping and quoting.

                                  sudo sed -i "s#^DocumentRoot.*$#DocumentRoot $WWW_PATH/$APP_FOLDER#" /etc/httpd/conf/httpd.conf
                                  

                                  ee801eea-6087-437c-93a7-2e66d5bea864-image.png

                                  Ah, it's the regexp.
                                  OK, last chance:

                                  sudo sed -i 's#^DocumentRoot.*$#DocumentRoot '$WWW_PATH/$APP_FOLDER# /etc/httpd/conf/httpd.conf
                                  
                                  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:

                                    @JaredBusch said in Setup Nextcloud 19.0.4 on Fedora 32:

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

                                    @JaredBusch

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

                                    I wonder if the capture group is actually worth it. You're just capturing the static "DocumentRoot".
                                    It's much cleaner without it and less escaping and quoting.

                                    sudo sed -i "s#^DocumentRoot.*$#DocumentRoot $WWW_PATH/$APP_FOLDER#" /etc/httpd/conf/httpd.conf
                                    

                                    ee801eea-6087-437c-93a7-2e66d5bea864-image.png

                                    Ah, it's the regexp.
                                    OK, last chance:

                                    sudo sed -i 's#^DocumentRoot.*$#DocumentRoot '$WWW_PATH/$APP_FOLDER# /etc/httpd/conf/httpd.conf
                                    

                                    That is the same as I have above, less the double quotes around the file path. Well and capture group

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

                                      The top post has been edited to now include the pretty URL and self signed SSL

                                      HTTPS only. HTTP not open on the firewall.

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

                                        @JaredBusch said in Setup Nextcloud 19.0.4 on Fedora 32:

                                        The top post has been edited to now include the pretty URL and self signed SSL

                                        HTTPS only. HTTP not open on the firewall.

                                        I just followed these through start to finish.
                                        Copy/Paste only.

                                        b0dc6866-d819-44ef-b235-f268760cfa1d-image.png

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

                                          Just did this today, except I used Fedora 36 and latest Nextcloud instead of 19.0.4

                                          wget https://download.nextcloud.com/server/releases/latest.tar.bz2
                                          

                                          f41ac0fb-3e04-4d22-8626-47f950adc94d-image.png

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

                                            You can clear the phone warning by putting this in your /var/www/html/nextcloud/config/config.php file. Obviously change the Country Cody appropriately.
                                            https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements

                                            'default_phone_region' => 'US',
                                            
                                            1 Reply Last reply Reply Quote 0
                                            • 1
                                            • 2
                                            • 3
                                            • 2 / 3
                                            • First post
                                              Last post