Koozali.org: home of the SME Server

Legacy Forums => General Discussion (Legacy) => Topic started by: Coulter on October 17, 2001, 12:37:05 AM

Title: htaccess
Post by: Coulter on October 17, 2001, 12:37:05 AM
Is it possible to protect a directory with .htaccess?

I am trying to protect a few sub dirs under my cgi-bin.

If you could help I would appreciate it.
Title: Re: htaccess
Post by: Luke Drumm on October 17, 2001, 09:55:27 AM
It's been a while since I last played with htaccess, but I seem to remember the offical documentation (found either on the docs dir or online at apache.org) wasn't too bad.

Regards,
Luke
Title: Re: htaccess
Post by: Coulter on October 17, 2001, 10:38:49 AM
well I have tried to do the htaccess thing with e-smith and can't figure it out... could some one point me to a HOWTO?

I have done it w/ rehat... I don't know if it is disabled in SME somehow
???
thanx
Title: Re: htaccess
Post by: Coulter on October 17, 2001, 10:39:06 AM
well I have tried to do the htaccess thing with e-smith and can't figure it out... could some one point me to a HOWTO?

I have done it w/ rehat... I don't know if it is disabled in SME somehow
???
thanx
Title: Re: htaccess
Post by: Coulter on October 18, 2001, 07:04:46 AM
anyone?
Title: Re: htaccess
Post by: Dan Brown on October 18, 2001, 08:24:52 AM
I'm 99% sure this has been discussed here in the past.; a search on .htaccess should find the information.  However, here's the short info: e-smith disables .htaccess files for security reasons.  If you want to override this, the information at http://www.familybrown.org/howtos/advanced-ibay-howto.html may be useful.  You'll need to know your Apache syntax pretty well.
Title: Re: htaccess
Post by: Tony on October 19, 2001, 10:36:45 PM
This text I have made for my own sevices. It is an HowTo in swedish.
Most of the commans are in english.. I this doesen´t make sence to you, then you can mail me.. and maybe I´ll try to translate it in english or at least some of it.'

/ Tony.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Förbered e-smith för att kunna lösenords skydda kataloger i ibays.


Logga in som root via terminal.

Skapa först katalogen för dina nya konfigurations filer. (Fetstil = kommandon.)

mkdir -p /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/

Kopiera original script filerna för primär och ibays.

cp /etc/e-smith/templates/etc/httpd/conf/httpd.conf/90e-smithAccess10primary
/etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/90e-smithAccess10primary

cp /etc/e-smith/templates/etc/httpd/conf/httpd.conf/90e-smithAccess40ibays
/etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/90e-smithAccess40ibays

Editera /etc/e-smith/templats-custom/etc/httpd/conf/httpd.conf/90e-smithAccess10primary med tex. pico
Leta efter alla rader, där det står "AllowOverride None"
Och ersätt dessa med "AllowOverride AuthConfig".
Lägg sedan in följande i slutet på filen 90e-smithAccess10primary


Order allow,deny
Deny from all


Editera /etc/e-smith/templats-custom/etc/httpd/conf/httpd.conf/90e-smithAccess40ibays
 med tex. Pico
Leta efter alla rader, där det står "AllowOverride None"
Och ersätt dessa med "AllowOverride AuthConfig".


Nu är filerna editerade och behöver genereras om med följande kommando:

/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf

Starta om Apache webbserver med följand kommando:

/etc/rc.d/init.d/httpd restart

Apache webbserver är nu redo för lösenords skydd av kataloger.
 
Lösenords skydda kataloger

Skapa en fil som heter .htaccess som ska ligga i katalogen som skall skyddas.
Ett exempel på .htaccess

AuthUserFile /home/e-smith/files/ibays/test/password.txt
AuthName “Admin area only”
AuthType Basic


require valid-user



Nu är det dags att skapa filen password.txt och betrodda användare med respektive lösenord.
Gå till aktuell katalog ( den som skall skyddas )

romnet> cd /home/e-smith/files/ibays/test
romnet> htpasswd -c password.txt admin
Adding password for admin.
New password:
Re-type new password:
Skapa en till betrodd användare.
romnet> htpasswd password.txt test
Adding password for test.
New password:
Re-type new password:

Lycka till!
RomNet Datakonsulten
http://office.romnet.nu
Tony Zetterström.
"""""""""""""""""""""""""""""""""""""""""""""""""""""
Title: Re: htaccess
Post by: Coulter on October 20, 2001, 08:09:49 AM
Hey thanx for the help... I still can't figure it out though.... :( I am a linux newbie,  so it is hard enough for me to figure linux out much less Swedish :) is there any way you could translate it to English?

Thanx,
Coulter