the problem is, there are a few subdirectories on that domain that run a
few old (but necessary) php scripts and a few other things that still
need to be accessible..
is it possible to set up apache so that i can run my rails app using
mod-proxy, but still retain access to the old directories in
~/public_html ?
the only thing i would do is make sure that there is no directory name
overlap in the system..
for example.. i couldn't have /scripts in both apps.. which is fine..
i would appreciate any help in getting this set up..
thanks!
--
Posted via http://www.ruby-forum.com/.
In short, yes, it is quite possible but you gotta know how to use
mod_rewrite and other apache config bits. In my case though, I'm using
litespeed, so it's a different setup.
The way I have it setup is basically having the PHP app sitting there
and anything that falls through be handled by Rails. It wasn't that
hard to setup. What was harder was (somewhat) harder was getting
sessions to work together and other things like that.
Hope it helps,
-carl
--
Davis <davis...@gmail.com>
Impact Media
--
C: +55 45 9928 0815
B: http://impactmedia.com.br/blog/
thanks, guys..
i will check this out...
Yes.
> the only thing i would do is make sure that there is no directory name
> overlap in the system..
>
> for example.. i couldn't have /scripts in both apps.. which is fine..
>
> i would appreciate any help in getting this set up..
This is what we use and it works fine. (apache2/mongrel)
<VirtualHost *:80>
ServerName myserver.com
DocumentRoot /path/to/my/app/public
<Directory "/path/to/my/app/public">
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<Proxy balancer://mongrel_cluster>
BalancerMember http://127.0.0.1:8805
</Proxy>
RewriteEngine On
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} -d
RewriteRule ^(.+[^/])$ $1/ [R]
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} \.php
RewriteRule ^(.*)$ $1 [QSA,L]
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME}/index.html -f
RewriteRule ^(.*)$ $1/index.html [QSA,L]
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME}/index.php -f
RewriteRule ^(.*)$ $1/index.php [QSA,L]
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} -d
RewriteRule ^(.*)[^/]$ $1/ [QSA,L]
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteRule ^/(.*)$ balancer://mongrel_cluster%{REQUEST_URI} [P,QSA,L]
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4.0[678] no-gzip
BrowserMatch bMSIE !no-gzip !gzip-only-text/html
php_value include_path /path/to/my/app/php:/usr/local/lib/php:.
php_value auto_prepend_file /path/to/my/app/php/auto_prepend.php
# this not only blocks access to .svn directories, but makes it appear
# as though they aren't even there, not just that they are forbidden
<DirectoryMatch "^/.*/\.svn/">
ErrorDocument 403 /404.html
Order allow,deny
Deny from all
Satisfy All
</DirectoryMatch>
</VirtualHost>