.htaccess no effect

Posted on 2012-08-21
Last Modified: 2012-08-22
My goal is to password protect site:
(site is avaible in /var/www)

I have put an .htaccess into /var/www/.htaccess

here is the content:
Authname "login"
AuthUserFile /var/www/.htpasswd
AuthType Basic
require valid-user

Open in new window

I have the mod rewrite enable as shown in:

Loaded Modules       core mod_log_config mod_logio prefork http_core mod_so mod_actions mod_alias mod_auth_basic mod_authn_file mod_authz_default mod_authz_groupfile mod_authz_host mod_authz_user mod_autoindex mod_cgi mod_deflate mod_dir mod_env mod_fcgid mod_include mod_mime mod_negotiation mod_php5 mod_reqtimeout mod_rewrite mod_setenvif mod_ssl mod_status mod_suexec mod_suphp

and NOTHING: it seems .htaccess has no effect at all

What am I doing wrong ?
Question by:proxymis
    LVL 3

    Expert Comment

    Do you have access to the server's configuration files? If so, this should be done there instead. If not, processing of the .htaccess files may be disabled with an AllowOverride directive which could be the cause of this not working.

    Author Comment

    yes I have ROOT access to server: what should I do ?
    LVL 3

    Accepted Solution

    Go into your httpd.conf file (or your virtual directory file, whichever defines your main directory) and move the text from your .htaccess file into this file under the <Directory> tag. This will give the same effect, but you won't have to worry about whether .htaccess files are being processed or not. It will also not slow down your Apache server as much.

    Also, make sure to move your password file out of your root web directory. Even though it isn't accessible, it is best to not keep it in a web-accessible directory. Here is the Apache doc on authentication that gives tips on authentication and authorization:

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    DNS Question 7 44
    Apache server crashes randomly 38 105
    HTTPS Redirect Problem 17 57
    Zipping many files freeze my whole server through php 5 31
    Over the last year I have answered a couple of basic URL rewriting questions several times so I thought I might as well have a stab at: explaining the basics, providing a few useful links and consolidating some of the most common queries into a sing…
    Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    731 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now