Ubuntu [SOLVED]: Apache error 403 after redirecting Apache to /media/… path

Ubuntu [SOLVED]: Apache error 403 after redirecting Apache to /media/… path

Home Forums Ubuntu Ubuntu [SOLVED]: Apache error 403 after redirecting Apache to /media/… path

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #36847

    Anonymous

    QuestionQuestion

    When moving files from my main disk (where the OS is installed), to a second disk (other storage), I am trying to redirect Apache to the new disk, but this returns error number 403. I am running Ubuntu 16.04.

    I originally redirected Apache to /home/user/Documents by adding the following lines to corresponding files:

    in /etc/apache2/apache2.conf

    <Directory /home/jawa/Documents/>
    #<Directory /media/jawa/R2D2/Webpages>
            Options Indexes FollowSymLinks
            AllowOverride None
            Require all granted
    </Directory>
    

    and in /etc/apache2/sites-enabled/000-default.conf

    DocumentRoot /home/jawa/Documents
    #DocumentRoot /media/jawa/R2D2/Webpages 
    

    This worked fine, but since I have moved the files to a new location, I must also redirect Apache.
    When trying to redirect Apache to /media/jawa/R2D2/Webpages, I toggle the above comments and restart apache using sudo service apache2 restart. Visiting localhost in the browser returns error 403 and using the command cat /var/log/apache2/error.log gives the following log:

    [Wed Dec 27 17:24:48.583062 2017] [core:error] [pid 22343] (13)Permission denied: [client ::1:35704] AH00035: access to / denied (filesystem path '/media/jawa/R2D2') because search permissions are missing on a component of the path
    

    Permissions and owners of both folders:

    drwxr-xr-x 2 jawa jawa 4096 dec 27 17:12 Documents
    drwxrwxrwx 1 jawa jawa       0 dec 27 16:46 Webpages
    

    What is causing the error and how can it be fixed?

    #36848

    Anonymous

    Accepted AnswerAnswer

    Since we know one works and the other does not, list the permissions of both the folder structures :

     ls -ld /home/ /home/jawa /home/jawa/Documents 
     ls -ld /media/ /media/jawa/ /media/jawa/R2D2 /media/jawa/R2D2/Webpages
    

    Once listed compare the two.
    The default permissions are controlled by umask and this could result in the permissions being different.

    Source: https://stackoverflow.com/questions/47995609/apache-error-403-after-redirecting-apache-to-media-path
    Author: user
    Creative Commons License
    This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.