Koozali.org: home of the SME Server

mod_rewrite

Offline jameswilson

  • *
  • 745
  • +0/-0
    • Security Warehouse, trade security equipment
mod_rewrite
« on: February 27, 2007, 03:27:07 AM »
Hiyah all,
Im having a small problem with a blog (wordpress) where i want to enable permalinks and it says i need mod_rewrite.

I have read various things about option all etc but wonder if i can turn this on server wide, as most of the things that run on it need or will need mod_rewrite to function. If i turn on permalinks now then i get page not found errors, i assume this is because mod_rewrite is disabled?

Am i wrong, really wrong, or 'you have no idea how wrong you are'? lol

Cheers people

James

Offline jameswilson

  • *
  • 745
  • +0/-0
    • Security Warehouse, trade security equipment
mod_rewrite
« Reply #1 on: March 05, 2007, 03:49:59 AM »
i again, just wondering if any of the lads that know this could pop in?

I have an smf forum on this server too now, and would love to have the url rewritten but i obviosly need mod_rewrite to work for that, and im a bit stuck?

cheerss

James

Offline Curly

  • ***
  • 114
  • +0/-0
mod_rewrite
« Reply #2 on: March 05, 2007, 05:02:32 PM »
I think mod_rewrite is default on, just add
Code: [Select]
RewriteEngine on to the .htaccess file.

I've got it working (not with your forum)

If not, then I've changed something unconsiously, that would be spooky.
.......................................

Offline jameswilson

  • *
  • 745
  • +0/-0
    • Security Warehouse, trade security equipment
mod_rewrite
« Reply #3 on: March 05, 2007, 05:08:25 PM »
Curly, many thanks for the reply. I have done that before to no differece.
But I have installed 3 things now as at first i though 'it cant be sme must be the app' lol. But neither wordpress or smf forum will function with rewrite. The .htaccess is created by the site and placed in ht e relevant folder. I even tried the wordpress contrib in the hope that would work. It didnt for pretty url's. I remeber reading about 'option explicit all' as it appears sme is set to none, but as im not sure what im doing, im looking for guidance from one of you lot! lol

cheers again

James

Offline russs

  • ***
  • 77
  • +0/-0
mod_rewrite
« Reply #4 on: March 06, 2007, 05:17:04 PM »
Hi Guys,

I have just posted elsewhere about this as I would like to force SSL on a KnowledgeTree install. It has an .htaccess file in which I have placed the relevant commands but to no effect.

Read somewhere else that .htaccess files won't work with SME server nowadays so would be interested to know the answer myself.
...

Offline haymann

  • *
  • 212
  • +0/-0
mod_rewrite
« Reply #5 on: March 06, 2007, 05:50:52 PM »
Hey Russs,

You were involved a little in this thread awhile back. Did you try
Code: [Select]
# /sbin/e-smith/db accounts setprop <ibayname> AllowOverride All
# /sbin/e-smith/signal-event ibay-modify <ibayname>
as suggested by slords? That is the last post in that thread (as of now...). I believe that is what I did to enable .htaccess, but it has been awhile and I'm not positive...

I don't know if that will help with the mod_rewrite problems that this thread started out as...
Ryan

Offline russs

  • ***
  • 77
  • +0/-0
mod_rewrite
« Reply #6 on: March 06, 2007, 05:56:50 PM »
Thanks Mate,

trouble is, the sme-KnowledgeTree RPM installs to /opt/knowledgeTree!

Would be much easy if it just installed in an iBay!
...

Offline haymann

  • *
  • 212
  • +0/-0
mod_rewrite
« Reply #7 on: March 06, 2007, 06:05:35 PM »
Quote from: "russs"
Thanks Mate,

trouble is, the sme-KnowledgeTree RPM installs to /opt/knowledgeTree!

Would be much easy if it just installed in an iBay!
Ahhh... that does present a problem... I know that installing to an ibay is not the preferred method, but you are correct in saying it makes some things easier. I guess making things secure, doesn't necessarily make things easier to configure...

Offline russs

  • ***
  • 77
  • +0/-0
mod_rewrite
« Reply #8 on: March 06, 2007, 06:21:02 PM »
Yep.

Well, I've manage to struggle my way through creating a template in /etc/e-smith/custom-templates for httpd.conf and I can now select https for the knowledgeTree directory but cannot force it, this is what I am using from another site;

<IfModule !mod_ssl.c>
Redirect permanent / https://192.168.0.3/knowledgeTree/
</IfModule>
RewriteEngine  on
RewriteCond %{ENV:GEOIP_COUNTRY_CODE}  [NC]
RewriteRule ^$  [L]

RewriteCond %{HTTP_USER_AGENT}  ^Mozilla/[345].*Gecko*
RewriteRule ^$  [L]

RewriteCond %{HTTP_USER_AGENT}  ^Mozilla/[345].*MSIE*
RewriteRule ^$  [L]

RewriteCond %{HTTP_USER_AGENT}  ^Mozilla/[12].* [OR]
RewriteCond %{HTTP_USER_AGENT}  ^Lynx/*
RewriteRule ^$  [L]

RewriteRule ^$  [L]

RewriteRule (.*) /$1 [PT]
DirectoryIndex /opt/knowledgeTree


What do you think, complete nonsense or seems to make sense!

Thanks for you help

Russ
...

Offline jameswilson

  • *
  • 745
  • +0/-0
    • Security Warehouse, trade security equipment
mod_rewrite
« Reply #9 on: March 07, 2007, 01:56:57 AM »
Quote from: "haymann"
Hey Russs,

You were involved a little in this thread awhile back. Did you try
Code: [Select]
# /sbin/e-smith/db accounts setprop <ibayname> AllowOverride All
# /sbin/e-smith/signal-event ibay-modify <ibayname>
as suggested by slords? That is the last post in that thread (as of now...). I believe that is what I did to enable .htaccess, but it has been awhile and I'm not positive...

I don't know if that will help with the mod_rewrite problems that this thread started out as...
Ryan


haymann i tried your suggestion, but when i do that i now get 'forbidden' errors. Its obviously something but hasnt helped with mod-rewrite lol
Any further suggestions?

Offline jameswilson

  • *
  • 745
  • +0/-0
    • Security Warehouse, trade security equipment
mod_rewrite
« Reply #10 on: March 07, 2007, 02:10:24 AM »
is this question/ answer something i can pay for? or am i just being daft now?  Im sure sme can do this, its just the limit of the pink squidgy thing sitting in front of it

Offline haymann

  • *
  • 212
  • +0/-0
mod_rewrite
« Reply #11 on: March 07, 2007, 05:28:44 AM »
Quote from: "jameswilson"
its just the limit of the pink squidgy thing sitting in front of it
:) I feel the same thing most days :)  Is the .htaccess recognized at all? Do you have wordpress installed on an ibay? I am pretty sure that the suggestion that I found earlier in this thread is what I used so that I could use .htaccess so that I didn't have to modify php.ini (or learn to create custom templates...). If the .htaccess is recognized, does Curly's suggestion work now? I have never tried to setup mod_rewrite myself...

Russs,
I just stumbled across a how-to from Ray Mitchell about forcing https. It is old, but might still apply??

Offline jameswilson

  • *
  • 745
  • +0/-0
    • Security Warehouse, trade security equipment
mod_rewrite
« Reply #12 on: March 07, 2007, 11:42:08 AM »
Quote from: "Curly"
I think mod_rewrite is default on, just add
Code: [Select]
RewriteEngine on to the .htaccess file.

I've got it working (not with your forum)

If not, then I've changed something unconsiously, that would be spooky.


i have double checked this and still it says page not found.
Sorry to bang on but im running out of options as i need to get this on. Is there anything else like sme(obviously not as good as) that would do this and mirror drives etc and be as stable?

Offline russs

  • ***
  • 77
  • +0/-0
mod_rewrite
« Reply #13 on: March 07, 2007, 01:36:20 PM »
Well Guys,

I have gotten around my problem, not sure how much it will help you but I'll let you know just in case. It might perhaps help someone else too who is setting up KnowledgeTree.

I removed the RPM for KT3.1 with rpm -e and then manually deleted the MySQL DMS KT database by using the sme-phpmyadmin rpm (I know I should have used the command-line for this but was feeling lazy).

I then just created my own Docs iBay, dumped the knowledgeTree files in there with the right permissions, set up the DMS MySQL databse again and used this post as a reference to allow .htaccess in the iBay to work and to set up the bay for knowledgeTree;

http://forums.knowledgetree.com/viewtopic.php?t=1321&highlight=sme

Then the rules in the .htaccess in the Docs iBay came into effect successfully.

For those who are setting up KnowledgeTree and having trouble setting up the catdoc, pdftotext paths etc, then by first installing the VanHees KT rpm and following the instructions on the original post here;

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

and then removing the RPM as I mentioned above I got myself the latest version of KnowledgeTree (3.3.2 instead of 3.1) after following the instructions at the top of this post! I know this is an extremely long-winded way of doing it but it just worked for me!
bpivk has reported that he is currently updating the sme-knowledgeTree rpm to the latest version but will be a while yet.

Hope that is of help to someone.
...

Offline bpivk

  • *
  • 908
  • +0/-0
    • http://www.bezigrad.com
mod_rewrite
« Reply #14 on: March 07, 2007, 04:36:49 PM »
Quote
bpivk has reported that he is currently updating the sme-knowledgeTree rpm to the latest version but will be a while yet

Yes. I'll update the rpm as soon as i fix my laptop and install a new Os on it + vmware to test the rpm.
"It should just work" if it doesn't report it. Thanks!