Koozali.org: home of the SME Server

htaccess

Offline AlexG

  • ****
  • 110
  • +0/-0
htaccess
« on: October 29, 2007, 06:37:16 AM »
Hi

I have a 7.2 SME Version and tried to install the e-smith-htaccess rpm. While installing this rpm some errors occured. But this package appears in the installed software, but does not work. Who has experience with this htaccess?

Offline raem

  • *
  • 3,972
  • +4/-0
Re: htaccess
« Reply #1 on: October 29, 2007, 07:19:04 AM »
AlexG

You don't say what versipn rpm, but my guess is that it is not compatible with 7.x.
You don't need an rpm, see
http://wiki.contribs.org/Htaccess_configuration
...

Offline AlexG

  • ****
  • 110
  • +0/-0
Re: htaccess
« Reply #2 on: October 29, 2007, 09:00:10 AM »
Hi

Thank you for the quick answer.
I am working on this how to, but this line does not work: /etc/e-smith/events/actions/restart-httpd-graceful
It appears 'command not found'

Offline raem

  • *
  • 3,972
  • +4/-0
Re: htaccess
« Reply #3 on: October 29, 2007, 09:22:45 AM »
AlexG

Quote
/etc/e-smith/events/actions/restart-httpd-graceful 'command not found'


This should do it.

sv t /service/httpd-e-smith

Then to check the service has restarted correctly

sv s /service/httpd-e-smith


Howto updated
« Last Edit: October 29, 2007, 09:29:06 AM by RayMitchell »
...

Offline AlexG

  • ****
  • 110
  • +0/-0
Re: htaccess
« Reply #4 on: October 29, 2007, 09:34:14 AM »
I tried it but it does not work:

sv t /service/httpd-e-smith <enter>
sv s /service/httpd-e-smith <enter>
run: /service/httpd-e-smith: (pid 5370) 8s, normally down
/etc/e-smith/events/actions/restart-httpd-graceful <enter>
-bash: /etc/e-smith/events/actions/restart-httpd-graceful: Datei oder Verzeichnis nicht gefunden (File or Folder not found)

Offline raem

  • *
  • 3,972
  • +4/-0
Re: htaccess
« Reply #5 on: October 29, 2007, 10:08:12 AM »
AlexG

Quote
sv t /service/httpd-e-smith <enter>
sv s /service/httpd-e-smith <enter>
run: /service/httpd-e-smith: (pid 5370) 8s, normally down

That looks like it "worked" correctly to me.
You restarted the service with sv t .... and checked it was running with sv s.... which says the service has been running for 8 seconds since you restarted it.


The above commands replace the old command, so do not run the old command anymore as it is deprecated.
ie do not use
/etc/e-smith/events/actions/restart-httpd-graceful <enter>

...

Offline AlexG

  • ****
  • 110
  • +0/-0
Re: htaccess
« Reply #6 on: October 29, 2007, 10:34:47 AM »
Nearly fine - The login screen appears - but does not accept the password. I have checked for any typo error - without success.
What does the row '/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf' mean? Do I have to write this after every changes?

Offline raem

  • *
  • 3,972
  • +4/-0
Re: htaccess
« Reply #7 on: October 29, 2007, 10:58:26 AM »
AlexG

Quote
What does the row '/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf' mean? Do I have to write this after every changes?

You only run that command to expand the template once, immediately after creating the custom template.


Quote
Nearly fine - The login screen appears - but does not accept the password.

Did you create the user/password file by carefully following the instructions given ?

...

Offline AlexG

  • ****
  • 110
  • +0/-0
Re: htaccess
« Reply #8 on: October 29, 2007, 11:24:35 AM »
Yes I did and the Browser is asking one folder up than specified.

<Directory /home/e-smith/files/ibays/ibayname/html/project/_name/html>
  AuthUserFile /etc/passwd
  AuthGroupFile /dev/null
  AuthName "Name"
  AuthType Basic
  <Limit GET>
    order deny,allow
    require valid-user
  </Limit>
</Directory>

I compared this with /etc/httpd/conf/htpd.conf - it's the same
Created the /etc/passwd with 'cd /etc; htpasswd -c passwd user1'  :-?

Offline raem

  • *
  • 3,972
  • +4/-0
Re: htaccess
« Reply #9 on: October 29, 2007, 12:02:03 PM »
AlexG

Quote
Yes I did and the Browser is asking one folder up than specified.
<Directory /home/e-smith/files/ibays/ibayname/html/project/_name/html>

Check your configuration carefully.

I followed the howto (with the revised sv t ... command) and it works OK on a sme7.2 server
ie to
/home/e-smith/files/ibays/testibay/html/folder1/testfolder

When I browse to
www.mydomain.com/folder1/testfolder
I get asked to login, I supply the user name and password I entered into the password file and I get access OK.
...

Offline AlexG

  • ****
  • 110
  • +0/-0
Re: htaccess
« Reply #10 on: October 29, 2007, 12:09:58 PM »
I will check it carefully. One last question: How can I delete these changes to the originating (after deleting this folder)?

Thanks a lot, have a nice day!

Offline raem

  • *
  • 3,972
  • +4/-0
Re: htaccess
« Reply #11 on: October 30, 2007, 02:10:42 AM »
AlexG

Do the reverse process, that's the beauty of custom templates changes.
ie
delete the custom template you added
expand the template
restart httpd-e-smith

delete the password file

...

Offline AlexG

  • ****
  • 110
  • +0/-0
Re: htaccess
« Reply #12 on: October 30, 2007, 02:27:05 AM »
Hi

Do you mean with restarting 'sv t /service/httpd-e-smith <enter>'?

After this the server was down - I did 'sv t /service/httpd-e-smith <enter>' again and nothing happened and there was no way to reboot the server. Is witched him off. Started again - many errors occurred :shock:. I have deleted the 50AddSecureIbayFolder File, I have edited the http.conf file and it seems to work again.

The way is?
- Editing the custom template
- Expanding the template with '/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf <enter>'
- restarting the httpd-e-smith with 'sv t /service/httpd-e-smith <enter>'
« Last Edit: October 30, 2007, 02:35:47 AM by AlexG »

Offline raem

  • *
  • 3,972
  • +4/-0
Re: htaccess
« Reply #13 on: October 30, 2007, 02:56:21 AM »
AlexG

The command syntax is slightly different in sme7, so you can do the following (replacing file names with those you used of course)

rm /etc/passwordfilename
rm /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf 50AddSecureIbayFolder
expand-template /etc/httpd/conf/httpd.conf
sv t /service/httpd-e-smith

It is recommended practise to check that the service did actually restart and is running, with
sv s /service/httpd-e-smith


Quote
The way is?
- Editing the custom template
- Expanding the template with '/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf <enter>'
- restarting the httpd-e-smith with 'sv t /service/httpd-e-smith <enter>'

Yes, but in sme7 you can leave out the /sbin/e-smith/ part ie

'expand-template /etc/httpd/conf/httpd.conf <enter>'
...

Offline AlexG

  • ****
  • 110
  • +0/-0
Re: htaccess
« Reply #14 on: October 30, 2007, 03:14:48 AM »
[root@sme-1 httpd.conf]# rm campasswd
[root@sme-1 httpd.conf]# rm 50AddSecureIbayFolder
[root@sme-1 httpd.conf]# expand-template /etc/httpd/conf/httpd.conf
[root@sme-1 httpd.conf]# sv t /service/httpd-e-smith
[root@sme-1 httpd.conf]# sv s /service/httpd-e-smith
run: /service/httpd-e-smith: (pid 4757) 10s, normally down

Sorry, but from this point the server is doing nothing anymore. I can not reboot or shutdown. I have to switch him off and boot again.

Best regards
AlexG