|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
freebsd, yes I have done a search for this already so please don't call me lazy
. No seriously I trust you will be able to solve this in about 10 seconds, I just can't figure it out.I am fairly new to Apache so bear with me. I have an alias from my domain named router which points to a folder outside the web root. I need to password protect it, so I stuck an .htaccess file in there, but for some reason it doesn't prompt for a username and password. I assume the problem is the fact that the alias points to a folder outside the web root. So I added this to my Virtual host conf for this domain. But it didn't do anything Alias /router/ "/home/httpd/mrtg/" <Directory "/home/httpd/mrtg/"> AllowOverride All AccessFileName htaccess </Directory> Any ideas, on what I can do? |
|
#2
|
|||
|
|||
|
>> it doesn't prompt for a username and password
Because you must access it via http://www.yourdomain.com/router/, not http://www.yourdomain.com/router. A quick fix for it is to: AliasMatch ^/router/?$ "/home/httpd/mrtg/" <Directory "/home/httpd/mrtg/"> AllowOverride All Options All </Directory> |
|
#3
|
|||
|
|||
|
I tried accessing it as both /router and /router/ with the same result, the oly thing I didn't add to the <Directory> directive is Options All, I will try that tommorow, thanks
|
|
#4
|
|||
|
|||
|
I threw this in the httpd.conf file
AliasMatch ^/router/?$ "/home/httpd/mrtg/" <Directory "/home/httpd/mrtg/"> AllowOverride All Options All </Directory> But its still not recognizing the .htaccess file. Here is the .htaccess file AuthType Basic AuthName "xxx, inc. router stats" AuthUserFile /home/pathtoasswordfile/.htpasswd require user admin |
|
#5
|
|||
|
|||
|
You also need to put AccessFileName .htaccess in your httpd.conf. Also check and see if whether or not .htaccess is being read at all by placing a simple directive like Options -Indexes or something.
|
|
#6
|
|||
|
|||
|
Okay I got it, thanks, My boss snuck in and added some crap to the httpd.conf file over the weekend and I was adding my stuff above his, well to make a long story short, I just neede to get the AllowOverride All in there, thanks freebsd!
|
![]() |
| Viewing: Dev Shed Forums > System Administration > Apache Development > htaccess and aliases |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|