: How to display directory structure in public_html? I just set up apache and was able to get a site running. I want to use user directories in /home/*/public_html to display some data so a
I just set up apache and was able to get a site running. I want to use user directories in /home/*/public_html to display some data so a collaborator can download stuff I put on the user directory.
I uncomment the http-userdir.conf part in the main httpd.conf file and it was working. However, I can only see the contents of a file in the user directory instead of seeing the list of files. i.e. if I have a file called file.txt that has 'hello world' in it and it's path is /site_url/data/file.txt. when I put this whole path on a web browser, I can see 'hello world'. But when I use /site_url/data, it says "The requested URL /site_url/data/ was not found on this server." The permission for everything under public_html is 755.
Here is the http-userdir.conf file.
10 UserDir public_html
11
12 #
13 # Control access to UserDir directories. The following is an example
14 # for a site where these directories are restricted to read-only.
15 #
16 <Directory "/home/*/public_html">
17 AllowOverride FileInfo AuthConfig Limit Indexes
18 Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
19 Require method GET POST OPTIONS
20 </Directory>
Which option should I change to make it display files in directories under public_html?
Thanks!
More posts by @Margaret670
1 Comments
Sorted by latest first Latest Oldest Best
OK. I found an answer. I read from the apache doc:
wiki.apache.org/httpd/DirectoryListings
If no file from the DirectoryIndex directive can be located in the directory, then mod_autoindex can generate a listing of the directory contents. This is turned on and off using the Options directive.
So I uncomment the mod_autoindex load module line in httpd.conf and now the directory listing works.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.