Apache configuration: 403 Forbidden Permission / Document Root












0















I installed LAMP on Fedora 15. I tried to change the DocumentRoot to /home/USER/www, I changed it in the config file. Though it gave me 403 Forbidden error when i try to access the localhost.



How can I solve this issue ?










share|improve this question





























    0















    I installed LAMP on Fedora 15. I tried to change the DocumentRoot to /home/USER/www, I changed it in the config file. Though it gave me 403 Forbidden error when i try to access the localhost.



    How can I solve this issue ?










    share|improve this question



























      0












      0








      0








      I installed LAMP on Fedora 15. I tried to change the DocumentRoot to /home/USER/www, I changed it in the config file. Though it gave me 403 Forbidden error when i try to access the localhost.



      How can I solve this issue ?










      share|improve this question
















      I installed LAMP on Fedora 15. I tried to change the DocumentRoot to /home/USER/www, I changed it in the config file. Though it gave me 403 Forbidden error when i try to access the localhost.



      How can I solve this issue ?







      fedora apache-http-server






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 23 '15 at 23:19









      JakeGould

      31.5k1096138




      31.5k1096138










      asked Aug 21 '11 at 1:19









      HamzaHamza

      10112




      10112






















          3 Answers
          3






          active

          oldest

          votes


















          0














          You have changed the DocumentRoot setting but have not amended the associated <Directory> and / or <Location> tags in the configuration to allow access to the new location. Amend the paths within the appropriate tags and restart Apache and you'll be fine. See the Apache Manual for details.






          share|improve this answer
























          • i changed the DocumentRoot "/home/USER/www" & restart apache but still giving the same Error

            – Hamza
            Aug 21 '11 at 7:10











          • You still need to change the existing <Directory> and / or <Location> settings too, just changing the DocumentRoot is not enough.

            – Mike Insch
            Aug 21 '11 at 12:49



















          0














          Did you make /home/USER/www/ world viewable?
          If apache tries to visit your new Document Root it might not have permission to view it.



          chmod 711 /home/USER
          chmod 755 /home/USER/www
          chmod 644 /home/USER/www/*





          share|improve this answer































            0














            The pretty way would be to edit



            /etc/httpd/conf/httpd.conf


            and have apache run as user 'USER' instead of user 'apache'. Since you want to have your files there it makes sense doesn't it?



            It makes more sense than fiddling with chmod permissions which might end up creating more problems than solutions. I once chmoded the /home folder recursively on an aws ec2 instance to grant permissions to apache and then could not ssh into it anymore because of wrong permissions on my keys...






            share|improve this answer
























            • you point the fact of making sense, but does it have any impact globally or locally? what else does change resulting from this change? please be as clear as possible.

              – Lorenzo Von Matterhorn
              Mar 16 '13 at 0:09











            • Well obviously if he puts his pages in USER's directory he might as well have them executed with USER's permissions... I reckon when he does his testing he's logged in as USER as well

              – Homezar
              Mar 16 '13 at 0:32











            • i hope you understand its not for my sake i asked the above, but for future readers.

              – Lorenzo Von Matterhorn
              Mar 16 '13 at 0:33











            • :) I know, and to answer I don't see any potential downfall of this method but I might be wrong

              – Homezar
              Mar 16 '13 at 0:45











            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "3"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f325788%2fapache-configuration-403-forbidden-permission-document-root%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            3 Answers
            3






            active

            oldest

            votes








            3 Answers
            3






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            You have changed the DocumentRoot setting but have not amended the associated <Directory> and / or <Location> tags in the configuration to allow access to the new location. Amend the paths within the appropriate tags and restart Apache and you'll be fine. See the Apache Manual for details.






            share|improve this answer
























            • i changed the DocumentRoot "/home/USER/www" & restart apache but still giving the same Error

              – Hamza
              Aug 21 '11 at 7:10











            • You still need to change the existing <Directory> and / or <Location> settings too, just changing the DocumentRoot is not enough.

              – Mike Insch
              Aug 21 '11 at 12:49
















            0














            You have changed the DocumentRoot setting but have not amended the associated <Directory> and / or <Location> tags in the configuration to allow access to the new location. Amend the paths within the appropriate tags and restart Apache and you'll be fine. See the Apache Manual for details.






            share|improve this answer
























            • i changed the DocumentRoot "/home/USER/www" & restart apache but still giving the same Error

              – Hamza
              Aug 21 '11 at 7:10











            • You still need to change the existing <Directory> and / or <Location> settings too, just changing the DocumentRoot is not enough.

              – Mike Insch
              Aug 21 '11 at 12:49














            0












            0








            0







            You have changed the DocumentRoot setting but have not amended the associated <Directory> and / or <Location> tags in the configuration to allow access to the new location. Amend the paths within the appropriate tags and restart Apache and you'll be fine. See the Apache Manual for details.






            share|improve this answer













            You have changed the DocumentRoot setting but have not amended the associated <Directory> and / or <Location> tags in the configuration to allow access to the new location. Amend the paths within the appropriate tags and restart Apache and you'll be fine. See the Apache Manual for details.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Aug 21 '11 at 2:08









            Mike InschMike Insch

            2,263118




            2,263118













            • i changed the DocumentRoot "/home/USER/www" & restart apache but still giving the same Error

              – Hamza
              Aug 21 '11 at 7:10











            • You still need to change the existing <Directory> and / or <Location> settings too, just changing the DocumentRoot is not enough.

              – Mike Insch
              Aug 21 '11 at 12:49



















            • i changed the DocumentRoot "/home/USER/www" & restart apache but still giving the same Error

              – Hamza
              Aug 21 '11 at 7:10











            • You still need to change the existing <Directory> and / or <Location> settings too, just changing the DocumentRoot is not enough.

              – Mike Insch
              Aug 21 '11 at 12:49

















            i changed the DocumentRoot "/home/USER/www" & restart apache but still giving the same Error

            – Hamza
            Aug 21 '11 at 7:10





            i changed the DocumentRoot "/home/USER/www" & restart apache but still giving the same Error

            – Hamza
            Aug 21 '11 at 7:10













            You still need to change the existing <Directory> and / or <Location> settings too, just changing the DocumentRoot is not enough.

            – Mike Insch
            Aug 21 '11 at 12:49





            You still need to change the existing <Directory> and / or <Location> settings too, just changing the DocumentRoot is not enough.

            – Mike Insch
            Aug 21 '11 at 12:49













            0














            Did you make /home/USER/www/ world viewable?
            If apache tries to visit your new Document Root it might not have permission to view it.



            chmod 711 /home/USER
            chmod 755 /home/USER/www
            chmod 644 /home/USER/www/*





            share|improve this answer




























              0














              Did you make /home/USER/www/ world viewable?
              If apache tries to visit your new Document Root it might not have permission to view it.



              chmod 711 /home/USER
              chmod 755 /home/USER/www
              chmod 644 /home/USER/www/*





              share|improve this answer


























                0












                0








                0







                Did you make /home/USER/www/ world viewable?
                If apache tries to visit your new Document Root it might not have permission to view it.



                chmod 711 /home/USER
                chmod 755 /home/USER/www
                chmod 644 /home/USER/www/*





                share|improve this answer













                Did you make /home/USER/www/ world viewable?
                If apache tries to visit your new Document Root it might not have permission to view it.



                chmod 711 /home/USER
                chmod 755 /home/USER/www
                chmod 644 /home/USER/www/*






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Aug 21 '11 at 9:57









                suwellersuweller

                39726




                39726























                    0














                    The pretty way would be to edit



                    /etc/httpd/conf/httpd.conf


                    and have apache run as user 'USER' instead of user 'apache'. Since you want to have your files there it makes sense doesn't it?



                    It makes more sense than fiddling with chmod permissions which might end up creating more problems than solutions. I once chmoded the /home folder recursively on an aws ec2 instance to grant permissions to apache and then could not ssh into it anymore because of wrong permissions on my keys...






                    share|improve this answer
























                    • you point the fact of making sense, but does it have any impact globally or locally? what else does change resulting from this change? please be as clear as possible.

                      – Lorenzo Von Matterhorn
                      Mar 16 '13 at 0:09











                    • Well obviously if he puts his pages in USER's directory he might as well have them executed with USER's permissions... I reckon when he does his testing he's logged in as USER as well

                      – Homezar
                      Mar 16 '13 at 0:32











                    • i hope you understand its not for my sake i asked the above, but for future readers.

                      – Lorenzo Von Matterhorn
                      Mar 16 '13 at 0:33











                    • :) I know, and to answer I don't see any potential downfall of this method but I might be wrong

                      – Homezar
                      Mar 16 '13 at 0:45
















                    0














                    The pretty way would be to edit



                    /etc/httpd/conf/httpd.conf


                    and have apache run as user 'USER' instead of user 'apache'. Since you want to have your files there it makes sense doesn't it?



                    It makes more sense than fiddling with chmod permissions which might end up creating more problems than solutions. I once chmoded the /home folder recursively on an aws ec2 instance to grant permissions to apache and then could not ssh into it anymore because of wrong permissions on my keys...






                    share|improve this answer
























                    • you point the fact of making sense, but does it have any impact globally or locally? what else does change resulting from this change? please be as clear as possible.

                      – Lorenzo Von Matterhorn
                      Mar 16 '13 at 0:09











                    • Well obviously if he puts his pages in USER's directory he might as well have them executed with USER's permissions... I reckon when he does his testing he's logged in as USER as well

                      – Homezar
                      Mar 16 '13 at 0:32











                    • i hope you understand its not for my sake i asked the above, but for future readers.

                      – Lorenzo Von Matterhorn
                      Mar 16 '13 at 0:33











                    • :) I know, and to answer I don't see any potential downfall of this method but I might be wrong

                      – Homezar
                      Mar 16 '13 at 0:45














                    0












                    0








                    0







                    The pretty way would be to edit



                    /etc/httpd/conf/httpd.conf


                    and have apache run as user 'USER' instead of user 'apache'. Since you want to have your files there it makes sense doesn't it?



                    It makes more sense than fiddling with chmod permissions which might end up creating more problems than solutions. I once chmoded the /home folder recursively on an aws ec2 instance to grant permissions to apache and then could not ssh into it anymore because of wrong permissions on my keys...






                    share|improve this answer













                    The pretty way would be to edit



                    /etc/httpd/conf/httpd.conf


                    and have apache run as user 'USER' instead of user 'apache'. Since you want to have your files there it makes sense doesn't it?



                    It makes more sense than fiddling with chmod permissions which might end up creating more problems than solutions. I once chmoded the /home folder recursively on an aws ec2 instance to grant permissions to apache and then could not ssh into it anymore because of wrong permissions on my keys...







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Mar 15 '13 at 23:42









                    HomezarHomezar

                    1012




                    1012













                    • you point the fact of making sense, but does it have any impact globally or locally? what else does change resulting from this change? please be as clear as possible.

                      – Lorenzo Von Matterhorn
                      Mar 16 '13 at 0:09











                    • Well obviously if he puts his pages in USER's directory he might as well have them executed with USER's permissions... I reckon when he does his testing he's logged in as USER as well

                      – Homezar
                      Mar 16 '13 at 0:32











                    • i hope you understand its not for my sake i asked the above, but for future readers.

                      – Lorenzo Von Matterhorn
                      Mar 16 '13 at 0:33











                    • :) I know, and to answer I don't see any potential downfall of this method but I might be wrong

                      – Homezar
                      Mar 16 '13 at 0:45



















                    • you point the fact of making sense, but does it have any impact globally or locally? what else does change resulting from this change? please be as clear as possible.

                      – Lorenzo Von Matterhorn
                      Mar 16 '13 at 0:09











                    • Well obviously if he puts his pages in USER's directory he might as well have them executed with USER's permissions... I reckon when he does his testing he's logged in as USER as well

                      – Homezar
                      Mar 16 '13 at 0:32











                    • i hope you understand its not for my sake i asked the above, but for future readers.

                      – Lorenzo Von Matterhorn
                      Mar 16 '13 at 0:33











                    • :) I know, and to answer I don't see any potential downfall of this method but I might be wrong

                      – Homezar
                      Mar 16 '13 at 0:45

















                    you point the fact of making sense, but does it have any impact globally or locally? what else does change resulting from this change? please be as clear as possible.

                    – Lorenzo Von Matterhorn
                    Mar 16 '13 at 0:09





                    you point the fact of making sense, but does it have any impact globally or locally? what else does change resulting from this change? please be as clear as possible.

                    – Lorenzo Von Matterhorn
                    Mar 16 '13 at 0:09













                    Well obviously if he puts his pages in USER's directory he might as well have them executed with USER's permissions... I reckon when he does his testing he's logged in as USER as well

                    – Homezar
                    Mar 16 '13 at 0:32





                    Well obviously if he puts his pages in USER's directory he might as well have them executed with USER's permissions... I reckon when he does his testing he's logged in as USER as well

                    – Homezar
                    Mar 16 '13 at 0:32













                    i hope you understand its not for my sake i asked the above, but for future readers.

                    – Lorenzo Von Matterhorn
                    Mar 16 '13 at 0:33





                    i hope you understand its not for my sake i asked the above, but for future readers.

                    – Lorenzo Von Matterhorn
                    Mar 16 '13 at 0:33













                    :) I know, and to answer I don't see any potential downfall of this method but I might be wrong

                    – Homezar
                    Mar 16 '13 at 0:45





                    :) I know, and to answer I don't see any potential downfall of this method but I might be wrong

                    – Homezar
                    Mar 16 '13 at 0:45


















                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Super User!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f325788%2fapache-configuration-403-forbidden-permission-document-root%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    flock() on closed filehandle LOCK_FILE at /usr/bin/apt-mirror

                    Mangá

                    Eduardo VII do Reino Unido