Directory Listing

April 30, 2017 1.5k views
Apache Ubuntu 16.04

Hey guys so i have a directory listing website but i want to add users and i want to know is it possible to limit other users from accessing specific directorys in the website?

1 Answer

Hi @SirReaper
So you’re just using the builtin feature of Apache for directory listing? Meaning, you’re not running some application like WordPress/etc.
Then you can use the .htpasswd to put restrictions on the directories you want.
There’s a little tutorial for using .htaccess in conjuction with .htpasswd:

by Etel Sverdlov
This tutorial covers five common uses for the .htaccess file. These include: Mod_Rewrite, Authentication, Custom Error Pages, Mime Types, and Server Side Includes.
  • Ive already set one up so when people type the IP it asks them for it before they can even look at the directory but can i make another one?

    • @SirReaper
      You simply put the .htaccess and .htpasswd in the other directory you want to limit even further. And of course change the username/password.

      • Okay nice. Last thign is it possible for me to enable some sort of ddos protection for the web directory like cloudfare? or is it not possible for web directorys.

        • It makes no difference if it’s a directory listing or a website, if you have activated CloudFlare, all traffic will go thru them and they will try to protect against DDoS.

Have another answer? Share your knowledge.