Koozali.org: home of the SME Server
Obsolete Releases => SME Server 7.x => Topic started by: jameswilson 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
-
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
-
I think mod_rewrite is default on, just add
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.
-
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
-
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.
-
Hey Russs,
You were involved a little in this thread (http://forums.contribs.org/index.php?topic=31692.0) awhile back. Did you try # /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
-
Thanks Mate,
trouble is, the sme-KnowledgeTree RPM installs to /opt/knowledgeTree!
Would be much easy if it just installed in an iBay!
-
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...
-
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
-
Hey Russs,
You were involved a little in this thread (http://forums.contribs.org/index.php?topic=31692.0) awhile back. Did you try # /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?
-
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
-
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 (http://mirror.contribs.org/smeserver/contribs/rmitchell/smeserver/howto/https%20ibay%20forced%20redirection%20HOWTO%20for%20sme%20server.htm)from Ray Mitchell about forcing https. It is old, but might still apply??
-
I think mod_rewrite is default on, just add 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?
-
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.
-
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.
-
haymann i tried your suggestion, but when i do that i now get 'forbidden' errors. Its obviously something but hasn't helped with mod-rewrite lol
Any further suggestions?
I had installed the WordPress contrib awhile back and have been using it since with no problems. I finally decided to see what I needed to do to get permalinks working and a forum search brought me back to this thread I was involved in some time ago... Has anyone been successful in getting permalinks to work?
I did try adding $OUT .= AllowOverride all\n";
to the /etc/e-smith/templates/etc/httpd/conf/httpd.conf/92wordpress file with hopes that would allow the .htaccess file to be used. I also ran this after I modified the fileexpand-template /etc/httpd/conf/httpd.conf
/etc/init.d/httpd-e-smith restart
I know that is a messy way to do it, but I wanted to see if it worked, it didn't... :-(
Any suggestions?
Thanks,
Ryan
-
A follow-up... I quite searching for permalinks and tried mod_rewrite instead and found this
I have just verified the above procedure using WAMP on Windows.
Here, it all works properly.
From the above error output I conclude that the .htaccess DOES WORK as the error message states "foo.php" and not "foo.html". However, the base URL seems to be replaced by the base Dir. I suspect there is some SME magic at work here that I don't know about yet.
=======
SOLUTION
=======
When I change
RewriteRule ^(.+)\.html$ $1.php
into
RewriteRule ^(.+)\.html$ http://yourdomain.com/wordpress/$1.php [R]
it however does work (hoorah!)
To test go here: http://coeleveld.com/imodrewrite
When change the .htaccess as the poster suggests, nothing changes for me. I am wondering if the way I tried to enable .htaccess was not proper? I wish that I understood enough of what was going on in /etc/e-smith/templates/etc/httpd/conf/httpd.conf/92wordpress to add the Rewrite stuff directly in there instead of the .htaccess...
Not sure if any of this helps...
Ryan
-
If you look in the error_log for httpd it will tell you why it is failing. mod_rewrite from .htaccess requires both the AllowOverride=All and FollowSymLinks=enabled for the ibay in question. Those are the only changes I've had to make in order for wordpress permalinks to work fine.
-
Well I started typing this as I was trying some different things, so instead of deleting everything I'll go through the process...
If you look in the error_log for httpd it will tell you why it is failing.
I see a bunch of errors like this:
File does not exist: /home/e-smith/files/ibays/Primary/html/blah, blah, blah
Sounds like an issue w/ symlinks? I have wordpress installed in /opt/wordpress and have added symlinks to that location from my primary ibay. I did db accounts setprop Primary FollowSymLinks enabled
back when I first setup the symlinks. I just did db accounts setprop Primary AllowOverride All
expand-template /etc/httpd/conf/httpd.conf
/etc/rc.d/rc7.d/S86httpd-e-smith restart
as I had not been using the .htaccess file before.
Then I looked and didn't see a symlink to the .htaccess file so I created it to /home/e-smith/files/ibays/Primary/html/ by using thisln -s /opt/wordpress/.htaccess /home/e-smith/files/ibays/Primary/html/
and the syslink appeared and the permalinks work. I have no idea why the link to .htaccess wasn't there before... I did this ln -s /opt/wordpress/* /home/e-smith/files/ibays/Primary/html/
back when I first setup wordpress...
If I understand correctly, several folks here have suggested adding the .htaccess variables to the custom template instead of using .htaccess. I don't know how to do that with /etc/e-smith/templates/etc/httpd/conf/httpd.conf/92wordpress though...
b-t-w I am using the "stock" .htaccess that came w/ the wordpress contrib, with no modifications like I quoted in an early post on this thread. This is the .htaccess that I am using # BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Thanks Shad :D
Ryan