Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
i currently have a website hosted with apache2. (all goes fine). However i would like to display a directory listing(a separate page).
For example. When someone clicks on a link for an html page it takes them to a page which displays all the files in a folder/directory that are available for download.(would this be an ftp? or something else?)
them to a page which displays all the files in a folder/directory that are available for download.(would this be an ftp? or something else?)
Apache can do a directory listing automatically, so your users can click on a filename on that listing to d/l the file. To do this there must be no index page in that directory and depending on your apache configuration you might need to add Indexes among the other options:
Code:
<Directory "/path/to/somedir">
Options Indexes
Allow from all
...
</Directory>
If it has to be a html page, a bit of PHP code will do the trick (if you have configured apache to use PHP)
Else you should be able to configure apache so it displays the contents of a directory (although I can not remember how) instead of a default page.
I'm not sure on php.. i'll have to learn that. (it's about time anyway).
However i have a default page in my virtual host (a module from memory). Would i need to move that module to the inside of my <directory /path to website files> as it's currently not in that section
I'm not sure what you mean by default page. If you mean an index page, then the file listing will not work because apache will use that page instead of showing the contents of the directory.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.