jasonbarak
Registered
I have been trying to setup htaccess for some time now. I've read all threads on this website and even on Apple's site, but there are many conflicting listings.
I'm currently using OSX 10.1.4 and this is what I found - all advice welcome:
1. even after making edits to the httpd.conf file to change the line "AllowOverride None" to "AllowOverride All" or "AllowOverride AuthConfig" and restarting Apache, htaccess did not work. I changed the location of the .htpasswd file and no luck. I recreated the .ht files while I was logged in as root, no luck. The web pages loaded, but no login check was asked for.
2. I then reverted my http.conf file back to pre-htaccess attempts and then removed all the .htaccess and .htpasswd files I made.
Then using advise I had read, I made edits to my username.conf file in the <b>/etc/httpd/users/</b> directory. The edits to this file seem to add the lines usually found in an .htaccess file. I also created a new htpasswd file.
Here are the lines from the username.conf file:
<Directory "/Users/username/Sites/directory/subdirectory/">
AuthType Basic
AuthName "Need Access Name"
AuthUserFile "/Users/username/.htpasswd"
Require valid-user
Options -Indexes
AllowOverride None
Order allow,deny
Allow from all
</Directory>
Now when I typed in my url: <b>XXX.XX.XX.X/~username/directory/subdirectory</b>, I was presented with pop-up access window. Great. Access granted.
This was great and all, but I'd rather use a .htaccess file. Any advice? Is the username.conf file overriding any .htaccess file that might exist?
3. Continuing on, I also use dnydns and virtual name hosting. So, the next step was to check the access with my url: <b>myweb.dyndns.org/directory</b> and no dice. The index file loaded, but no username or password was asked for. So it seems that Apache is not checking the access when a virtual host name is used.
I realize that the above is a bit thin in details, but anyone who knows about this subject can surely understand where I'm going. Any advice with this matter would be of great help.
------
I'm currently using OSX 10.1.4 and this is what I found - all advice welcome:
1. even after making edits to the httpd.conf file to change the line "AllowOverride None" to "AllowOverride All" or "AllowOverride AuthConfig" and restarting Apache, htaccess did not work. I changed the location of the .htpasswd file and no luck. I recreated the .ht files while I was logged in as root, no luck. The web pages loaded, but no login check was asked for.
2. I then reverted my http.conf file back to pre-htaccess attempts and then removed all the .htaccess and .htpasswd files I made.
Then using advise I had read, I made edits to my username.conf file in the <b>/etc/httpd/users/</b> directory. The edits to this file seem to add the lines usually found in an .htaccess file. I also created a new htpasswd file.
Here are the lines from the username.conf file:
<Directory "/Users/username/Sites/directory/subdirectory/">
AuthType Basic
AuthName "Need Access Name"
AuthUserFile "/Users/username/.htpasswd"
Require valid-user
Options -Indexes
AllowOverride None
Order allow,deny
Allow from all
</Directory>
Now when I typed in my url: <b>XXX.XX.XX.X/~username/directory/subdirectory</b>, I was presented with pop-up access window. Great. Access granted.
This was great and all, but I'd rather use a .htaccess file. Any advice? Is the username.conf file overriding any .htaccess file that might exist?
3. Continuing on, I also use dnydns and virtual name hosting. So, the next step was to check the access with my url: <b>myweb.dyndns.org/directory</b> and no dice. The index file loaded, but no username or password was asked for. So it seems that Apache is not checking the access when a virtual host name is used.
I realize that the above is a bit thin in details, but anyone who knows about this subject can surely understand where I'm going. Any advice with this matter would be of great help.
------