Overclock.net › Forums › Specialty Builds › Servers › .htaccess file not working
New Posts  All Forums:Forum Nav:

.htaccess file not working

post #1 of 3
Thread Starter 
So I just installed an Ubuntu 7.1 LAMP server, and I everything is working but my .htaccess file. It does not do anything. When I navigate to the directory it is in nothing happens.

/var/www/private/.htaccess
Code:
AuthUserFile /var/secure/.htpasswd
AuthName EnterPassword
AuthType Basic
Require valid-user
/var/secure/.htpasswd
Code:
name:encryped password
I have uploaded these files to another web host and they have worked. So I am thinking it has something to do with how apache is configured. Any ideas?
post #2 of 3
Thread Starter 
Taken from /etc/apache2/apache2.conf
Code:
# AccessFileName: The name of the file to look for in each directory
# for additional configuration directives.  See also the AllowOverride
# directive.
#

AccessFileName .htaccess

#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<Files ~ "^.ht">
    Order allow,deny
    Deny from all
</Files>
I am confused.
post #3 of 3
Try navigating to /var/www/private/ and run the htpasswd command in there to create the .htpasswd file. Set the .htaccess file to point to the .htpasswd file in that same directory. It is possible that there may be a permissions issue with the /var/www/secure directory.

So your .htaccess would look like:
Code:
AuthUserFile /var/private/.htpasswd
AuthName EnterPassword
AuthType Basic
Require valid-user
I would double check your directory entries in apache2.conf and make sure you have them set up correctly.
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Servers
Overclock.net › Forums › Specialty Builds › Servers › .htaccess file not working