Password Protecting Webserver?

Connect with other users about what to run on your webhosting (and how to run it) here.
Post Reply
gafoob
A semi-regular
A semi-regular
Posts: 20
https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
Joined: Thu Feb 12, 2015 9:48 pm

Password Protecting Webserver?

Post by gafoob »

I have attempted to build a .htpasswd file as a well as a .htaccess file and place it in my directory as needed, but I can't seem to figure out what I am doing wrong here. Whatever I have tried, I get redirected to an "Internal Server Error"

http://www.nfoservers.com/forums/viewto ... =19&t=3736
https://www.nfoservers.com/passcreator.pl

I have used both of those to help set up my directory. So far here is my test information

Username: gafoob
Password: QhW7Fhhanc0NY

http://gafoob.site.nfoservers.com/ - This is my web server

I woud like to require a password to this url. Currently my folder to access this all is called "public"

.htaccess

Code: Select all

# Access file
order allow,deny
allow from all
require valid-user
Authname "DirectoryName"
Authtype Basic
AuthUserFile /usr/www/gafoob/public/.htpasswd
.htpasswd

Code: Select all

gafoob:QhW7Fhhanc0NY
User avatar
rymax99
This is my homepage
This is my homepage
Posts: 143
Joined: Sun Feb 02, 2014 2:08 pm
Location: Florida
Contact:

Re: Password Protecting Webserver?

Post by rymax99 »

Check error logs, there should be something in logs to point to what the problem is.
gafoob
A semi-regular
A semi-regular
Posts: 20
Joined: Thu Feb 12, 2015 9:48 pm

Re: Password Protecting Webserver?

Post by gafoob »

rymax99 wrote:Check error logs, there should be something in logs to point to what the problem is.
I cant check my error logs. Never have been able to. http://gyazo.com/b02714f43d1e12d9b0078ecd2bf2018e

With all due respect, i'm tired of getting redirected, I would like some support :(
User avatar
kraze
Former staff
Former staff
Posts: 4362
Joined: Fri Sep 17, 2010 9:06 am
Location: California

Re: Password Protecting Webserver?

Post by kraze »

You'll need to login using SFTP to be able to access your error log.
@Kraze^NFo> Juski has a very valid point
@Juski> Got my new signature, thanks!
@Kraze^NFo> Out of context!
@Juski> Doesn't matter!
@Juski> You said I had a valid point! You can't take it back now! It's out there!
User avatar
rymax99
This is my homepage
This is my homepage
Posts: 143
Joined: Sun Feb 02, 2014 2:08 pm
Location: Florida
Contact:

Re: Password Protecting Webserver?

Post by rymax99 »

gafoob wrote:
rymax99 wrote:Check error logs, there should be something in logs to point to what the problem is.
I cant check my error logs. Never have been able to. http://gyazo.com/b02714f43d1e12d9b0078ecd2bf2018e

With all due respect, i'm tired of getting redirected, I would like some support :(
You're not getting redirected, checking logs is due process for trying to solve any issue.
User avatar
Edge100x
Founder
Founder
Posts: 12945
Joined: Thu Apr 18, 2002 11:04 pm
Location: Seattle
Contact:

Re: Password Protecting Webserver?

Post by Edge100x »

In the .htpasswd file, you need to put the hashed version of your password, generated using the script that you referenced -- if your password is QhW7Fhhanc0NY, it would be different than QhW7Fhhanc0NY.
gafoob
A semi-regular
A semi-regular
Posts: 20
Joined: Thu Feb 12, 2015 9:48 pm

Re: Password Protecting Webserver?

Post by gafoob »

Edge100x wrote:In the .htpasswd file, you need to put the hashed version of your password, generated using the script that you referenced -- if your password is QhW7Fhhanc0NY, it would be different than QhW7Fhhanc0NY.
That is the hashed password.
gafoob
A semi-regular
A semi-regular
Posts: 20
Joined: Thu Feb 12, 2015 9:48 pm

Re: Password Protecting Webserver?

Post by gafoob »

kraze wrote:You'll need to login using SFTP to be able to access your error log.
Thank you, i'll check that out right now.
gafoob
A semi-regular
A semi-regular
Posts: 20
Joined: Thu Feb 12, 2015 9:48 pm

Re: Password Protecting Webserver?

Post by gafoob »

rymax99 wrote:
gafoob wrote:
rymax99 wrote:Check error logs, there should be something in logs to point to what the problem is.
I cant check my error logs. Never have been able to. http://gyazo.com/b02714f43d1e12d9b0078ecd2bf2018e

With all due respect, i'm tired of getting redirected, I would like some support :(
You're not getting redirected, checking logs is due process for trying to solve any issue.
My error_log is completely empty. I just was able to check.
gafoob
A semi-regular
A semi-regular
Posts: 20
Joined: Thu Feb 12, 2015 9:48 pm

Re: Password Protecting Webserver?

Post by gafoob »

Cany anyone verify that I have all the correct information placed in my .htaccess?
gafoob
A semi-regular
A semi-regular
Posts: 20
Joined: Thu Feb 12, 2015 9:48 pm

Re: Password Protecting Webserver?

Post by gafoob »

okay, I have learned of a fix. I am not 100% sure why this works, but here is my solution.

Log in to your FTP (or SFTP/SSH) and you place the .htpasswd right there after you've logged in.
Here is what mine looks like right now: http://gyazo.com/cf52680e10c188a4f1d4e8a9dddf72e6

After that, you must put .htaccess into the folder you wish to protect. In my case, I put it into "public" (gafoob/public)
You can view what that looks like here: http://gyazo.com/e6272b6599e4e32ec9f075dc989b75d2

my .htpasswd and .htaccess were left the same and both files were already correct to begin with.

I hope this helps anyone having this issue.
Post Reply