Page 1 of 1

Mod_rewrite using MySQL

Posted: Sun May 14, 2006 10:10 am
by Todd_Z
Has anyone seen a good tutorial for how to setup mod_rewrite using a mysql database?

http://www.camaya.net/modrw is decent, but it isn't complete - it doesn't show how to apply the patch.

Posted: Sun May 14, 2006 11:27 am
by timvw
Just search the web and find out how to diff/patch sourcefiles ;)

Usually:

1) Go to the root directory of the source of your program
2) patch -p1 < ../path/to/patch

Undo the patch:

1) Go to the root directory of the source of your program
2) patch -R -p1 < ../path/to/patch

Posted: Sun May 14, 2006 3:36 pm
by Todd_Z
I can't figure out which file to patch

I figured it would be the mod_rewrite.so but apparently not. Any ideas?

Code: Select all

root@ubuntu:/usr/lib/apache2/modules# patch -p1 < /etc/apache2/mod_rewrite-mysql.patch
can't find file to patch at input line 3
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|--- modules/mappers/mod_rewrite.c.old  2005-02-04 21:21:18.000000000 +0100
|+++ modules/mappers/mod_rewrite.c      2005-05-06 09:58:31.000000000 +0200
--------------------------
File to patch: mod_rewrite.so
patching file mod_rewrite.so
Hunk #1 FAILED at 487.
Hunk #2 FAILED at 3006.
Hunk #3 FAILED at 3038.
Hunk #4 FAILED at 3135.
Hunk #5 FAILED at 3163.
Hunk #6 FAILED at 3364.
Hunk #7 FAILED at 3948.
Hunk #8 FAILED at 4037.
8 out of 8 hunks FAILED -- saving rejects to file mod_rewrite.so.rej
can't find file to patch at input line 271
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|--- modules/mappers/mod_rewrite.h.old  2005-02-04 21:21:18.000000000 +0100
|+++ modules/mappers/mod_rewrite.h      2005-05-06 07:33:45.000000000 +0200
--------------------------
File to patch:

Posted: Mon May 15, 2006 4:45 am
by timvw
I clearly wrote: source... not binary...

Posted: Mon May 15, 2006 6:03 am
by Todd_Z
Im using a debian package... is all hell going to break loose if I try to compile the source instead of `dpkg -i mysql*.deb`?

Posted: Mon May 15, 2006 6:43 am
by timvw

Posted: Mon May 15, 2006 12:28 pm
by Todd_Z
now the blood is coming from my ears.

i've got the source for apache, i put the patch into the "patches" folder, and the output [tailed]

Code: Select all

Applying patch 052_mod_rewrite-mysql.patch failed!
make[1]: *** [debian/stampdir/patchapply] Error 1
make[1]: Leaving directory `/home/todd/apache2-2.0.54'
make: *** [debian/stampdir/source.make] Error 2
That was the first attempt, then i tried to apply it using patch -p0 < path/to/the/patch in several directories.

What part am i missing? Could this patch somehow be incompatible with the debian src?

Posted: Mon May 15, 2006 12:53 pm
by timvw
You've got the source for 2.2-X and if i'm not mistaken the patch seems to be for apache2.0.54

Posted: Mon May 15, 2006 1:05 pm
by Todd_Z
thats the source for 2.0.54, no?

when i run the command to get the source it created a folder called "apache2-2.0.54"

apache2 version 2.0.54 unless im being a complete idiot