Forum Moderators: phranque

Message Too Old, No Replies

mod rewrite with a wicket app and wordpress

         

aridh

6:45 pm on Jan 29, 2009 (gmt 0)

10+ Year Member



Hi everyone,

I've got a wicket application and I want wordpress running together with it.

At the moment when you do www.example.com, you got to wicket application. I'm trying to setup word press so that when you type www.example.com/blog you go to the word press blog. I've tried using the setup below but I always seem to get a 404...

I've tried

RewriteRule ^/blog/$ /var/www/html/example/blog/ [L]

and

Alias /blog /var/www/html/example/blog

neither work, both are commented out below.

<VirtualHost *:80>
ServerAdmin web@example.com
ServerName www.example.com:80
ErrorLog logs/example.com-error_log
CustomLog logs/example.com-access_log common

ProxyRequests Off

<Proxy *>
Order deny,allow
Allow from all
</Proxy>

RewriteEngine On
RewriteLog /etc/httpd/logs/example.com-rewrite_log
#Alias /blog /var/www/html/example/blog
#RewriteRule ^/blog/$ /var/www/html/example/blog/ [L]
RewriteRule ^/(images/.+);jsessionid=\w+$ /$1 [P]
RewriteRule ^/(flash/.+);jsessionid=\w+$ /$1 [P]
RewriteRule ^/(css/.+);jsessionid=\w+$ /$1 [P]
RewriteRule ^/(js/.+);jsessionid=\w+$ /$1 [P]
RewriteRule ^/.aspx$ /app/ [P] [R] [L]

ProxyPass / [localhost:8080...]
ProxyPassReverse / [localhost:8080...]
</VirtualHost>

Thanks for any help!
aridh

jdMorgan

6:58 pm on Jan 29, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The substitution path in your rewrites should be the path from DocumentRoot to the file. I.e. I suspect you don't need all or most of /var/www/html/example in that path.

Take a look at your server error log; It will tell you the filepath that your server is attempting to resolve the /blog URL requests to. Looking at that, the required adjustment to the filepath should be obvious.

Jim

aridh

7:06 pm on Jan 29, 2009 (gmt 0)

10+ Year Member



Hi Jim,

Thanks for replying. This is what I'm seeing in the logs..


[29/Jan/2009:16:42:56 +0000] "GET /blog/ HTTP/1.1" 404 1245
[29/Jan/2009:17:43:20 +0000] "GET /blog HTTP/1.1" 301 -
[29/Jan/2009:17:43:20 +0000] "GET /blog/ HTTP/1.1" 404 1245
[29/Jan/2009:17:43:29 +0000] "GET /blog/ HTTP/1.1" 404 1245
[29/Jan/2009:18:02:16 +0000] "GET /blog HTTP/1.1" 503 414
[29/Jan/2009:18:02:21 +0000] "GET /blog/ HTTP/1.1" 503 414
[29/Jan/2009:18:02:48 +0000] "GET /blog/ HTTP/1.1" 503 414
[29/Jan/2009:18:02:49 +0000] "GET /blog/ HTTP/1.1" 503 414
[29/Jan/2009:18:02:51 +0000] "GET /blog HTTP/1.1" 503 414
[29/Jan/2009:18:03:23 +0000] "GET /blog HTTP/1.1" 404 1245

Will try changing doc root as suggested...

aridh

jdMorgan

7:22 pm on Jan 29, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Look at your server error log, not your server access log -- They are two different log files, and only the error log contains the filepath info you need.

Jim

aridh

8:07 pm on Jan 29, 2009 (gmt 0)

10+ Year Member



:)..

[Thu Jan 29 18:02:08 2009] [error] (111)Connection refused: proxy: HTTP: attempt to connect to 127.0.0.1:8080 (localhost) failed
[Thu Jan 29 18:02:08 2009] [error] ap_proxy_connect_backend disabling worker for (localhost)
[Thu Jan 29 18:02:08 2009] [error] proxy: HTTP: disabled connection for (localhost)
[Thu Jan 29 18:02:08 2009] [error] proxy: HTTP: disabled connection for (localhost)
[Thu Jan 29 18:02:08 2009] [error] proxy: HTTP: disabled connection for (localhost)
[Thu Jan 29 18:02:14 2009] [error] proxy: HTTP: disabled connection for (localhost)
[Thu Jan 29 18:02:14 2009] [error] proxy: HTTP: disabled connection for (localhost)
[Thu Jan 29 18:02:16 2009] [error] proxy: HTTP: disabled connection for (localhost)
[Thu Jan 29 18:02:17 2009] [error] proxy: HTTP: disabled connection for (localhost)
[Thu Jan 29 18:02:17 2009] [error] proxy: HTTP: disabled connection for (localhost)
[Thu Jan 29 18:02:18 2009] [error] proxy: HTTP: disabled connection for (localhost)
[Thu Jan 29 18:02:20 2009] [error] proxy: HTTP: disabled connection for (localhost)
[Thu Jan 29 18:02:21 2009] [error] proxy: HTTP: disabled connection for (localhost)
[Thu Jan 29 18:02:48 2009] [error] (111)Connection refused: proxy: HTTP: attempt to connect to 127.0.0.1:8080 (localhost) failed
[Thu Jan 29 18:02:48 2009] [error] ap_proxy_connect_backend disabling worker for (localhost)
[Thu Jan 29 18:02:49 2009] [error] proxy: HTTP: disabled connection for (localhost)
[Thu Jan 29 18:02:51 2009] [error] proxy: HTTP: disabled connection for (localhost)

jdMorgan

8:54 pm on Jan 29, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Looks like mod_proxy is not enabled or isn't properly-configured.

It's not clear why you are attempting to reverse-proxy these requests in the first place, so you might want to simply replace the [P] flags on the /blog rules with [L].

Also "[P] [R] [L]" in your last rule is invalid. I suggest using only "[L]"

Also, be aware that if it was your intent to check query string values with those ";jsession=" patterns in your RewriteRules, that will not work. You will need to check the query strings separately using RewriteConds; RewriteRules see only the localized requested URL-path, and not any query string data appended to that URL-path. Generalized format:


RewriteCond %{QUERY_STRING} [i]pattern[/i]
RewriteRule [i]localized-URL-path-pattern substitution[/i] [[i]flags[/i]]

Jim

aridh

11:43 am on Jan 31, 2009 (gmt 0)

10+ Year Member



Thanks Jim, will look into why proxy is being used (wasnt setup by me).

aridh