logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: httpd-cent0S-unable to access mount fld /dev/xvdb/myfolder
Author
vkishan@gmail.com



Joined: 03 Apr 2019
Posts: 1
Location: India

PostPosted: Thu 04 Apr '19 5:03    Post subject: httpd-cent0S-unable to access mount fld /dev/xvdb/myfolder Reply with quote

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: 7294
Location: Germany, Next to Hamburg

PostPosted: Mon 08 Apr '19 20:31    Post subject: Reply with quote

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

PostPosted: Wed 28 Oct '20 6:58    Post subject: permission issue Reply with quote

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: 7294
Location: Germany, Next to Hamburg

PostPosted: Wed 28 Oct '20 13:14    Post subject: Reply with quote

please post the relevant parts of your config or use a pastbin, http://apaste.info/ or http://hastebin.com/

chmod?
Back to top
d.azartash



Joined: 26 Oct 2020
Posts: 3
Location: Tehran

PostPosted: Wed 28 Oct '20 14:01    Post subject: Reply with quote

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

PostPosted: Sat 21 Nov '20 14:11    Post subject: solution Reply with quote

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


Reply to topic   Topic: httpd-cent0S-unable to access mount fld /dev/xvdb/myfolder View previous topic :: View next topic
Post new topic   Forum Index -> Apache