I'm trying to change an apache web service's root web directory /var/www/html
to my custom directory /mnt/webfiles
. However, after configuring the /etc/httpd/conf/httpd.conf
parameters and restarting httpd
, my test directory/files still cannot be browsed from webpage.
Here's the environment:
OS: CentOS 7.9.2009
Apache version: 2.4.6
The installation type of OS: Basic web server
The purpose of using the apache web is just for test and there's no specific domain name requirement on this server, just IP address for client to browse web.
When I use the default directory /var/www/html
to put test files, such as a simple .txt acting as simple webpage or a sub-directory download
with a file in it to simulate download page, every thing works just fine. The webpage can be browsed via browser.
But, after changing DocumentRoot "/var/www/html"
and Directory "/var/www"
to my specific directory /mnt/webfiles
, the test files/directories under /mnt/webfiles
can never be accessed and the error message showed on browser would be like:
Forbidden
You don't have permission to access /download/ on this server.
Only the default apache webpage can be browsed and not affected.
What I did was following the instrucitons from this post and this one,
By the way, the permission of the files/directorues all the way from the root directory of apache web is root:root
and 775
, basically same as the /var/www/html
.
I guess this is not the root cause.
Does anyone know why this happens?