[RESOLVED] I can't get .htaccess to work properly, 500 error

Old topics are moved here for reference.

[RESOLVED] I can't get .htaccess to work properly, 500 error

Postby ownzordage » Wed Jan 26, 2011 11:08 pm

Hi all,

I have LAMP on my pogoplug, and tried getting .htaccess files to work in order to restrict access to certain directories. I have successfully gotten to the part where I have a .htaccess file and it prompts for username and password. However, when I click submit, I receive the following error:

Code: Select all
Server error!

The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there was an error in a CGI script.

If you think this is a server error, please contact the webmaster.
Error 500
http://www.mysite.com
Fri Jan 2 18:11:16 1970
Apache/2.2.15 (Unix) mod_ssl/2.2.15 OpenSSL/1.0.0a DAV/2



Does anyone have any experience with this? Thanks for any help!
-Peter

Edit: Here's my .htaccess file, in location /srv/http/media (media is the folder I want to restrict access to)
Code: Select all
AuthType Basic
AuthName "You need a password to view these files"
AuthUserFile "/home/peter/htpasswd/.htpasswd"
Require valid-user


And here is my .htpasswd file (with the hex obviously changed), in location /home/peter/htpasswd
Code: Select all
peter:BA2sn8CUhhk4U
Last edited by ownzordage on Wed Jan 26, 2011 11:59 pm, edited 1 time in total.
ownzordage
 
Posts: 4
Joined: Fri Jan 21, 2011 7:16 am

Re: I can't get .htaccess to work properly, 500 error

Postby pepedog » Wed Jan 26, 2011 11:20 pm

Does .htaccess have windows new lines in?
Also the password file needs checking for this.

Dave
pepedog
Developer
 
Posts: 1665
Joined: Mon Jun 07, 2010 3:30 pm
Location: London UK

Re: I can't get .htaccess to work properly, 500 error

Postby ownzordage » Wed Jan 26, 2011 11:23 pm

Hey Dave,

I'm confused what you mean by "windows new lines". Is that an attribute that apache looks for?
ownzordage
 
Posts: 4
Joined: Fri Jan 21, 2011 7:16 am

Re: I can't get .htaccess to work properly, 500 error

Postby pepedog » Wed Jan 26, 2011 11:32 pm

What method are you editing the files? If it's say windows notepad, it adds carriage return and linefeed, whereas Linux is just lf

Somewhere, I have used a command line that created the 2 files for me.

Dave
pepedog
Developer
 
Posts: 1665
Joined: Mon Jun 07, 2010 3:30 pm
Location: London UK

Re: I can't get .htaccess to work properly, 500 error

Postby ownzordage » Wed Jan 26, 2011 11:39 pm

yeah, i noticed that when i originally edited them in notepad. then i used nano on my pogoplug and found that nano interpreted the file as having 2 returns, or something like double space. Then I used nano to remove the extra lines. How is it supposed to look?
ownzordage
 
Posts: 4
Joined: Fri Jan 21, 2011 7:16 am

Re: I can't get .htaccess to work properly, 500 error

Postby ownzordage » Wed Jan 26, 2011 11:53 pm

Well, I got it to work better now, meaning it doesn't give an error when I hit enter but rather does not accept my password. I will get a new password and try that. I moved the .htpasswd file into public html (i know bad idea, its only temporary), since I had a feeling that the apache user didn't have access to /home/peter


Edit: I got it working. Re-hexing the password fixed the problem, but I'm sure the directory also contributed to the problem, as well as windows new lines.
ownzordage
 
Posts: 4
Joined: Fri Jan 21, 2011 7:16 am

Re: [RESOLVED] I can't get .htaccess to work properly, 500 e

Postby pepedog » Thu Jan 27, 2011 12:34 am

I got a neat set of files (perl) for managing the htpasswd file, I use it on nntp auth mainly
pepedog
Developer
 
Posts: 1665
Joined: Mon Jun 07, 2010 3:30 pm
Location: London UK


Return to Resolved

Who is online

Users browsing this forum: No registered users and 1 guest