Koozali.org: home of the SME Server

Isn't .htaccess supportet on the SME 6.0.1?

WEBlance

Isn't .htaccess supportet on the SME 6.0.1?
« on: January 28, 2005, 12:43:09 PM »
Hi,

I'm trying to secure a directory with .htaccess but it doesn't work. I've read a thread on another forum that SME doesn't support .htaccess usage but can if I install a certain RPM?

Please help!

/Carl

knut

Isn't .htaccess supportet on the SME 6.0.1?
« Reply #1 on: January 28, 2005, 02:08:58 PM »
You can enable htaccess with this contrib:
http://mirror.contribs.org/smeserver/contribs/nightspirit/e-smith-htaccess/
It works fine for my website on SME 6.0.1.

Regards

Knut

WEBlance

Isn't .htaccess supportet on the SME 6.0.1?
« Reply #2 on: January 28, 2005, 03:35:07 PM »
Yes this worked!

Thank You

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: Isn't .htaccess supportet on the SME 6.0.1?
« Reply #3 on: January 30, 2005, 04:53:20 PM »
Quote from: "WEBlance"
Hi,

I'm trying to secure a directory with .htaccess but it doesn't work. I've read a thread on another forum that SME doesn't support .htaccess usage but can if I install a certain RPM?


You don't need .htaccess support. Just create a new httpd.conf custom template fragment.

mark_53

Isn't .htaccess supportet on the SME 6.0.1?
« Reply #4 on: February 12, 2005, 10:29:10 PM »
"You don't need .htaccess support. Just create a new httpd.conf custom template fragment."

Sounds easy, can you explain which fragment you create and what do you change?

Using 6.01.

Thanks
M

WEBlance

Isn't .htaccess supportet on the SME 6.0.1?
« Reply #5 on: February 13, 2005, 06:40:18 PM »
Well the contrib worked fine so using that or modifying the httpd.conf is the same for me  :pint:

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Isn't .htaccess supportet on the SME 6.0.1?
« Reply #6 on: February 13, 2005, 08:44:53 PM »
Quote from: "WEBlance"
Well the contrib worked fine so using that or modifying the httpd.conf is the same for me  :pint:


Using .htaccess is definitely less secure. httpd.conf templates are definitely under admin's control. .htaccess files are not, and could have insecure permissions.

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Isn't .htaccess supportet on the SME 6.0.1?
« Reply #7 on: February 13, 2005, 08:48:32 PM »
Quote from: "mark_53"

Sounds easy, can you explain which fragment you create and what do you change?


Create a fragment with a name of your choice in /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf. It should contain

<Directory /path/you/want/to/configure>
stuff
</Directory>

where "stuff" is pretty much what you wanted to put into your .htaccess file.

Then:

/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf
/etc/e-smith/events/actions/restart-httpd-graceful

Offline raem

  • *
  • 3,972
  • +4/-0
Isn't .htaccess supportet on the SME 6.0.1?
« Reply #8 on: February 16, 2005, 09:26:38 AM »
Dear Charlie

Than you for that tip, I was wanting to implement that and you steered me in the right direction.

> where "stuff" is pretty much what you wanted to
> put into your .htaccess file.

So after reading a bit about .htaccess here, I found out what the "stuff" is.
http://www.its.queensu.ca/network/policy/htaccess.shtml

I created a fragment like this

<Directory /home/e-smith/files/ibays/testsite2/html/w1/admin>
AuthuserFile /etc/testsite2w1admin-htpasswd
AuthGroupFile /dev/null
AuthName "Security Group"

AuthType Basic

<Limit GET>
order deny,allow
require valid-user
</Limit>
</Directory>

which uses the password file specified and works OK.

Is it possible to use existing password files that the sme server uses and authenticate against those, instead of making different password files and adding users. Is it also possible to authenticate against group membership much in the same way that sme does it for local access ?

Thanks & Regards
...

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Isn't .htaccess supportet on the SME 6.0.1?
« Reply #9 on: February 16, 2005, 06:24:03 PM »
Quote from: "RayMitchell"

Is it possible to use existing password files that the sme server uses and authenticate against those, instead of making different password files and adding users.


Yes, see how authentication is done for access to server-manager.

Quote

Is it also possible to authenticate against group membership much in the same way that sme does it for local access ?


Probably. One way to do it is just to expand the group to a list of usernames inside a template fragment. But there's almost certainly a way to consult /etc/group at runtime - see apache module documentation.