RE: [CentOS] Can't get .htaccess to work SOLVED!
> Date: Mon, 21 Apr 2008 14:12:20 +0530 > From: [EMAIL PROTECTED] > To: centos@centos.org > Subject: Re: [CentOS] Can't get .htaccess to work > > pls click below URL > > http://openwebmail.org/openwebmail/download/redhat/howto/htaccess/HOWTO.HTML > > > > On Mon, Apr 21, 2008 at 2:01 PM, Kai Schaetzl <[EMAIL PROTECTED]> wrote: > > [EMAIL PROTECTED]> > > X-Rcpt-To: > > > > Pam Astor wrote on Sun, 20 Apr 2008 20:03:16 -0400: > > > > > Options not allowed here > > > > Please, by now you should know what this means, even after obstinately > > neglecting to look in the documentation. > > > > Kai > > > > -- > > Kai Schätzl, Berlin, Germany > > Get your web at Conactive Internet Services: http://www.conactive.com IT WORKS! Thanks so much Indunil! Been trying to get this to work for days, worked on my Centos 5.1 box (by substituting in my correct directory paths) Success finally! Pam _ Spell a grand slam in this game where word skill meets World Series. Get in the game. http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
RE: [CentOS] Can't get .htaccess to work SOLVED!
> Date: Mon, 21 Apr 2008 14:12:20 +0530 > From: [EMAIL PROTECTED] > To: centos@centos.org > Subject: Re: [CentOS] Can't get .htaccess to work > > pls click below URL > > http://openwebmail.org/openwebmail/download/redhat/howto/htaccess/HOWTO.HTML > > > Thank you > Indunil Jayasooriya > ___ > CentOS mailing list > CentOS@centos.org > http://lists.centos.org/mailman/listinfo/centos IT WORKS! Thanks so much Indunil! Been trying to get this to work for days, worked on my Centos 5.1 box (by substituting in my correct directory paths) Success finally! Pam _ Make i'm yours. Create a custom banner to support your cause. http://im.live.com/Messenger/IM/Contribute/Default.aspx?source=TXT_TAGHM_MSN_Make_IM_Yours___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] Can't get .htaccess to work
Les Mikesell wrote on Mon, 21 Apr 2008 10:00:48 -0500: > Isn't there an old joke that when the documentation and code differ they > are probably both wrong? ;-) Kai -- Kai Schätzl, Berlin, Germany Get your web at Conactive Internet Services: http://www.conactive.com ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] Can't get .htaccess to work
Kai Schaetzl wrote: Les Mikesell wrote on Mon, 21 Apr 2008 07:39:24 -0500: But oddly enough, the documentation does say that the Options directive is permitted in .htaccess context: Yes, I was wondering about that myself, I think it is not correct. But "None" is not an Option, anyway. He/She should just remove that line. Again, oddly enough, the stock Centos http.conf contains in one place: # Possible values for the Options directive are "None", "All", and in another: # AllowOverride None Options None Order allow,deny Allow from all Isn't there an old joke that when the documentation and code differ they are probably both wrong? -- Les Mikesell [EMAIL PROTECTED] ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] Can't get .htaccess to work
Les Mikesell wrote on Mon, 21 Apr 2008 07:39:24 -0500: > But oddly enough, the documentation does say that the Options directive > is permitted in .htaccess context: Yes, I was wondering about that myself, I think it is not correct. But "None" is not an Option, anyway. He/She should just remove that line. Kai -- Kai Schätzl, Berlin, Germany Get your web at Conactive Internet Services: http://www.conactive.com ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] Can't get .htaccess to work
Kai Schaetzl wrote: Options not allowed here Please, by now you should know what this means, even after obstinately neglecting to look in the documentation. But oddly enough, the documentation does say that the Options directive is permitted in .htaccess context: http://httpd.apache.org/docs/2.2/mod/core.html#options -- Les Mikesell [EMAIL PROTECTED] ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] Can't get .htaccess to work
pls click below URL http://openwebmail.org/openwebmail/download/redhat/howto/htaccess/HOWTO.HTML On Mon, Apr 21, 2008 at 2:01 PM, Kai Schaetzl <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED]> > X-Rcpt-To: > > Pam Astor wrote on Sun, 20 Apr 2008 20:03:16 -0400: > > > Options not allowed here > > Please, by now you should know what this means, even after obstinately > neglecting to look in the documentation. > > Kai > > -- > Kai Schätzl, Berlin, Germany > Get your web at Conactive Internet Services: http://www.conactive.com > > > > ___ > CentOS mailing list > CentOS@centos.org > http://lists.centos.org/mailman/listinfo/centos > -- Thank you Indunil Jayasooriya ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] Can't get .htaccess to work
[EMAIL PROTECTED]> X-Rcpt-To: Pam Astor wrote on Sun, 20 Apr 2008 20:03:16 -0400: > Options not allowed here Please, by now you should know what this means, even after obstinately neglecting to look in the documentation. Kai -- Kai Schätzl, Berlin, Germany Get your web at Conactive Internet Services: http://www.conactive.com ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
RE: [CentOS] Can't get .htaccess to work
> >> That you got a server error is good.> > > Here are the last two log file > >> entries for that httpd request:> > you want to look in the *error* log if > >> you look for errors!> > > > I could not access the site,> > which means > >> exactly what? ;-) > > > > OK, starting from scratch this morning, > > here is the .htaccess file I am using which is inside of the > > /home/LinuxAccountName/www directory: > > > > > > Options NoneAuthName > > "UserNameIUsedToCreatePasswordWith"AuthType BasicAuthUserFile > > /home/LinuxAccountName/.htpasswdRequire valid-user > > www above refers to the root or web directory - the lowest or first or base > > directory that is web accessable. > > And, this is the error I am getting from my httpd error log for this domain: > > > > [Sun Apr 20 07:47:40 2008] [alert] [client 75.46.110.14] > > /home/LinuxAccountName/.htaccess: > Remove the tag.. a .htaccess file is placed inside a > tag for the folder it is in automatically.. > > Consequentially, your .htaccess looks like this to apache: > > > ... > > Thanks, OK I removed the directory tag & got a different error, now the contents of .htaccess file is this: Options None AuthName "UserNameCreatedFor.htpasswd" AuthType Basic AuthUserFile /home/user/.htpasswd Require valid-user Error log for my request is here: [Sun Apr 20 19:57:05 2008] [alert] [client 12.34.567.89] /home/user/www/.htaccess: Options not allowed here And error I got in web browser is here: Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. _ Use video conversation to talk face-to-face with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_video_042008___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] Can't get .htaccess to work
Pam Astor wrote: That you got a server error is good.> > > Here are the last two log file entries for that httpd request:> > you want to look in the *error* log if you look for errors!> > > > I could not access the site,> > which means exactly what? ;-) OK, starting from scratch this morning, here is the .htaccess file I am using which is inside of the /home/LinuxAccountName/www directory: Options NoneAuthName "UserNameIUsedToCreatePasswordWith"AuthType BasicAuthUserFile /home/LinuxAccountName/.htpasswdRequire valid-user www above refers to the root or web directory - the lowest or first or base directory that is web accessable. And, this is the error I am getting from my httpd error log for this domain: [Sun Apr 20 07:47:40 2008] [alert] [client 75.46.110.14] /home/LinuxAccountName/.htaccess: Remove the tag.. a .htaccess file is placed inside a tag for the folder it is in automatically.. Consequentially, your .htaccess looks like this to apache: ... -- Cheers, Morten ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
RE: [CentOS] Can't get .htaccess to work
> That you got a server error is good.> > > Here are the last two log file > entries for that httpd request:> > you want to look in the *error* log if you > look for errors!> > > > I could not access the site,> > which means exactly > what? ;-) OK, starting from scratch this morning, here is the .htaccess file I am using which is inside of the /home/LinuxAccountName/www directory: Options NoneAuthName "UserNameIUsedToCreatePasswordWith"AuthType BasicAuthUserFile /home/LinuxAccountName/.htpasswdRequire valid-user www above refers to the root or web directory - the lowest or first or base directory that is web accessable. And, this is the error I am getting from my httpd error log for this domain: [Sun Apr 20 07:47:40 2008] [alert] [client 75.46.110.14] /home/LinuxAccountName/.htaccess: http://www.windowslive.com/skydrive/overview.html?ocid=TXT_TAGLM_WL_Refresh_skydrive_packup_042008___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] Can't get .htaccess to work
Pam Astor wrote on Sat, 19 Apr 2008 13:54:17 -0400: That you got a server error is good. > Here are the last two log file entries for that httpd request: you want to look in the *error* log if you look for errors! > > I could not access the site, which means exactly what? ;-) Kai -- Kai Schätzl, Berlin, Germany Get your web at Conactive Internet Services: http://www.conactive.com ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] Can't get .htaccess to work
On Sat, Apr 19, 2008 at 12:31 PM, Kai Schaetzl <[EMAIL PROTECTED]> wrote: > Jim Perrin wrote on Sat, 19 Apr 2008 10:16:54 -0400: > > > > > Jim, you forget that he's using .htaccess, the above cannot work there. He > has to leave that out. I didn't really forget, I was thinking more of having it included directly in the vhost config inside conf.d/ since I consider .htaccess bad anyway. however I really didn't make that clear at all, as I was mixing info. Good catch, and thanks for trying to keep my ramblings sane :-P -- During times of universal deceit, telling the truth becomes a revolutionary act. George Orwell ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] Can't get .htaccess to work
Pam Astor wrote: The syntax for auth stuff changed between Apache 2.0 and 2.2 (which is used in CentOS 5). In particular, you'll need a AuthBasicProvider declaration: http://httpd.apache.org/docs/2.2/mod/mod_auth_basic.html#authbasicprovider Thans Paul, That's new news to me :) For the OP, I believe it would be: AuthType basic AuthName "private area" AuthBasicProvider file AuthDBMType file AuthDBMUserFile /home/mysite/.htpasswd Require valid-user Thanks, OK I tried that and it still would not work, I am not prompted for a username or password on the site I want to protect. Do I also need to add a new entry in httpd.conf or load a new apache module? Are you sure your Location entry matched the URL path you use to reach it, not the path to the directory? You do need to restart httpd after putting this into httpd.conf. -- Les Mikesell [EMAIL PROTECTED] ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
RE: [CentOS] Can't get .htaccess to work
> Jim, you forget that he's using .htaccess, the above cannot work there. He > > has to leave that out.> > Pam: if you can access the directory just fine this > does *not* mean that > you misconfigured your .htaccess file (although it > looked like that as > well), it means it is not getting used at all. An > .htaccess file that is > not allowed by server config or that contains wrong > configuration throws a > 500 Internal Server Error. You have also been told a > while back I think > that you should look in the logs. Did you do that? I > don't remember having > seen any response from you about that.> Do the > following: place a single fake command like "this is a fake > command" in > your .htaccess file and then access the directory. If you > don't get a 500 > error, the file is not getting used. Which means next step > is to check your > logs and your configuration why it's not getting used and > also double-check > that it's in the correct directory and you access the > correct directory (as > I don't know what content you have there this > content may either be > identifying it uniquely or not).> > You should also read the Apache > documentation at httpd.apache.org, it may > help you find that probably tiny > mistake that you make, but we can't tell > you as we don't see all of the > picture. You should also read up on how you > can achieve the password > protection without an .htaccess file. This file > is completely unnecessary > if you have access to the apache conf, anyway. OK, I put the fake command in and now I'm getting an error via web page: Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Here are the last two log file entries for that httpd request: 12.34.567.89 - - [19/Apr/2008:13:46:23 -0400] "GET / HTTP/1.1" 500 61612.34.567.89 - - [19/Apr/2008:13:47:12 -0400] "GET / HTTP/1.1" 200 20 I Changed the IP's. I guess there were two seperate errors, the last error - even when I corrected and removed the fake command and reloaded, I could not access the site, so the second error indicates the fake message removed but all else being (supposedly) correct the same in the conf.d file. Then I deleted .htaccess and .htpasswd and now I can again access the site again. _ Get in touch in an instant. Get Windows Live Messenger now. http://www.windowslive.com/messenger/overview.html?ocid=TXT_TAGLM_WL_Refresh_getintouch_042008___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
RE: [CentOS] Can't get .htaccess to work
> Jim, you forget that he's using .htaccess, the above cannot work there. He > > has to leave that out.> > Pam: if you can access the directory just fine this > does *not* mean that > you misconfigured your .htaccess file (although it > looked like that as > well), it means it is not getting used at all. An > .htaccess file that is > not allowed by server config or that contains wrong > configuration throws a > 500 Internal Server Error. You have also been told a > while back I think > that you should look in the logs. Did you do that? I > don't remember having > seen any response from you about that.> Do the > following: place a single fake command like "this is a fake > command" in > your .htaccess file and then access the directory. If you > don't get a 500 > error, the file is not getting used. Which means next step > is to check your > logs and your configuration why it's not getting used and > also double-check > that it's in the correct directory and you access the > correct directory (as > I don't know what content you have there this > content may either be > identifying it uniquely or not).> > You should also read the Apache > documentation at httpd.apache.org, it may > help you find that probably tiny > mistake that you make, but we can't tell > you as we don't see all of the > picture. You should also read up on how you > can achieve the password > protection without an .htaccess file. This file > is completely unnecessary > if you have access to the apache conf, anyway. OK, I put the fake command in and now I'm getting an error via web page: Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Here are the last two log file entries for that httpd request: 12.34.567.89 - - [19/Apr/2008:13:46:23 -0400] "GET / HTTP/1.1" 500 61612.34.567.89 - - [19/Apr/2008:13:47:12 -0400] "GET / HTTP/1.1" 200 20 I Changed the IP's. I guess there were two seperate errors, the last error - even when I corrected and removed the fake command and reloaded, I could not access the site, so the second error indicates the fake message removed but all else being (supposedly) correct the same in the conf.d file. Then I deleted .htaccess and .htpasswd and now I can again access the site again. _ Use video conversation to talk face-to-face with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_video_042008___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] Can't get .htaccess to work
Jim Perrin wrote on Sat, 19 Apr 2008 10:16:54 -0400: > Jim, you forget that he's using .htaccess, the above cannot work there. He has to leave that out. Pam: if you can access the directory just fine this does *not* mean that you misconfigured your .htaccess file (although it looked like that as well), it means it is not getting used at all. An .htaccess file that is not allowed by server config or that contains wrong configuration throws a 500 Internal Server Error. You have also been told a while back I think that you should look in the logs. Did you do that? I don't remember having seen any response from you about that. Do the following: place a single fake command like "this is a fake command" in your .htaccess file and then access the directory. If you don't get a 500 error, the file is not getting used. Which means next step is to check your logs and your configuration why it's not getting used and also double-check that it's in the correct directory and you access the correct directory (as I don't know what content you have there this content may either be identifying it uniquely or not). You should also read the Apache documentation at httpd.apache.org, it may help you find that probably tiny mistake that you make, but we can't tell you as we don't see all of the picture. You should also read up on how you can achieve the password protection without an .htaccess file. This file is completely unnecessary if you have access to the apache conf, anyway. Kai -- Kai Schätzl, Berlin, Germany Get your web at Conactive Internet Services: http://www.conactive.com ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
RE: [CentOS] Can't get .htaccess to work
> > >For my httpd.conf, I have one main configuration file in /etc/httpd/conf > > and for each virtual domain, I have individual > > >www.mydomain.com.conf files with associated virtual host tags inside, and > > located in /etc/httpd/conf.d directory. > > Okay. These are vhost configs only. You *can* set them globally in > httpd.conf, but they can be overwritten later, so it's best to do it > vhost by vhost. OK so do/set what vhost by vhost? Place the AllowOverride AuthConfig directive vhost by vhost? If that's what yo u meant, I tried again inserting the Options FollowSymLinks AllowOverride AuthConfig and the AllowOverride AuthConfig directives inside the individual vhost file and am still not getting a login prompt on the site. However this time, apache did reload for both directives. The reason why It did not reload last time, was because all I did earlier was insert the AllowOverride AuthConfig statement inside the vhost file, without the directory tags, so at least there is some progress there ;) > > >I also tried placing the AllowOverride AuthConfig directive inside the > > individual conf.d virtual domain > > >files but then apache would not reload, so I took them out and reloaded > > again. > > This depends on where within the vhost config you put them. Apache > should tell you exactly what line of the config the error is on, and > what exactly is wrong with it. I did not get indication from apache what line the syntax error was or what file either, all I got was: Reloading httpd: not reloading due to configuration syntax error [FAILED] But I guess that point is moot now since at least httpd is reloading. I have however got line-syntax indications for other apache errors, just don't know why I was not getting them for this error. > > >Are the individual conf.d files causing the problem? > > Only because they aren't formatted properly. > > > > > > AuthType basic > > AuthName "private area" > > AuthBasicProvider file > > AuthDBMUserFile /home/maindir/.htpasswd > > Require valid-user > > > > This one is wrong because you're pointing a DBM statement to a flat > user file which isn't in dbm format. > > > > > AuthType basic > > AuthName "private area" > > AuthBasicProvider file > > Require valid-user > > > > This one sets the auth type outside everything else, and provides > multiple names. > > > AuthUserFile /home/maindir/.htpasswd > > AuthType Basic > > AuthName "My Secret Folder" > > Require valid-user > > > > Here's a statement that I know works, from my nagios setup at home, > altered for what you're looking to do. > > > >Options None >AuthName "Nagios Access" >AuthType Basic >AuthUserFile /etc/httpd/htpasswd.users >Require valid-user > OK, just to make sure I am doing this exactly correct, do I substitute "Nagios Access" to whatever login name I used when I created my .htpasswd file? Also, for Directory "/change/this", do I set this to the directory where my .htpasswd file is located? Or is this the path to the dir I am trying to protect? Or, for AuthUserFile /etc/httpd/htpasswd.users, is this the path and filename of the .htpasswd file? _ Get in touch in an instant. Get Windows Live Messenger now. http://www.windowslive.com/messenger/overview.html?ocid=TXT_TAGLM_WL_Refresh_getintouch_042008___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] Can't get .htaccess to work
On Sat, Apr 19, 2008 at 8:56 AM, Pam Astor <[EMAIL PROTECTED]> wrote: > >For my httpd.conf, I have one main configuration file in /etc/httpd/conf > and for each virtual domain, I have individual > >www.mydomain.com.conf files with associated virtual host tags inside, and > located in /etc/httpd/conf.d directory. Okay. These are vhost configs only. You *can* set them globally in httpd.conf, but they can be overwritten later, so it's best to do it vhost by vhost. > > > >I also tried placing the AllowOverride AuthConfig directive inside the > individual conf.d virtual domain > >files but then apache would not reload, so I took them out and reloaded > again. This depends on where within the vhost config you put them. Apache should tell you exactly what line of the config the error is on, and what exactly is wrong with it. > >Are the individual conf.d files causing the problem? Only because they aren't formatted properly. > > AuthType basic > AuthName "private area" > AuthBasicProvider file > AuthDBMUserFile /home/maindir/.htpasswd > Require valid-user > This one is wrong because you're pointing a DBM statement to a flat user file which isn't in dbm format. > > AuthType basic > AuthName "private area" > AuthBasicProvider file > Require valid-user > This one sets the auth type outside everything else, and provides multiple names. > AuthUserFile /home/maindir/.htpasswd > AuthType Basic > AuthName "My Secret Folder" > Require valid-user Here's a statement that I know works, from my nagios setup at home, altered for what you're looking to do. Options None AuthName "Nagios Access" AuthType Basic AuthUserFile /etc/httpd/htpasswd.users Require valid-user -- During times of universal deceit, telling the truth becomes a revolutionary act. George Orwell ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
RE: [CentOS] Can't get .htaccess to work
> > > Do I also need to add a new entry in httpd.conf or load a new apache >> > module? > > > >Not by default, no. >> > >There are several AllowOverrides statements in the default httpd.conf. > >Which did you modify? > > > >The one you wanted should be around line 327, looking like this: >> >> Options Indexes FollowSymLinks >> >> # >> # AllowOverride controls what directives may be placed in .htaccess files. >> # It can be "All", "None", or any combination of the keywords: >> # Options FileInfo AuthConfig Limit >> # >> AllowOverride None >> >> # >> # Controls who can get stuff from this server. >> # >> Order allow,deny >> Allow from all >> >> >> >> Change the AllowOverride to AuthConfig, and that should be just about it. >> >> You don't want to use the AuthDBMType unless you're using htdbm >> instead of htpasswd to generate your password file lists. >> >> You also need to make sure that apache has access to the area where >> you're putting your .htaccess. >> >> If you're stuffing this in your home directory like it looks above, >> apache doesn't have permissions in here unless you've modified your >> homedir to 711 from 700. Selinux can also cause some issues in here as >> well if you have it enabled and haven't changed contexts. >> >> Without fully seeing the config that you're using and some info about >> the dir you're trying to restrict, it'll be a little harder to offer >> more help. > >I reset AllowOverride to AuthConfig and it's still not working. > >OK the dir I am trying to password protect (named www) is the home or main or >root directory of >www.mydomain.com - it is owned by apache The permissions on www were set to >755. .htaccess is located >inside www and is also owned by apache. .htpasswd is just below, or outside >of www and outside of web access >and is also owned by apache. > >I do have selinux enabled I believe. > >For my httpd.conf, I have one main configuration file in /etc/httpd/conf and >for each virtual domain, I have individual >www.mydomain.com.conf files with associated virtual host tags inside, and >located in /etc/httpd/conf.d directory. > >I also tried placing the AllowOverride AuthConfig directive inside the >individual conf.d virtual domain >files but then apache would not reload, so I took them out and reloaded again. > >Are the individual conf.d files causing the problem? > In addition to the above, I have tried all three of the two below contents inside of my .htaccess file as suggested: AuthType basic AuthName "private area" AuthBasicProvider file AuthDBMUserFile /home/maindir/.htpasswd Require valid-user AuthType basic AuthName "private area" AuthBasicProvider file Require valid-user AuthUserFile /home/maindir/.htpasswd AuthType Basic AuthName "My Secret Folder" Require valid-user Going green? See the top 12 foods to eat organic. _ Use video conversation to talk face-to-face with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_video_042008___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
RE: [CentOS] Can't get .htaccess to work
> > Do I also need to add a new entry in httpd.conf or load a new apache > > module? > > Not by default, no. > > There are several AllowOverrides statements in the default httpd.conf. > Which did you modify? > > The one you wanted should be around line 327, looking like this: > > Options Indexes FollowSymLinks > > # > # AllowOverride controls what directives may be placed in .htaccess files. > # It can be "All", "None", or any combination of the keywords: > # Options FileInfo AuthConfig Limit > # > AllowOverride None > > # > # Controls who can get stuff from this server. > # > Order allow,deny > Allow from all > > > > Change the AllowOverride to AuthConfig, and that should be just about it. > > You don't want to use the AuthDBMType unless you're using htdbm > instead of htpasswd to generate your password file lists. > > You also need to make sure that apache has access to the area where > you're putting your .htaccess. > > If you're stuffing this in your home directory like it looks above, > apache doesn't have permissions in here unless you've modified your > homedir to 711 from 700. Selinux can also cause some issues in here as > well if you have it enabled and haven't changed contexts. > > Without fully seeing the config that you're using and some info about > the dir you're trying to restrict, it'll be a little harder to offer > more help. I reset AllowOverride to AuthConfig and it's still not working. OK the dir I am trying to password protect (named www) is the home or main or root directory of www.mydomain.com - it is owned by apache The permissions on www were set to 755. .htaccess is located inside www and is also owned by apache. .htpasswd is just below, or outside of www and outside of web access and is also owned by apache. I do have selinux enabled I believe. For my httpd.conf, I have one main configuration file in /etc/httpd/conf and for each virtual domain, I have individual www.mydomain.com.conf files with associated virtual host tags inside, and located in /etc/httpd/conf.d directory. I also tried placing the AllowOverride AuthConfig directive inside the individual conf.d virtual domain files but then apache would not reload, so I took them out and reloaded again. Are the individual conf.d files causing the problem? _ Going green? See the top 12 foods to eat organic. http://green.msn.com/galleries/photos/photos.aspx?gid=164&ocid=T003MSN51N1653A___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] Can't get .htaccess to work
On Sat, Apr 19, 2008 at 6:37 AM, Pam Astor <[EMAIL PROTECTED]> wrote: > OK I tried that and it still would not work, I am not prompted for > a username or password on the site I want to protect. > > Do I also need to add a new entry in httpd.conf or load a new apache > module? Not by default, no. There are several AllowOverrides statements in the default httpd.conf. Which did you modify? The one you wanted should be around line 327, looking like this: Options Indexes FollowSymLinks # # AllowOverride controls what directives may be placed in .htaccess files. # It can be "All", "None", or any combination of the keywords: # Options FileInfo AuthConfig Limit # AllowOverride None # # Controls who can get stuff from this server. # Order allow,deny Allow from all Change the AllowOverride to AuthConfig, and that should be just about it. You don't want to use the AuthDBMType unless you're using htdbm instead of htpasswd to generate your password file lists. You also need to make sure that apache has access to the area where you're putting your .htaccess. If you're stuffing this in your home directory like it looks above, apache doesn't have permissions in here unless you've modified your homedir to 711 from 700. Selinux can also cause some issues in here as well if you have it enabled and haven't changed contexts. Without fully seeing the config that you're using and some info about the dir you're trying to restrict, it'll be a little harder to offer more help. -- During times of universal deceit, telling the truth becomes a revolutionary act. George Orwell ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
RE: [CentOS] Can't get .htaccess to work
> > The syntax for auth stuff changed between Apache 2.0 and 2.2 (which is > > used in CentOS 5). In particular, you'll need a AuthBasicProvider > > declaration: > > > > http://httpd.apache.org/docs/2.2/mod/mod_auth_basic.html#authbasicprovider > > Thans Paul, > That's new news to me :) > > For the OP, I believe it would be: > > AuthType basic > AuthName "private area" > AuthBasicProvider file > AuthDBMType file > AuthDBMUserFile /home/mysite/.htpasswd > Require valid-user > Thanks, OK I tried that and it still would not work, I am not prompted for a username or password on the site I want to protect. Do I also need to add a new entry in httpd.conf or load a new apache module? _ Use video conversation to talk face-to-face with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_video_042008___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] Can't get .htaccess to work
On Saturday 19 April 2008 03:35:52 Paul Heinlein wrote: > The syntax for auth stuff changed between Apache 2.0 and 2.2 (which is > used in CentOS 5). In particular, you'll need a AuthBasicProvider > declaration: > > http://httpd.apache.org/docs/2.2/mod/mod_auth_basic.html#authbasicprovider Thans Paul, That's new news to me :) For the OP, I believe it would be: AuthType basic AuthName "private area" AuthBasicProvider file AuthDBMType file AuthDBMUserFile /home/mysite/.htpasswd Require valid-user CMIIW, -- Fajar Priyanto | Reg'd Linux User #327841 | Linux tutorial http://linux2.arinet.org 07:58:09 up 48 min, 2.6.22-14-generic GNU/Linux Let's use OpenOffice. http://www.openoffice.org The real challenge of teaching is getting your students motivated to learn. signature.asc Description: This is a digitally signed message part. ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
RE: [CentOS] Can't get .htaccess to work
> The syntax for auth stuff changed between Apache 2.0 and 2.2 (which is > used in CentOS 5). In particular, you'll need a AuthBasicProvider > declaration: > >http://httpd.apache.org/docs/2.2/mod/mod_auth_basic.html#authbasicprovider Hi, Thanks much, I read the URL, it is a bit too cryptic for me, can you or someone point me to a bit clearer step by step for setting this up correctly? _ Get in touch in an instant. Get Windows Live Messenger now. http://www.windowslive.com/messenger/overview.html?ocid=TXT_TAGLM_WL_Refresh_getintouch_042008___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] Can't get .htaccess to work
On Fri, 18 Apr 2008, Pam Astor wrote: Hi, I'm trying to password protect one of my web accessable directories and I can't get .htaccess to work in a Centos 5.1 box Here's what I did I created an .htaccess file with the contents: AuthName "Restricted Area" AuthType Basic AuthUserFile /home/mysite/.htpasswd AuthGroupFile /dev/null require valid-user and I uploaded it to the dir I want to protect. Then I created my password outside of my web dir with the command: htpasswd -c .htpasswd pam then followed password prompts, created my password. So then I go to the site, and am not seeing any password required box, I can see site without a login. So then I figured it's not turned on in apache, and went to httpd.conf and changed AllowOverride None to AllowOverride AuthConfig When I reload, apache will not reload. What am I doing wrong? The syntax for auth stuff changed between Apache 2.0 and 2.2 (which is used in CentOS 5). In particular, you'll need a AuthBasicProvider declaration: http://httpd.apache.org/docs/2.2/mod/mod_auth_basic.html#authbasicprovider -- Paul Heinlein <> [EMAIL PROTECTED] <> http://www.madboa.com/ ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] Can't get .htaccess to work
Pam Astor wrote: When I reload, apache will not reload. What am I doing wrong? I suspect your only fault is not checking the logs.. Right after you issue service httpd start, go look at /var/log/messages and /var/log/httpd/* -- Cheers, Morten :wq ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos