2

At some point I pw protected /var/www/ for security purposes (my actual hosted websites are located in a different path), now I would like to host something publicly in /var/www/ but do not know how to remove the pw protection. There is no .htaccess file present in the directory or the parent.

What other ways could the directory be protected? Some sort of apache config file?

5
  • Is there a /etc/apache2/.htpasswd ?
    – Rinzwind
    May 21, 2014 at 10:04
  • by the way: I assumed "pw protected /var/www/' we are talking protection from a browser seeing the contents of a dir and not that you are not allowed putting files in /var/www/ yourself from command line?
    – Rinzwind
    May 21, 2014 at 10:10
  • If listing /var/www is forbidden (good idea), surely you could solve it by creating /var/www/foo and list that directory? The block is not recursive, is it?
    – pzkpfw
    May 21, 2014 at 10:20
  • @bigbadonk420 that's what I'm trying to do im afraid May 21, 2014 at 14:42
  • Maybe directory listing is completely disabled in Apache? See linuxscrew.com/2008/06/03/…
    – pzkpfw
    May 22, 2014 at 15:11

1 Answer 1

1

You should make some changes in your apache configuration file.

Open Terminal

 sudo vim /etc/apache2/sites-available/default 
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
allow from all
</Directory>

Make changes in AllowOverride None As.

<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>

Now your apache will not recognize .htaccess files in your system.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .