Mod_rewrite using MySQL

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
User avatar
Todd_Z
Forum Regular
Posts: 708
Joined: Thu Nov 25, 2004 9:53 pm
Location: U Michigan

Mod_rewrite using MySQL

Post 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.
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post 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
User avatar
Todd_Z
Forum Regular
Posts: 708
Joined: Thu Nov 25, 2004 9:53 pm
Location: U Michigan

Post 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:
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

I clearly wrote: source... not binary...
User avatar
Todd_Z
Forum Regular
Posts: 708
Joined: Thu Nov 25, 2004 9:53 pm
Location: U Michigan

Post 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`?
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

User avatar
Todd_Z
Forum Regular
Posts: 708
Joined: Thu Nov 25, 2004 9:53 pm
Location: U Michigan

Post 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?
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post 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
User avatar
Todd_Z
Forum Regular
Posts: 708
Joined: Thu Nov 25, 2004 9:53 pm
Location: U Michigan

Post 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
Post Reply