Author |
|
vkishan@gmail.com
Joined: 03 Apr 2019 Posts: 1 Location: India
|
Posted: Thu 04 Apr '19 5:03 Post subject: httpd-cent0S-unable to access mount fld /dev/xvdb/myfolder |
|
|
Hi,
I have an AWS EC2 instance having httpd. Added Elastic Block Storage to this instance.
OS : CentOS 7.
Created mount volume
mount /dev/xvdb /var/www/html/myfolder
loaded my simple index.html
Failed with permission issue. In the conf I tried giving symlinks. Gave chmod 777 -R to html folder. But no luck
wondering whatelse is causing an issue. |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Mon 08 Apr '19 20:31 Post subject: |
|
|
Did you add a <Directory "/var/www/html/"> directive to your apache config? |
|
Back to top |
|
d.azartash
Joined: 26 Oct 2020 Posts: 3 Location: Tehran
|
Posted: Wed 28 Oct '20 6:58 Post subject: permission issue |
|
|
James Blond wrote: | Did you add a <Directory "/var/www/html/"> directive to your Apache config? |
I have the same issue and by default the directive exist in my Apache config. Apache indexes the directory when I dismount the drive but when the drive is mounted the issue appears.
Apache/2.4.37
CentOS Linux 8 (Core)
error_log:
[autoindex:error] [pid 14826:tid 139878880728832] (13)Permission denied: [client 10.211.1.99:44336] AH01275: Can't open directory for index: /var/www/html/
access_log:
"GET /7/repodata/repomd.xml HTTP/1.1" 404 219 "-" "libdnf"
"GET /7/repodata/repomd.xml HTTP/1.1" 404 219 "-" "libdnf/0.22.4"
"GET / HTTP/1.1" 403 209 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0" |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
|
Back to top |
|
d.azartash
Joined: 26 Oct 2020 Posts: 3 Location: Tehran
|
Posted: Wed 28 Oct '20 14:01 Post subject: |
|
|
I applied the chown and chmod commands with -R operator and different users on the other disk but it won't fix the problem.
ls -l /var/www/html/
drwxrwxrwx. 3 apache apache 4096 Oct 14 11:13
httpd config:
<Directory />
AllowOverride none
Require all denied
</Directory>
DocumentRoot "/var/www/html"
<Directory "/var/www">
AllowOverride None
Require all granted
</Directory>
<Directory "/var/www/html">
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory> |
|
Back to top |
|
d.azartash
Joined: 26 Oct 2020 Posts: 3 Location: Tehran
|
Posted: Sat 21 Nov '20 14:11 Post subject: solution |
|
|
I found the solution for this problem and it's derived from SELinux context and you must change the context before it can allow the access.
The following command resolve the problem:
chcon -Rt httpd_sys_content_t [target directory]
e.g.:
chcon -Rt httpd_sys_content_t /var/www/html |
|
Back to top |
|