Fedora Linux Support Community & Resources Center
  #1  
Old 11th December 2012, 09:37 PM
usafitz Offline
Registered User
 
Join Date: Dec 2012
Location: NOLA
Posts: 27
macossafari
Apache .htaccess not working

hello everyone, and thank you for your help. I'm new to your forum and I look forward to some good times.

I am a novice at apache and am trying to protect my directories. I could use one of those management programs, but that wouldn't be any fun, right?

anyway, I opted to go with .htaccess and have been reading up on it. I created my .htaccess file, and then my password file using htpasswd.

AuthName "Please Input Credentials"
AuthUserFile /var/www/html/testaccess/passwordfile
AuthType Basic
require user user1

Then, I changed the httpd.conf file to read the following, and I restarted the service using 'service httpd restart'

<Directory />
Options FollowSymLinks
AllowOverride all
</Directory>

this is a fresh install of apache on Fedora 17. The default index.html file will pop up on the web browser with no authentication.

Any thoughts? Thanks again!
Reply With Quote
  #2  
Old 11th December 2012, 10:10 PM
jpollard Online
Registered User
 
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 6,662
linuxfirefox
Re: Apache .htaccess not working

How did you create the .htaccess file? it needs to have the proper ownership and security label. If you copied it in, then it will not necessarily get it.
Reply With Quote
  #3  
Old 12th December 2012, 12:09 AM
usafitz Offline
Registered User
 
Join Date: Dec 2012
Location: NOLA
Posts: 27
I made it in nano as my normal user. What should the permissions be? And are there any further changes that i must make in the httpd.conf file besides the AllowOveride all?

BTW, there are only user and group read/write privs. No execute.

---------- Post added at 06:09 PM ---------- Previous post was at 05:36 PM ----------

well, I think I figured it out. In the httpd.conf file, there were two entries for <Directory>. The first was for the root directory and the sequential ones were for directories within the /var/www/html. So I added an entry:

<Directory "/var/www/html/testaccess">
AllowOverride All
</Directory>

Adding this below the other directories (I would assume) would load that command last and therefore would not be overridden by those other entries.

BTW, I changed the root directory back to AllowOverride None : ) ...that's the one that I had change originally.

Thank you for the help!
Reply With Quote
  #4  
Old 12th December 2012, 12:16 PM
usafitz Offline
Registered User
 
Join Date: Dec 2012
Location: NOLA
Posts: 27
macossafari
Re: Apache .htaccess not working

So last night, I got advice to go ahead and just use the httpd.comf file to make the authentication configurations.

http://wiki.apache.org/httpd/PasswordBasicAuth

I went ahead and tested this out with another directory that I created and it worked great. However, the authentication window said that the password is not being sent encrypted. out of curiosity, will the password be in plain text for sniffing programs to see?

I guess the only way to remedy that is to make the site secure and put the protected directory behind it. Is there a way to make the password inputs more secure?
Reply With Quote
  #5  
Old 12th December 2012, 03:31 PM
jpollard Online
Registered User
 
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 6,662
linuxfirefox
Re: Apache .htaccess not working

That is what https is for.
Reply With Quote
Reply

Tags
apache, htaccess, working

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache ignoring .htaccess Arcath Using Fedora 2 15th December 2008 09:29 AM
.htaccess in apache Fear Servers & Networking 5 9th April 2008 08:25 AM


Current GMT-time: 21:10 (Friday, 18-04-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat