Koozali.org formerly Contribs.org

.htaccess in ibay

.htaccess in ibay
« on: March 25, 2008, 08:59:17 AM »
I am installing a software in an ibay that requires .htaccess file.
From what I have read here on the forums is that by default .htaccess will not function on SME Server. So to enable it I have given following command:
/sbin/e-smith/db accounts setprop IBAYNAME AllowOverride All
/sbin/e-smith/signal-event ibay-modify IBAYNAME

Now when I try to access the ibay, I get a message:
--------------------------------------------------------------
Forbidden

You don't have permission to access / on this server.

Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.
--------------------------------------------------------------

When I remove the .htaccess file, I am able to access the ibay, but the program does not  function properly.


The contents of .htaccess are:

ErrorDocument 403 /index.php?do=/public/error/403/

ErrorDocument 404 /index.php?do=/public/error/404/



RewriteEngine On



RewriteCond %{REQUEST_URI} !^/file/.*

RewriteCond %{REQUEST_URI} !^/install/.*

RewriteCond %{REQUEST_URI} !^/design/.*

RewriteCond %{REQUEST_URI} !^/plugins/.*

RewriteRule ^index.php(/.*)$ /index.php?do=$1 [L]



RewriteCond %{REQUEST_URI} !^/file/.*

RewriteCond %{REQUEST_URI} !^/install/.*

RewriteCond %{REQUEST_URI} !^/design/.*

RewriteCond %{REQUEST_URI} !^/plugins/.*

RewriteCond %{REQUEST_URI} !^/index.php

RewriteCond %{REQUEST_URI} !^/robots.txt

RewriteCond %{REQUEST_URI} !^/favicon.ico

RewriteRule ^(.*)$ /index.php?do=/$1 [L]
« Last Edit: March 25, 2008, 05:20:33 PM by calisun »
SME user and community member since 2005.
Want to install Wordpress in iBay of SME Server?
See my step-by-step How-To wiki here:
http://wiki.contribs.org/Wordpress_Multisite

Re: .htaccess in ibay
« Reply #1 on: March 25, 2008, 10:26:45 PM »
Does anybody know how to fix this?
SME user and community member since 2005.
Want to install Wordpress in iBay of SME Server?
See my step-by-step How-To wiki here:
http://wiki.contribs.org/Wordpress_Multisite

Re: .htaccess in ibay
« Reply #2 on: March 25, 2008, 11:00:32 PM »

Re: .htaccess in ibay
« Reply #3 on: March 25, 2008, 11:09:58 PM »
I am installing a software in an ibay that requires .htaccess file.

No it doesn't. You can provide the apache configuration your application needs via a custom template fragment.

Re: .htaccess in ibay
« Reply #4 on: March 26, 2008, 12:11:01 AM »
Thanks Normando
From the link you gave me it looks like I used a wrong command, I used AllowOverride, but I should have used FollowSymLinks.

How do I reverse my previous command??

After I remove my previous wrong command, the new command should look something like this:
/sbin/e-smith/db accounts setprop IBAYNAME FollowSymLinks "value"

How do I find a "value"? I googled FollowSymLinks value but no luck.

No it doesn't. You can provide the apache configuration your application needs via a custom template fragment.
From what I have read here in the forums, only disadvantage to .htaccess file is if it has wrong permissions, someone can get to it. I am very careful about setting correct permissions.
Besides, I am not a programmer and I have no idea how to create custom template. I know I am taking an easy way out, but no time for everything and to learn how to write custom template.
« Last Edit: March 26, 2008, 12:19:43 AM by calisun »
SME user and community member since 2005.
Want to install Wordpress in iBay of SME Server?
See my step-by-step How-To wiki here:
http://wiki.contribs.org/Wordpress_Multisite

Offline raem

  • *
  • 3,972
Re: .htaccess in ibay
« Reply #5 on: March 26, 2008, 04:29:47 AM »
calisun

Quote
... I have no idea how to create custom template....no time .... to learn how to write custom template.

See
http://wiki.contribs.org/Htaccess

Whatever you would put into the .htaccess file, you put into the cusom template instead, nothing really to learn.
...

Re: .htaccess in ibay
« Reply #6 on: March 26, 2008, 03:55:17 PM »
I think I got it, but now I get the same "Forbidden" message as I did earlier. But now there is no way for be to bypass it like I did earlier by removing .htaccess file.

It seems like I need to reverse my original command:
/sbin/e-smith/db accounts setprop IBAYNAME AllowOverride All

How do I reverse my previous command??

I have never got the "Forbidden" message before until I gave that command.


SME user and community member since 2005.
Want to install Wordpress in iBay of SME Server?
See my step-by-step How-To wiki here:
http://wiki.contribs.org/Wordpress_Multisite

Offline raem

  • *
  • 3,972
Re: .htaccess in ibay
« Reply #7 on: March 26, 2008, 04:04:37 PM »
calisun

for syntax type
db

Carefully read & think about what you see and apply that to the db command you previously used.

So to remove that entry do
db accounts delprop IBAYNAME AllowOverride
signal-event ibay-modify IBAYNAME

It's always wise to backup anything before you make changes, so firstly do
cp /home/e-smith/db/accounts /tmp/accounts.save
or at least do
db accounts show IBAYNAME
and make a careful note of the various entries

Remember everything in tmp periodically gets deleted.
...

Re: .htaccess in ibay
« Reply #8 on: March 26, 2008, 04:40:14 PM »
I did the command, but I still get the "Forbidden" message
Here is output of:

[root@x ~]# db accounts show IBAYNAME
IBAYNAME=ibay
    CgiBin=enabled
    Gid=5002
    Group=admin
    Name=IBAYNAME
    PHPBaseDir=/home/e-smith/files/ibays/IBAYNAME/:/tmp
    PasswordSet=no
    PublicAccess=global
    Uid=5002
    UserAccess=wr-group-rd-everyone

Here is contents of my custom template:

<Directory /home/e-smith/files/ibays/IBAYNAME/html>
ErrorDocument 403 /index.php?do=/public/error/403/
ErrorDocument 404 /index.php?do=/public/error/404/

RewriteEngine On

RewriteCond %{REQUEST_URI} !^/file/.*
RewriteCond %{REQUEST_URI} !^/install/.*
RewriteCond %{REQUEST_URI} !^/design/.*
RewriteCond %{REQUEST_URI} !^/plugins/.*
RewriteRule ^index.php(/.*)$ /index.php?do=$1 [L]

RewriteCond %{REQUEST_URI} !^/file/.*
RewriteCond %{REQUEST_URI} !^/install/.*
RewriteCond %{REQUEST_URI} !^/design/.*
RewriteCond %{REQUEST_URI} !^/plugins/.*
RewriteCond %{REQUEST_URI} !^/index.php
RewriteCond %{REQUEST_URI} !^/robots.txt
RewriteCond %{REQUEST_URI} !^/favicon.ico
RewriteRule ^(.*)$ /index.php?do=/$1 [L]
</Directory>
« Last Edit: April 14, 2008, 04:53:25 AM by slords »
SME user and community member since 2005.
Want to install Wordpress in iBay of SME Server?
See my step-by-step How-To wiki here:
http://wiki.contribs.org/Wordpress_Multisite

Offline cactus

  • *
  • 4,880
    • http://www.snetram.nl
Re: .htaccess in ibay
« Reply #9 on: March 26, 2008, 05:50:20 PM »
I did the command, but I still get the "Forbidden" message
And what do your /var/log/httpd/access_log and/var/log/httpd/error_log say at the time you experience the error? There most likely should be a clue in them.
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Re: .htaccess in ibay
« Reply #10 on: March 26, 2008, 06:14:15 PM »
Nothing relevant in access log, but in error log I see this:

[Wed Mar 26 08:29:10 2008] [error] [client 192.168.3.249] Options FollowSymLinks or SymLinksIfOwnerMatch is off which implies that RewriteRule directive is forbidden: /home/e-smith/files/ibays/IBAYNAME/html/
[Wed Mar 26 08:29:10 2008] [error] [client 192.168.3.249] Options FollowSymLinks or SymLinksIfOwnerMatch is off which implies that RewriteRule directive is forbidden: /home/e-smith/files/ibays/IBAYNAMEhtml/index.php
[Wed Mar 26 08:48:38 2008] [error] [client 192.168.3.249] Options FollowSymLinks or SymLinksIfOwnerMatch is off which implies that RewriteRule directive is forbidden: /home/e-smith/files/ibays/IBAYNAME/html/
[Wed Mar 26 08:48:38 2008] [error] [client 192.168.3.249] Options FollowSymLinks or SymLinksIfOwnerMatch is off which implies that RewriteRule directive is forbidden: /home/e-smith/files/ibays/IBAYNAME/html/index.php
[Wed Mar 26 08:49:10 2008] [error] [client 192.168.3.249] Options FollowSymLinks or SymLinksIfOwnerMatch is off which implies that RewriteRule directive is forbidden: /home/e-smith/files/ibays/IBAYNAME/html/
[Wed Mar 26 08:49:10 2008] [error] [client 192.168.3.249] Options FollowSymLinks or SymLinksIfOwnerMatch is off which implies that RewriteRule directive is forbidden: /home/e-smith/files/ibays/IBAYNAME/html/index.php
[Wed Mar 26 10:07:48 2008] [error] [client 192.168.3.249] Options FollowSymLinks or SymLinksIfOwnerMatch is off which implies that RewriteRule directive is forbidden: /home/e-smith/files/ibays/IBAYNAME/html/
[Wed Mar 26 10:07:48 2008] [error] [client 192.168.3.249] Options FollowSymLinks or SymLinksIfOwnerMatch is off which implies that RewriteRule directive is forbidden: /home/e-smith/files/ibays/IBAYNAME/html/index.php
« Last Edit: April 14, 2008, 04:54:51 AM by slords »
SME user and community member since 2005.
Want to install Wordpress in iBay of SME Server?
See my step-by-step How-To wiki here:
http://wiki.contribs.org/Wordpress_Multisite

Offline cactus

  • *
  • 4,880
    • http://www.snetram.nl
Re: .htaccess in ibay
« Reply #11 on: March 26, 2008, 06:37:40 PM »
Nothing relevant in access log, but in error log I see this:

[Wed Mar 26 08:29:10 2008] [error] [client 192.168.3.249] Options FollowSymLinks or SymLinksIfOwnerMatch is off which implies that RewriteRule directive is forbidden: /home/e-smith/files/ibays/IBAYNAME/html/
The error more or less says what is your problem: you do not have the necesarry settings enabled on your ibay.

You can try enabling it like this and see if that changes anything (replace ibayname with your ibay):

Code: [Select]
db accounts setprop ibayname FollowSymLinks enabled
signal-event ibay-modify ibayname

Note: commands are case sensitive.

Edit: Changed db command to be correct based on this comment by RayMitchell. Thanks Ray for the pointer!
« Last Edit: April 14, 2008, 04:55:17 AM by slords »
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Re: .htaccess in ibay
« Reply #12 on: March 26, 2008, 06:38:03 PM »
Thanks Normando
From the link you gave me it looks like I used a wrong command, I used AllowOverride, but I should have used FollowSymLinks.
You need the two commands. FollowSymLinks enabled and AllowOverride All

Offline cactus

  • *
  • 4,880
    • http://www.snetram.nl
Re: .htaccess in ibay
« Reply #13 on: March 26, 2008, 06:40:16 PM »
You need the two commands. FollowSymLinks enabled and AllowOverride All
You do not need the latter AFAIK as that is only necessary if you would override settings using for example .htaccess files, if you are not using them all settings are done using the webservers configuration files and you do not need override access.Oops, post is in wrong topic, please disregard my comments.
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline raem

  • *
  • 3,972
Re: .htaccess in ibay
« Reply #14 on: March 27, 2008, 05:46:58 AM »
cactus

Quote
db accounts ibayname setprop FollowSymLinks enabled
signal-event ibay-modify ibayname

So as not to confuse future readers, that should be

db accounts setprop ibayname FollowSymLinks enabled
signal-event ibay-modify ibayname


Here is the syntax for the db command (on sme 7.x the /sbin/e-smith/ part can be left out)

db
usage:
    /sbin/e-smith/db dbfile keys
    /sbin/e-smith/db dbfile print [key]
    /sbin/e-smith/db dbfile show [key]
    /sbin/e-smith/db dbfile get key
    /sbin/e-smith/db dbfile set key type [prop1 val1] [prop2 val2] ...
    /sbin/e-smith/db dbfile setdefault key type [prop1 val1] [prop2 val2] ...
    /sbin/e-smith/db dbfile delete key
    /sbin/e-smith/db dbfile printtype [key]
    /sbin/e-smith/db dbfile gettype key
    /sbin/e-smith/db dbfile settype key type
    /sbin/e-smith/db dbfile printprop key [prop1] [prop2] [prop3] ...
    /sbin/e-smith/db dbfile getprop key prop
    /sbin/e-smith/db dbfile setprop key prop1 val1 [prop2 val2] [prop3 val3] ...
    /sbin/e-smith/db dbfile delprop key prop1 [prop2] [prop3] ...
...

Re: .htaccess in ibay
« Reply #15 on: March 27, 2008, 05:58:34 AM »
Calisum

You need to run these commands:

Code: [Select]
db accounts setprop ibayname FollowSymLinks enabled
db accounts setprop ibayname AllowOverride All
signal-event ibay-modify ibayname

Offline cactus

  • *
  • 4,880
    • http://www.snetram.nl
Re: .htaccess in ibay
« Reply #16 on: March 29, 2008, 09:00:02 AM »
cactus

So as not to confuse future readers, that should be

db accounts setprop ibayname FollowSymLinks enabled
signal-event ibay-modify ibayname
Ray thanks for the pointer! I have changed refferenced post to be correct as to prevent confusion all together.
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)