Mobile app version of vmapp.org
Login or Join
Margaret670

: 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

@Margaret670

Posted in: #Apache

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!

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Margaret670

1 Comments

Sorted by latest first Latest Oldest Best

 

@Margaret670

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.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme