Koozali.org: home of the SME Server

.htaccess for SME 7 FINAL

jhale1966

.htaccess for SME 7 FINAL
« on: July 11, 2006, 02:19:17 AM »
I've been searching through the forums about adding .htaccess to some folders I have but all the messages seem to be for pre-final versions of the server.

Does anyone have a HOW-TO for the final?

Thanks! :-D

Offline raem

  • *
  • 3,972
  • +4/-0
Re: .htaccess for SME 7 FINAL
« Reply #1 on: July 11, 2006, 10:11:29 AM »
jhale1966

I would imagine that the answers for recent RC releases would be the same as for the final release.

See this howto which has been reported to work on sme7

http://mirror.contribs.org/smeserver//contribs/rmitchell/smeserver/howto/htaccess%20configuration%20with%20custom%20templates%20HOWTO%20for%20sme%20server.htm
...

jhale1966

.htaccess for SME 7 FINAL
« Reply #2 on: July 11, 2006, 12:58:40 PM »
That's the thing - I've been reading where there are issues with e-smith-htaccess-1.1-2.noarch.rpm being installed. Do I still need this if I use the next part of that HOWTO?

Offline raem

  • *
  • 3,972
  • +4/-0
.htaccess for SME 7 FINAL
« Reply #3 on: July 11, 2006, 01:21:04 PM »
jhale1966

That's the whole point of the howto. No.
...

jhale1966

.htaccess for SME 7 FINAL
« Reply #4 on: July 11, 2006, 01:24:58 PM »
Excellent!

I'll give that a shot later this week. Thanks! :-)

duncan

.htaccess for SME 7 FINAL
« Reply #5 on: July 12, 2006, 02:29:09 AM »
/sbin/e-smith/db accounts setprop ibayname AllowOverride All
/sbin/e-smith/signal-event ibay-modify ibayname

dazza76

e-smith-htaccess-1.1-2.noarch.rpm Fix warning sme7 final
« Reply #6 on: August 08, 2006, 02:04:20 AM »
Just for thoes who care
a quick fix for the warning in e-smith-htaccess-1.1-2.noarch.rpm (http://mirror.contribs.org/smeserver/contribs/nightspirit/e-smith-htaccess/e-smith-htaccess-1.1-2.noarch.rpm)

nano /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/90e-smithAccess40ibays
change
tie %accounts, 'esmith::config', '/home/e-smith/accounts';
to
 tie %accounts, 'esmith::config', '/home/e-smith/db/accounts';

Save and close

/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf
 /etc/init.d/httpd reload


P.s Ray you may wish to add this to the howto for the rpm Part

duncan

.htaccess for SME 7 FINAL
« Reply #7 on: August 08, 2006, 02:09:06 AM »
Just out of curiousity - is the rpm even required in 7.0

dazza76

.htaccess
« Reply #8 on: August 08, 2006, 04:54:02 AM »
if you create custom templates for each folder requiring htacess then no
if you want htacces on all web folders yes

duncan

Re: .htaccess
« Reply #9 on: August 08, 2006, 07:02:55 AM »
Quote from: "dazza76"
if you create custom templates for each folder requiring htacess then no
if you want htacces on all web folders yes


Sorry - not sure I understand. I just put a .htaccess file in whichever folder I need it in and thats it.

dazza76

>htaccess
« Reply #10 on: August 08, 2006, 07:24:18 AM »
For easy use use the rpm
if you do not use the rpm you have to start creating custom templates like in the howto Above.
for an easy install
do this

wget http://mirror.contribs.org/smeserver/contribs/nightspirit/e-smith-htaccess/e-smith-htaccess-1.1-2.noarch.rpm

rpm -Uvh e-smith-htaccess-1.1-2.noarch.rpm
nano /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/90e-smithAccess40ibays
find on line 7
tie %accounts, 'esmith::config', '/home/e-smith/accounts';  
change to
tie %accounts, 'esmith::config', '/home/e-smith/db/accounts';

Save and close

/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf
/etc/init.d/httpd reload

then put the .htaccess files wherever you wish to use them

Offline raem

  • *
  • 3,972
  • +4/-0
Re: .htaccess
« Reply #11 on: August 08, 2006, 07:31:31 AM »
duncan

>..not sure I understand. I just put a .htaccess file in whichever folder I need it in and thats it.

The reason for NOT using .htacess files and the rpm is outlined in the howto, to quote:

.htaccess files are inherently exposed to the Internet and require the correct permissions to be applied to ensure that unauthorised access is not allowed, therefore creating a security risk.

The better way to implement .htaccess in sme server is to use custom templates, which are only under the control of the administrator and cannot be tampered with by anonymous Internet users. Using this method you do NOT need to install the abovementioned rpm.
...

duncan

Re: .htaccess
« Reply #12 on: August 08, 2006, 07:44:08 AM »
Quote from: "RayMitchell"
duncan

>..not sure I understand. I just put a .htaccess file in whichever folder I need it in and thats it.

The reason for NOT using .htacess files and the rpm is outlined in the howto, to quote:

.htaccess files are inherently exposed to the Internet and require the correct permissions to be applied to ensure that unauthorised access is not allowed, therefore creating a security risk.

The better way to implement .htaccess in sme server is to use custom templates, which are only under the control of the administrator and cannot be tampered with by anonymous Internet users. Using this method you do NOT need to install the abovementioned rpm.


That may be the case - however how does that handle multiple occurrences of .htaccess in the top level web folder and folders below. Or should I say how do you handle templating within lower level folders.

I find it easier to do

Code: [Select]
/sbin/e-smith/db accounts setprop ibayname AllowOverride All
/sbin/e-smith/signal-event ibay-modify ibayname


and make sure .htaccess protected correctly. It supposedly slows the particular site down - but I would think it marginal.

Offline raem

  • *
  • 3,972
  • +4/-0
Re: .htaccess
« Reply #13 on: August 08, 2006, 08:09:20 AM »
duncan

> ...how do you handle templating within lower level folders.

I'm far from an expert on the subject, but I assume the answer is to use multiple custom template fragments.

> I find it easier to do...

Easier but less secure.
...

duncan

Re: .htaccess
« Reply #14 on: August 08, 2006, 09:23:15 AM »
Quote from: "RayMitchell"

I'm far from an expert on the subject, but I assume the answer is to use multiple custom template fragments.


Be a bit messy I should think.

Regardless - my question was if the rpm was needed in version 7.0. I dont see the need for it as htaccess will work using the method I have outlined above.