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?

user1765369
  • 123
  • 2
  • Is there a /etc/apache2/.htpasswd ? – Rinzwind May 21 '14 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 '14 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 '14 at 10:20
  • @bigbadonk420 that's what I'm trying to do im afraid – user1765369 May 21 '14 at 14:42
  • Maybe directory listing is completely disabled in Apache? See http://www.linuxscrew.com/2008/06/03/faq-how-to-disable-directory-browsing-in-apachehttpd/ – pzkpfw May 22 '14 at 15:11

1 Answers1

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.

Abdul Kadir
  • 333
  • 1
  • 9