Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do you use HTAccess Wullie?

Status
Not open for further replies.

SPYDERIX

Technical User
Jan 11, 2002
1,899
CA
Hi Wullie,

I'm posting this question as a new thread instead of tying up the other post.

I found out what web server we use, and it is run by UNIX.
So can you explain how to use HTAccess, and how to set it up, and can we have accounts for multiple users?

Thanks alot. [deejay]
Nate
"If you're not living on the edge, you're taking up too much space!"
 
Best way to learn about htaccess would be to download apache ( and set it up as you want.

So far I havent found a thouroughly conclusive howto on it and I certainly wouldn't try writing one at the moment. ***************************************
Party on, dudes!
 
Hi,

Firstly, you could download apache but this would not learn you anything about htaccess on unix unless you actually run it on unix. Windows and unix use different ways to create the files.

I was actually hoping that you were running on Windows as that would be a lot easier to explain..

To create a htpasswd file in unix you must either have the ability to telnet to the server or use some kind of script to do this for you. A lot of servers will not allow you to telnet.

The second option is the way I will go just now as you didn't know what server you were running on so telnet might be beyond you at this point. (If you can even use it on the server)

Check out this script, I personally havn't used it but it looks ok from what I have seen.



The next part is where most people find problems:

Open notepad and copy and paste the following text into it.

AuthName "Restricted Area"
AuthType Basic
AuthUserFile "/home/user/secure/.htpasswd"
require valid-user

Change the path to the actual path from the root of your server to where the .htpasswd file will reside.

Now the tricky bit, click on file > save as > then save the file as .htaccess

Windows will not normally allow a file with an extension and not a name as .htaccess is, so if you have problems with this then save the file as test.htaccess or similar. I personally can save the .htaccess file without any problems.

Now upload that file to your server, if you renamed the file test.htaccess then now rename the file on the Unix server which should not pose a problem.

Now, use a script to create the htpasswd file and that should be you..

If you cannot create the file, then let me know and I will give you an app to do this and then you can just upload this file to your server..

If you need any help, just ask..

Hope this helps Wullie

 
Won't be able to use this b/c ISP (TELUS) doesn't support PERL.

They are useless. They barely support much more than .html and javascript. [deejay]
Nate
"If you're not living on the edge, you're taking up too much space!"
 
If they don't support a lot of things then they might also not let you use .htaccess files either.

They need to have the server config set up so that you can use htaccess. If they do not support htaccess then you can contact them and ask them to change the appropriate section in the httpd.conf file to

AllowOverride Authconfig

If you seem to know what you are talking about then they are more likely to allow you to use it.

To make the htpasswd file, download the following file.


I have already checked this for virus but make sure that you run it through your virus scanner as you should always do with ANY download. I don't want you to blame me if you get a virus from a file that you download from my server.

Go to a command prompt and go to the appropriate directory that contains the unziped file.

Type htpasswd and it will give you the options of how to make the file.

If you have any problems, just ask.

Hope this helps Wullie

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top