Wednesday, May 8, 2024
 Popular · Latest · Hot · Upcoming
137
rated 0 times [  137] [ 0]  / answers: 1 / hits: 311186  / 3 Years ago, mon, august 9, 2021, 8:37:26

I know this question is asked a lot, but the solutions I saw didn't work for me.



I only have one virtual host enabled, and I'm trying to enable access to a folder that's not under the document root



ServerAdmin webmaster@localhost
DocumentRoot /var/www/html

Alias /movies /home/username/Videos/Movies

<Directory /home/username/Videos/Movies/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>


I set /etc/apache2/envvars as follows



export APACHE_RUN_USER=www-data
export APACHE_RUN_GROUP=public


I made sure that /home/username/Videos/ and its sub folders are owned by username:public, set the permissions to 777 (after 775 didn't work) and made sure that user www-data belongs to group public.



Now, when I browse to http://localhost/movies I get



[Mon Apr 21 11:28:14.971844 2014] [core:error] [pid 1385:tid 140067725104896] (13)Permission denied: [client 127.0.0.1:46603] AH00035: access to /movies/ denied (filesystem path '/home/username/Videos') because search permissions are missing on a component of the path


But when I set /etc/apache2/envvars to run Apache under username (my own username) everything works fine. The problem is permission related, but I don't see how in my case; especially when I set the permissions to 777. Any ideas?



P.S. Ubuntu version is 14.04, Apache is 2.4.7 and I didn't edit other configuration files.


More From » permissions

 Answers
1

Do a chmod +x on your user dir, and restart apache. 755 permissions should work. I've had problems with 644.


* Note that as of Ubuntu 22.04 the user dir has 750 permissions by default rather than 755.


[#25833] Monday, August 9, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
nsuainner

Total Points: 141
Total Questions: 102
Total Answers: 109

Location: Maldives
Member since Sat, Jan 29, 2022
2 Years ago
;