g2b1 url rewrite setup.

redtea

Joined: 2005-02-07
Posts: 10
Posted: Tue, 2005-03-08 16:56

my apache2 already LoadModule rewrite_module modules/mod_rewrite.so
but URL rewrite pluging tell me "Apache mod_rewrite is not installed or not enabled."
help me. thanks.

my website run on virtualhost mode.


Gallery URL (optional):
Gallery version:beta 1
Webserver (with version):apache 2.0.53
Datatabase (with version):mysql 4.0.21
PHP version (eg 4.2.1): 4.3.10
phpinfo URL (optional):
Graphics Toolkit(s):GD
Operating system:freebsd
Web browser/version:IE
G1 version (for migration bugs):

 
redtea

Joined: 2005-02-07
Posts: 10
Posted: Wed, 2005-03-09 12:20

up.

 
pelle
pelle's picture

Joined: 2004-12-10
Posts: 389
Posted: Wed, 2005-03-09 16:56

I assume you have gallery installed in /gallery2 or /gallery (otherwise you wouldn't have gotten that error message) and depending on which one there's two ways you could test if mod_rewrite is loaded:

/galler2:
Go to /gallery2/modules/rewrite/test/mod_rewrite/gallery2/Rewrite.txt
/gallery:
Go to /gallery/modules/rewrite/test/mod_rewrite/gallery/Rewrite.txt

Dont do this localy, go to the URL so Apache processes the request. What do you see? If these tests pass Gallery should detect this, but since you got the error message I'm expecting you to see something else than 'PASS_REWRITE
' which a working mod_rewrite setup returns.

 
redtea

Joined: 2005-02-07
Posts: 10
Posted: Thu, 2005-03-10 08:45

my gallery2 beta1 install at xxx.com/gallery2 .
I test "xxx.com/gallery2/modules/rewrite/test/mod_rewrite/gallery2/Rewrite.txt "
returns message:"FAIL_NO_REWRITE".

oh ,god, my rebuild apache 2.0.53,
./configure --prefix=/usr/local/apache --enable-so --enable-modules=rewrite

OK, I use ./apachectl -l display include mod_rewrite.c

add "RewriteEngine On" into httpd.conf

restart apache

test again,still fail.

 
pelle
pelle's picture

Joined: 2004-12-10
Posts: 389
Posted: Thu, 2005-03-10 19:14

Go to /gallery2/lib/tools/phpinfo.php and in the section apache2handler you should see mod_rewrite in the list of 'Loaded Modules'. I recon you wont, in which case I suggest you read the Apache docs.

 
redtea

Joined: 2005-02-07
Posts: 10
Posted: Fri, 2005-03-11 04:26

run phpinfo.php in the section apache2handler,
Loaded Modules

core mod_access mod_auth mod_include mod_log_config mod_env mod_setenvif prefork http_core mod_mime mod_status mod_autoindex mod_asis mod_cgi mod_negotiation mod_dir mod_imap mod_actions mod_userdir mod_alias mod_rewrite mod_so sapi_apache2

why url rewrite pluging tell me "Apache mod_rewrite is not installed or not enabled." ??? very unusual..

 
pelle
pelle's picture

Joined: 2004-12-10
Posts: 389
Posted: Fri, 2005-03-11 13:45

Do you have 'AllowOverride Options' for your Gallery directory? Apache mod_rewrite needs 'Options FollowSymlinks'. You could verify by creating a symlink to an existing file and try to access it.

 
redtea

Joined: 2005-02-07
Posts: 10
Posted: Fri, 2005-03-11 15:39

I don't know. can you give me a sample? thanks.

 
pelle
pelle's picture

Joined: 2004-12-10
Posts: 389
Posted: Fri, 2005-03-11 20:14
cd .../gallery2/
ln -s modules/rewrite/test/mod_rewrite/gallery2/Works.txt Works.txt

Go to http://.../gallery2/Works.txt

 
phinex

Joined: 2004-02-26
Posts: 3
Posted: Mon, 2005-03-14 09:23
pelle wrote:
cd .../gallery2/
ln -s modules/rewrite/test/mod_rewrite/gallery2/Works.txt Works.txt

Go to http://.../gallery2/Works.txt

I ecounter the same problem with redtea, but I can successfully done this.
Howerver, the rewrite module still tell me there is no rewrite enabled in my apache2.

Anything can be further checked ?
Thanks.

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Tue, 2005-03-15 00:53

Pelle is out of town for a week, but when he gets back he's got a newer version of the module that will hopefully do a better job of detection. He'll get back to you when he can.

 
phinex

Joined: 2004-02-26
Posts: 3
Posted: Tue, 2005-03-15 06:27

I have solved this problem by doing the following two things, and rewrite works.

By commentting the "Options +FollowSymlinks" in both /gallery2/.htaccess and /gallery2/modules/rewrite/test/mod_rewrite/gallery2/.htaccess, gallery module can detect my mod_rewite and I can use rewrite to view the album.

BTW, the view of rewrite and the original view are not the same. How could this happen ? I mean the /gallery2/v/user is not the same with /gallery2/main.php?g2_view=core:ShowItem&g2_itemId=1144. How could I solve this ?

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Wed, 2005-03-16 06:24

Hard to say .. can you give us the actual urls so that we can see for ourselves?

 
phinex

Joined: 2004-02-26
Posts: 3
Posted: Wed, 2005-03-16 07:55
bharat wrote:
Hard to say .. can you give us the actual urls so that we can see for ourselves?

It is my own problem, and now has been solved.
Thank you.

But, another thing is the current-release(03-14) can work, but when I use cvs to update from beta1. The rewrite url module seems to fail.

I want to ask that whether current.gallery2.tar.gz is newer than that of cvs updated.

Thank you very much.

 
pelle
pelle's picture

Joined: 2004-12-10
Posts: 389
Posted: Wed, 2005-03-23 18:19
phinex wrote:
By commentting the "Options +FollowSymlinks" in both /gallery2/.htaccess and /gallery2/modules/rewrite/test/mod_rewrite/gallery2/.htaccess, gallery module can detect my mod_rewite and I can use rewrite to view the album.

Souns like we should make a second test, testing mod_rewrite withouth the Options line and determine if it's nessisary. I belive this was (is?) an issue wtih G1 too. I'm on it right away.

phinex wrote:
I want to ask that whether current.gallery2.tar.gz is newer than that of cvs updated.

CVS is the most current, current.gallery2.tar.gz is created once every night, its a snapshot of what the CVS looked like at that perticular moment.

phinex wrote:
The rewrite url module seems to fail.

Well, it'd be great if you explain what's wrong with it.

 
ziddey

Joined: 2004-11-01
Posts: 52
Posted: Thu, 2005-03-31 20:36

is there a way to get the modrewrite to be able to take on a full hostname?

that way, regardless of whether i goto ijib.com or www.ijib.com, itll 301 to www.ijib.com or something like that

 
pelle
pelle's picture

Joined: 2004-12-10
Posts: 389
Posted: Thu, 2005-03-31 23:32

Didn't this work?

 
swordfish
swordfish's picture

Joined: 2004-10-01
Posts: 388
Posted: Tue, 2005-04-19 02:26

URL Rewrite has broke for me after upgrading from cvs - 04-18-2005.
Previous was cvs 04-14-2005 which worked fine.
It was working fine for quite awhile as I often update via cvs.
After updating files via cvs, on the modules page the URL Rewrite had a newer version available. I choose install then configure and it states "Apache mod_rewrite is not installed or not enabled"
and Your .htaccess file ok.

I know mod_rewrite is enabled because /gallery2/modules/rewrite/test/mod_rewrite/gallery2/Rewrite.txt displays 'PASS_REWRITE' and phpinfo says its loaded.

I removed everything from the /gallery2/.htaccess file, restarted Apache, uninstalled the URL Rewrite module and cleared my mmcache.
Then attempted to install/configure URL Rewrite but get the same error noted above and nothing is written to /gallery2/.htaccess.

Tried commentting the "Options +FollowSymlinks" in both /gallery2/.htaccess and /gallery2/modules/rewrite/test/mod_rewrite/gallery2/.htaccess to no avail.
I'm somewhat confused as to what the heck happened. Holler if ya need more info.

Gallery: G2-Beta2 cvs 04-18-2005
Webserver: Apache 1.3.33
Datatabase: MySQL 4.0.24
PHP: 4.3.11
Turck MMCache: 2.4.6
OS: Gentoo
Web browser: IE6/Firefox

 
pelle
pelle's picture

Joined: 2004-12-10
Posts: 389
Posted: Tue, 2005-04-19 14:53
swordfish wrote:
gallery2/modules/rewrite/test/mod_rewrite/gallery2/Rewrite.txt displays 'PASS_REWRITE'

The configure page should say its OK if you get PASS_REWRITE. Check the apache access log; what HTTP header is sent?

About the Options +FollowSymlinks hack, we try to detect this now so this is not needed anymore.

 
swordfish
swordfish's picture

Joined: 2004-10-01
Posts: 388
Posted: Wed, 2005-04-20 03:18
pelle wrote:
swordfish wrote:
gallery2/modules/rewrite/test/mod_rewrite/gallery2/Rewrite.txt displays 'PASS_REWRITE'

The configure page should say its OK if you get PASS_REWRITE. Check the apache access log; what HTTP header is sent?

About the Options +FollowSymlinks hack, we try to detect this now so this is not needed anymore.

Below is contents of access log from install URL Rewrite to attempting to configure.

24.xx.xx.xx - admin [19/Apr/2005:20:02:15 -0700] "GET /gallery2/main.php?g2_view=core:SiteAdmin&g2_subView=core:AdminModules&g2_navId=x7fc337d7 
HTTP/1.1" 200 36054
24.xx.xx.xx - admin [19/Apr/2005:20:02:15 -0700] "GET 
/gallery2/main.php?g2_view=core:SiteAdmin&g2_subView=core:AdminModules&g2_navId=x7fc337d7 
HTTP/1.1" 200 36054 
"http://24.xx.xx.xx/gallery2/main.php?g2_view=core:SiteAdmin&g2_return=http%3A%2F%2F24.xx.xx.xx%2Fgallery2%2Fmain.php&g2_returnName=album&g2_navId=" 
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)"
24.xx.xx.xx - admin [19/Apr/2005:20:02:15 -0700] "GET 
/gallery2/modules/core/data/module-install.gif HTTP/1.1" 304 -
24.xx.xx.xx - admin [19/Apr/2005:20:02:15 -0700] "GET 
/gallery2/modules/core/data/module-install.gif HTTP/1.1" 304 - 
"http://24.xx.xx.xx/gallery2/main.php?g2_view=core:SiteAdmin&g2_subView=core:AdminModules&g2_navId=x7fc337d7" 
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)"
24.xx.xx.xx - admin [19/Apr/2005:20:02:15 -0700] "GET 
/gallery2/modules/core/data/module-inactive.gif HTTP/1.1" 304 -
24.xx.xx.xx - admin [19/Apr/2005:20:02:15 -0700] "GET 
/gallery2/modules/core/data/module-inactive.gif HTTP/1.1" 304 - 
"http://24.xx.xx.xx/gallery2/main.php?g2_view=core:SiteAdmin&g2_subView=core:AdminModules&g2_navId=x7fc337d7" 
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)"
24.xx.xx.xx - admin [19/Apr/2005:20:02:15 -0700] "GET 
/gallery2/modules/core/data/module-active.gif HTTP/1.1" 304 -
24.xx.xx.xx - admin [19/Apr/2005:20:02:15 -0700] "GET 
/gallery2/modules/core/data/module-active.gif HTTP/1.1" 304 - 
"http://24.xx.xx.xx/gallery2/main.php?g2_view=core:SiteAdmin&g2_subView=core:AdminModules&g2_navId=x7fc337d7" 
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)"
24.xx.xx.xx - admin [19/Apr/2005:20:02:15 -0700] "GET 
/gallery2/modules/core/data/module-upgrade.gif HTTP/1.1" 304 -
24.xx.xx.xx - admin [19/Apr/2005:20:02:15 -0700] "GET 
/gallery2/modules/core/data/module-upgrade.gif HTTP/1.1" 304 - 
"http://24.xx.xx.xx/gallery2/main.php?g2_view=core:SiteAdmin&g2_subView=core:AdminModules&g2_navId=x7fc337d7" 
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)"
24.xx.xx.xx - - [19/Apr/2005:20:03:10 -0700] "GET 
/gallery2/modules/rewrite/test/mod_rewrite_no_options/gallery2/Rewrite.txt?g2_navId=x7fc337d7 
HTTP/1.0" 401 397
24.xx.xx.xx - - [19/Apr/2005:20:03:10 -0700] "GET 
/gallery2/modules/rewrite/test/mod_rewrite_no_options/gallery2/Rewrite.txt?g2_navId=x7fc337d7 
HTTP/1.0" 401 397 "-" "-"
24.xx.xx.xx - - [19/Apr/2005:20:03:10 -0700] "GET 
/gallery2/modules/rewrite/test/mod_rewrite/gallery2/Rewrite.txt?g2_navId=x7fc337d7 HTTP/1.0" 401 
397
24.xx.xx.xx - - [19/Apr/2005:20:03:10 -0700] "GET 
/gallery2/modules/rewrite/test/mod_rewrite/gallery2/Rewrite.txt?g2_navId=x7fc337d7 HTTP/1.0" 401 
397 "-" "-"
24.xx.xx.xx - admin [19/Apr/2005:20:03:10 -0700] "GET 
/gallery2/main.php?g2_controller=core:AdminModules&g2_moduleId=rewrite&g2_action=install&g2_navId=x7fc337d7 
HTTP/1.1" 302 5
24.xx.xx.xx - admin [19/Apr/2005:20:03:10 -0700] "GET 
/gallery2/main.php?g2_controller=core:AdminModules&g2_moduleId=rewrite&g2_action=install&g2_navId=x7fc337d7 
HTTP/1.1" 302 5 
"http://24.xx.xx.xx/gallery2/main.php?g2_view=core:SiteAdmin&g2_subView=core:AdminModules&g2_navId=x7fc337d7" 
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)"
24.xx.xx.xx - admin [19/Apr/2005:20:03:10 -0700] "GET 
/gallery2/main.php?g2_view=core:SiteAdmin&g2_subView=core:AdminModules&g2_statusId=xd7b23b1f&g2_navId=x7fc337d7 
HTTP/1.1" 200 36393
24.xx.xx.xx - admin [19/Apr/2005:20:03:10 -0700] "GET 
/gallery2/main.php?g2_view=core:SiteAdmin&g2_subView=core:AdminModules&g2_statusId=xd7b23b1f&g2_navId=x7fc337d7 
HTTP/1.1" 200 36393 
"http://24.xx.xx.xx/gallery2/main.php?g2_view=core:SiteAdmin&g2_subView=core:AdminModules&g2_navId=x7fc337d7" 
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)"
24.xx.xx.xx - - [19/Apr/2005:20:03:13 -0700] "GET 
/gallery2/modules/rewrite/test/mod_rewrite_no_options/gallery2/Rewrite.txt HTTP/1.0" 401 397
24.xx.xx.xx - - [19/Apr/2005:20:03:13 -0700] "GET 
/gallery2/modules/rewrite/test/mod_rewrite_no_options/gallery2/Rewrite.txt HTTP/1.0" 401 397 "-" 
"-"
24.xx.xx.xx - - [19/Apr/2005:20:03:13 -0700] "GET 
/gallery2/modules/rewrite/test/mod_rewrite/gallery2/Rewrite.txt HTTP/1.0" 401 397
24.xx.xx.xx - - [19/Apr/2005:20:03:13 -0700] "GET 
/gallery2/modules/rewrite/test/mod_rewrite/gallery2/Rewrite.txt HTTP/1.0" 401 397 "-" "-"
24.xx.xx.xx - admin [19/Apr/2005:20:03:13 -0700] "GET 
/gallery2/main.php?g2_view=core:SiteAdmin&g2_subView=rewrite:SetupRewrite&g2_navId=x7fc337d7 
HTTP/1.1" 200 11713
24.xx.xx.xx - admin [19/Apr/2005:20:03:13 -0700] "GET 
/gallery2/main.php?g2_view=core:SiteAdmin&g2_subView=rewrite:SetupRewrite&g2_navId=x7fc337d7 
HTTP/1.1" 200 11713 
"http://24.xx.xx.xx/gallery2/main.php?g2_view=core:SiteAdmin&g2_subView=core:AdminModules&g2_statusId=xd7b23b1f&g2_navId=x7fc337d7" 
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)"
  
24.xx.xx.xx - admin [19/Apr/2005:20:06:20 -0700] "POST /gallery2/main.php HTTP/1.1" 302 5
24.xx.xx.xx - admin [19/Apr/2005:20:06:20 -0700] "POST /gallery2/main.php HTTP/1.1" 302 5 
"http://24.xx.xx.xx/gallery2/main.php?g2_view=core:SiteAdmin&g2_subView=rewrite:SetupRewrite&g2_navId=x7fc337d7" 
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)"
24.xx.xx.xx - - [19/Apr/2005:20:06:20 -0700] "GET 
/gallery2/modules/rewrite/test/mod_rewrite_no_options/gallery2/Rewrite.txt HTTP/1.0" 401 397
24.xx.xx.xx - - [19/Apr/2005:20:06:20 -0700] "GET 
/gallery2/modules/rewrite/test/mod_rewrite_no_options/gallery2/Rewrite.txt HTTP/1.0" 401 397 "-" 
"-"
24.xx.xx.xx - - [19/Apr/2005:20:06:20 -0700] "GET 
/gallery2/modules/rewrite/test/mod_rewrite/gallery2/Rewrite.txt HTTP/1.0" 401 397
24.xx.xx.xx - - [19/Apr/2005:20:06:20 -0700] "GET 
/gallery2/modules/rewrite/test/mod_rewrite/gallery2/Rewrite.txt HTTP/1.0" 401 397 "-" "-"
24.xx.xx.xx - admin [19/Apr/2005:20:06:21 -0700] "GET 
/gallery2/main.php?g2_view=core:SiteAdmin&g2_subView=rewrite:SetupRewrite&g2_navId=x7fc337d7 
HTTP/1.1" 200 11713
24.xx.xx.xx - admin [19/Apr/2005:20:06:21 -0700] "GET 
/gallery2/main.php?g2_view=core:SiteAdmin&g2_subView=rewrite:SetupRewrite&g2_navId=x7fc337d7 
HTTP/1.1" 200 11713 
"http://24.xx.xx.xx/gallery2/main.php?g2_view=core:SiteAdmin&g2_subView=rewrite:SetupRewrite&g2_navId=x7fc337d7" 
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)"
 
tomcat76
tomcat76's picture

Joined: 2003-04-22
Posts: 133
Posted: Wed, 2005-04-20 16:26

Hi All...
I must first start by saying keep your answers/replies simple to this as I know nothing about programs only if they work or not, but I'm trying... and I love g2.... :D

I've had a problem with this mod rewrite and when I try to config it it says its not working, if I upload the .htaccess file the next page I get is totally blank, but using phinex's solution above it now says " Apache mod_rewrite is working properly." then goes onto say " Your .htaccess file is ready to be updated." but if I update it I'm back to square one as it uploads the new file, so cannot still configure it.

Now I'm sure this used to work ok on a previous version of g2 as I was surprised I could now have short urls displayed, but now with holy hand grenade it no longer does.

My site is hosted here in the uk....
I forgot to add...
http://www.furball.co.uk/gallery2/modules/rewrite/test/mod_rewrite/gallery2/Rewrite.txt
produces PASS_REWRITE

 
swordfish
swordfish's picture

Joined: 2004-10-01
Posts: 388
Posted: Fri, 2005-04-22 01:53

URL Rewrite worked for me using G2 Beta 2 and a few cvs updates afterward. Then it was updated from 0.9.1 or 0.9.2 to 0.9.3. After updating to 0.9.3 it has not worked since. I been all over these forums and tried everything to no avail.
Mod_rewrite is loaded and verified it works but something is broken in G2.
My guess is something wrong happened after I refreshed with a cvs update and now I'm stuck.

 
swordfish
swordfish's picture

Joined: 2004-10-01
Posts: 388
Posted: Sat, 2005-04-23 03:55

SOLVED!!! Once again I was bitten by Apache. My Gallery site is not public as I use Mod_Auth. I temporarily disabled mod_auth and was able to successfully configure G2 Url Rewrite and activate.

So, why does G2 URL Rewrite fail to configure when the site is password protected with mod_auth????

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Sun, 2005-04-24 22:58

That's odd. Can you file a bug against this? I'll assign it to pelle :-)

 
swordfish
swordfish's picture

Joined: 2004-10-01
Posts: 388
Posted: Mon, 2005-04-25 01:28

I believe there is two separate issues wrt URL Rewrite and mod_auth.?
This one described above and my later post [url]http://gallery.menalto.com/index.php?name=PNphpBB2&file=viewtopic&t=29299 [/url]

 
pelle
pelle's picture

Joined: 2004-12-10
Posts: 389
Posted: Thu, 2005-04-28 13:35

tomcat76, get the latest nigthly snapshot. The Options +FollowSymLinks thing has been fixed in rewrite 0.9.3

 
StanVanDam

Joined: 2003-07-19
Posts: 19
Posted: Fri, 2005-07-08 03:52
 
stephenju
stephenju's picture

Joined: 2005-07-05
Posts: 172
Posted: Thu, 2005-07-14 17:39

I too can't get URL Rewrite to work. It complains about " Apache mod_rewrite is not installed or not enabled." But the test to /modules/rewrite/test/mode_rewrite/gallery2/Rewrote.txt shows "PASS_REWRITE".

I am running Gallery2 Beta 3.

 
pelle
pelle's picture

Joined: 2004-12-10
Posts: 389
Posted: Thu, 2005-07-14 19:23

Upgrade, upgrade people :)

stephenju, get tonights snapshot or update cvs

 
stephenju
stephenju's picture

Joined: 2005-07-05
Posts: 172
Posted: Thu, 2005-07-14 20:04

OK. OK. :)

Now is there any note or warning that I can read for the upgrade to the nightly? I am also working on Traditional Chinese translation and don't want my work lost to the upgrade.

 
pelle
pelle's picture

Joined: 2004-12-10
Posts: 389
Posted: Thu, 2005-07-14 20:18

stephenju, if you're doing translations I sugest you use cvs. Also, there's been a major themes refactor so your translation might be outdated.

 
stephenju
stephenju's picture

Joined: 2005-07-05
Posts: 172
Posted: Fri, 2005-07-15 03:46

pelle, does using CVS leave the files I changed in translation when updating? Forgive the ignorance for I've never used CVS.

Also, I have to do the localization on my local PC/Mac for my hosting doesn't have shell access. This makes constantly updating my installation a bit hard.

 
itcheg

Joined: 2003-11-30
Posts: 87
Posted: Fri, 2005-07-15 07:13

CVS will only delete your files if you use the -C flag, just use -Pd instead

 
stephenju
stephenju's picture

Joined: 2005-07-05
Posts: 172
Posted: Fri, 2005-07-15 13:42

Ah... Nice. Thanks.