[Nitro] Apache question

Robert Mela rob at robmela.com
Tue Nov 6 10:38:03 EST 2007


The closest I see to what you're specifying is 
http://httpd.apache.org/docs/2.2/mod/mod_vhost_alias.html

Unfortunately it does not do an external redirect -- it changes the path 
internally.    But, if you can inject that path change before 
mod_rewrite then mod_rewrite can use it to generate the external 
redirect.    I think a vhost such as <VirtualHost *.mydomain.com> that 
will catch all the username domains but I would have to verify that.

If you can sacrifice the external redirect then mod_vhost_alias might be 
all you need.  I'm not sure what all your requirements are or what 
tradeoffs are acceptable.

Fortunately the path translation feature offers use of substrings -- so 
100,000 domains don't have to resolve to 100,000 top-level directory 
entries.

I can look at it tonight.   But, if it turns out the stench of 
configuration hackery is too great to bear, I can whip up a simple 
Apache module that does exactly what you need.   The logic involves will 
amount to about 10 or 20 lines of C.   This often winds up being a lot 
cleaner.   In exchange however I will need the many_to_many relation 
fixed in Og, to the point that isTaggable works correctly.

George Moschovitis wrote:
> I don't want a VirtualHost.
> I will have 100.000 different usernames. I can't add a VirtualHost for 
> each one of them.
>
> I need a single rewrite rule.
>
> any ideas?
>
> -g.
>
>
>
> On Nov 6, 2007 5:33 AM, chris <prpht9 at gmail.com 
> <mailto:prpht9 at gmail.com>> wrote:
>
>     I'm on a debian based system which includes the following snip
>     from the main conf file.  The "ServerName carl" entry is the
>     hostname of the incoming http request.  The "VirtualHost *" is
>     defining what ip interface to listen on btw.
>
>     chris at carl:/etc/apache2/sites-available$ cat carl
>     <VirtualHost *>
>
>         LoadModule proxy_http_module
>     /usr/lib/apache2/modules/mod_proxy_http.so
>
>         ServerName carl
>        
>         ProxyPass / http://localhost:9000/
>         ProxyPassReverse / http://localhost:9000/
>        
>         <Location />
>             Order allow,deny
>             Allow from 192.168.0.0/16 <http://192.168.0.0/16>
>         </Location>
>     </VirtualHost>
>
>
>     Your should look like this...
>
>
>         <VirtualHost *>
>
>             LoadModule proxy_http_module
>         /usr/lib/apache2/modules/mod_proxy_http.so
>
>             ServerName username.mydomain.com
>         <http://username.mydomain.com>
>            
>             ProxyPass / http://www.mydomain.com:9000/
>             ProxyPassReverse / http://www.mydomain.com:9000/
>            
>             <Location />
>                 Order allow,deny
>                 Allow from *
>             </Location>
>
>             <PUT_REWRITE_RULE_HERE to make / => /view/username />
>         </VirtualHost>
>
>
>     This should get you going, let me know if you have more problems
>     I'll go into more detail.
>
>     -Chris
>
>
>
>     On Nov 5, 2007 4:59 PM, George Moschovitis <
>     george.moschovitis at gmail.com
>     <mailto:george.moschovitis at gmail.com>> wrote:
>
>         please do so...
>
>         thanks,
>         -g.
>
>
>         On Nov 5, 2007 11:32 PM, chris <prpht9 at gmail.com
>         <mailto:prpht9 at gmail.com>> wrote:
>
>             I think what you want is name based virtual host routing. 
>             I have a sample configuration file at home.  I'll post it
>             here when I get there.
>
>             Chris
>
>             On 11/5/07, * George Moschovitis*
>             <george.moschovitis at gmail.com
>             <mailto:george.moschovitis at gmail.com>> wrote:
>
>                 Dear devs,
>
>                 I have a small apache question, hopefully someone can
>                 help.
>
>                 I would like to rewrite urls like:
>
>                 username.mysite.com <http://username.mysite.com>
>
>                 to
>
>                 www.mysite.com/view/username
>                 <http://www.mysite.com/view/username>
>
>                 everyone knows the exact RewriteCond/RewriteRule
>                 directives?
>
>                 thanks in advance,
>                 -g.
>
>
>                 -- 
>                 http://me.gr
>                 http://joy.gr
>                 http://cull.gr
>                 http://nitroproject.org
>                 http://phidz.com
>                 http://joyerz.com <http://joyerz.com>
>                 _______________________________________________
>                 Nitro-general mailing list
>                 Nitro-general at rubyforge.org
>                 <mailto:Nitro-general at rubyforge.org>
>                 http://rubyforge.org/mailman/listinfo/nitro-general
>
>
>
>             _______________________________________________
>             Nitro-general mailing list
>             Nitro-general at rubyforge.org
>             <mailto:Nitro-general at rubyforge.org>
>             http://rubyforge.org/mailman/listinfo/nitro-general
>
>
>
>
>         -- 
>         http://me.gr
>         http://joy.gr <http://joy.gr>
>         http://cull.gr
>         http://nitroproject.org
>         http://phidz.com
>         http://joyerz.com <http://joyerz.com>
>
>         _______________________________________________
>         Nitro-general mailing list
>         Nitro-general at rubyforge.org <mailto:Nitro-general at rubyforge.org>
>         http://rubyforge.org/mailman/listinfo/nitro-general
>
>
>
>     _______________________________________________
>     Nitro-general mailing list
>     Nitro-general at rubyforge.org <mailto:Nitro-general at rubyforge.org>
>     http://rubyforge.org/mailman/listinfo/nitro-general
>
>
>
>
> -- 
> http://me.gr
> http://joy.gr
> http://cull.gr
> http://nitroproject.org
> http://phidz.com
> http://joyerz.com
> ------------------------------------------------------------------------
>
> _______________________________________________
> Nitro-general mailing list
> Nitro-general at rubyforge.org
> http://rubyforge.org/mailman/listinfo/nitro-general

-------------- next part --------------
A non-text attachment was scrubbed...
Name: rob.vcf
Type: text/x-vcard
Size: 116 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/nitro-general/attachments/20071106/b68be5fe/attachment.vcf 


More information about the Nitro-general mailing list