Koozali.org: home of the SME Server

Obsolete Releases => SME Server 7.x => Topic started by: jhale1966 on July 11, 2006, 02:19:17 AM

Title: .htaccess for SME 7 FINAL
Post by: jhale1966 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
Title: Re: .htaccess for SME 7 FINAL
Post by: raem 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
Title: .htaccess for SME 7 FINAL
Post by: jhale1966 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?
Title: .htaccess for SME 7 FINAL
Post by: raem on July 11, 2006, 01:21:04 PM
jhale1966

That's the whole point of the howto. No.
Title: .htaccess for SME 7 FINAL
Post by: jhale1966 on July 11, 2006, 01:24:58 PM
Excellent!

I'll give that a shot later this week. Thanks! :-)
Title: .htaccess for SME 7 FINAL
Post by: duncan 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
Title: e-smith-htaccess-1.1-2.noarch.rpm Fix warning sme7 final
Post by: dazza76 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
Title: .htaccess for SME 7 FINAL
Post by: duncan on August 08, 2006, 02:09:06 AM
Just out of curiousity - is the rpm even required in 7.0
Title: .htaccess
Post by: dazza76 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
Title: Re: .htaccess
Post by: duncan 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.
Title: >htaccess
Post by: dazza76 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
Title: Re: .htaccess
Post by: raem 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.
Title: Re: .htaccess
Post by: duncan 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.
Title: Re: .htaccess
Post by: raem 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.
Title: Re: .htaccess
Post by: duncan 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.
Title: Re: .htaccess
Post by: raem on August 08, 2006, 09:33:39 AM
To all

This thread is of interest as it uses the htaccess custom template differently, which is the general concept anyway ie make the custom template reflect what you would put in a normal .htaccess file.

http://forums.contribs.org/index.php?topic=32078.0