Apache

mod_rewrite

Redirection Types

There are basically three types of redirection: internal, external and proxied.

Internal means the whole thing happens inside of Apache. This means the URL bar and bookmarks get the value of the initial request. It also means REDIRECT_SCRIPT_URI and friends do not get set. SCRIPT_URI and friends will contain the appropriate values.

External means the server tells the browser to do a real-live redirect. This causes the URL bar & bookmarks to take on the value of the eventual destination. It also sets REDIRECT_SCRIPT_URI and friends to the original request. SCRIPT_URI will contain the rewritten request.

Proxied means the server turns around and performs a query on behalf of the browser. The URL bar and bookmarks keep the initial value. I'm not sure what happens to REDIRECT_SCRIPT_URI/SCRIPT_URI and friends.

Proxy to Tintin

I'm trying to set up things so requests to arthur will transparently proxy to tintin.

E.G. http://arthur/foo will not change the URL bar etc., but will produce the contents of http://tintin/foo

I've got a rewriterule in arthur that looks like this:    RewriteRule ^/proxytest/(.*)$ http://tintin.seattlecentral.edu/$1 [P,L] 

* Requests for /proxytest/foo do an external redirect to http://tintin/foo. * Requests for /proxytest/foo/ comes up with something funky, but not an external redirect.

Ah hah!

Any request for a directory that doesn't have a trailing slash, will get one attached in an external redirect. This is called "trailing slash redirection".

I'm going to try a rewrite on tintin that adds a slash to the request and redirects appropriately. I was playing with that on arthur, but arthur can't know if a file on tintin is a directory or not...

More

I'm pretty confidant that I can make arthur selectively proxy only pages that don't exist on arthur. Though it will be hard to make it only proxy pages that DO exist on tintin... RewriteCond -U doesn't seem to work.

proxytest pages don't work because the request for things like '/inc/foo.css' are going to seattlecentral.edu/inc/foo.css. This will go away when I'm not doing proxytest any more.

mod_proxy & friends

I'm trying to set up arthur to reverse proxy tintin.

I want to test in a test dir like http://seattlecentral.edu/tintin, and while that works for docs you explicitly type in, it breaks all the links.

mod_proxy_html is supposed to fix that.

mod_proxy_html

a groovy tutorial: http://www.apachetutor.org/admin/reverseproxies

AllowOverride and UserDir

You can only set AllowOverride in a Directory without any wildcards. That means you can't set it on user public_html dirs. You have to set it on a higher directory, like /home.

Lenya

Needed to install java from sun. OpenJDK didn't work.


CategoryNotes

Apache (last edited 2008-10-13 21:29:59 by dmartin)