Hi, Sorry I was on the "run" the whole day and only got to some eMails now...
Right, I'm just including what I have in my server.xml file here, ok?. So here we go: <Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false"> </Host> <!-- HOST: Razuna --> <Host name="razuna.org" appBase="webapps"> <Alias>www.razuna.org</Alias> <Context path="" docBase="ABSOLUTEPATHHERE" allowLinking="true" /> </Host> <Host name="razuna.com" appBase="webapps" unpackWARs="true" autoDeploy="false" xmlValidation="false" xmlNamespaceAware="false"> <Context path="" docBase="ABSOLUTEPATHHERE" allowLinking="true" /> </Host> In Apache I then have a virtual host like (you need to create virtual hosts for each host that you have in tomcat): <VirtualHost *:80> ServerName razuna.com DocumentRoot ABSOLUTEPATHHERE ProxyPreserveHost On ProxyPass / ajp://localhost:8010/ ProxyPassReverse / ajp://localhost:8010/ RewriteEngine On RewriteRule ^/(.*\.cf[cm]/?.*)$ ajp://localhost:8010/$1 [P] </VirtualHost> Note: You use the SAME DocumentRoot in Apache as the docBase in Tomcat. With the RewriteRule you tell Apache to get CFM files from Tomcat and the rest will be served by Apache directly (static files, JS, CSS, images, etc). This should get you going. If not, check that you have the mod_proxy_ajp enabled in Apache. Let me know how it works. Kind Regards, Nitai On Fri, Feb 5, 2010 at 2:25 PM, Mats <[email protected]> wrote: > Hi Nitai, > > I can't get this to work properly somehow... > In my vhost.conf I have the following sample > <VirtualHost xxx.xxx.xxx.xxx:80> > DocumentRoot /var/www/mydomain.com > ServerName www.mydomain.com > ServerAlias mydomain.com *.mydomain.com > ProxyPass / ajp://www.mydomain.com:8009 > </VirtualHost> > > In Tomcats server.xml I have a host entry for www.mydomain.com > > This don't work for me... just anding on the half brooken Tomcat Admin > Page > > And if I do > <VirtualHost xxx.xxx.xxx.xxx:80> > DocumentRoot /var/www/mydomain.com > ServerName www.mydomain.com > ServerAlias mydomain.com *.mydomain.com > ProxyPass / http://www.mydomain.com:8080 > ProxyPassreverse / http://www.mydomain.com:8080 > HostnameLookups off > </VirtualHost> > > It works (kind of) but since Apache is doing a new request using > www.mydomain.com it's clear it picks up www instead of > 1234(.mydomain.com) > > The later version works just fine on the standard CF domains... > > So... can u give a bit more detail on how you configure the Proxy > call ? > > Thanks in advance > Mats > On Jan 22, 12:49 pm, "Nitai @ Razuna" <[email protected]> wrote: >> Yeah you can't have a wildcard record in Tomcat. Another reason for >> Apache (or better yet Nginx :-) ) >> >> Anyhow, to solve it you need to have a host container (as you have) >> with a fixed domain, say "tomcat.mydomain.com". Then in Apache you >> have the wildcard domain and forward all requests to that >> *.mydomain.com to tomcat.mydomain.com, like; >> >> proxy / ajp://tomcat.mydomain.com:8009 >> >> If you want to keep the localhost domain for tomcat you can also >> simply set the defaulthost in Tomcat. Then in apache you would still >> use the; >> >> proxy / ajp://localhost:8009 >> >> string. >> >> Kind Regards, >> Nitai >> >> >> >> >> >> On Fri, Jan 22, 2010 at 12:41 PM, Mats <[email protected]> wrote: >> > I'm back again with a question, that might not be OpenBD specific but >> > rather Tomcat configuration issue.. >> > My old fusebox app make use of the Apache configuration *.domain.com >> > A user will have his specific CF page under 1234.domain.com and >> > another on 12345.domain.com >> > This I nee to pick up dynamically in openBD but I can't seem to get >> > Tomcat to accept this. >> > All examples I've seen for the <Host > section is using the >> > <Alias>mydomain1.com</Alias> >> > <Alias>mydomain2.com</Alias> >> > Is it at all possible to use <Alias>*.domain.com</Alias> ? since I >> > don't have control on how many users are available in the application >> > and that number changes over the time. And ofcourse I'm using this >> > subdomain number to look up the users record in the DB... >> >> > Anyone haveing an idea how to solve this? >> >> > -- >> > Open BlueDragon Public Mailing List >> > http://www.openbluedragon.org/ http://twitter.com/OpenBlueDragon >> > mailing list -http://groups.google.com/group/openbd?hl=en >> >> > !! save a network - please trim replies before posting !! >> >> -- >> See for yourself how easy it is to manage files today. Join the revolution! >> >> Razuna SaaS On-Demand - Hosted Digital Asset Management >> Solutionhttp://www.razuna.com/ >> >> Razuna - Open Source Digital Asset Managementhttp://www.razuna.org/ >> >> Follow us on Twitterhttp://twitter.com/razunahq- Hide quoted text - >> >> - Show quoted text - > > -- > Open BlueDragon Public Mailing List > http://www.openbluedragon.org/ http://twitter.com/OpenBlueDragon > mailing list - http://groups.google.com/group/openbd?hl=en > > !! save a network - please trim replies before posting !! > -- See for yourself how easy it is to manage files today. Join the revolution! Razuna SaaS On-Demand - Hosted Digital Asset Management Solution http://www.razuna.com/ Razuna - Open Source Digital Asset Management http://www.razuna.org/ Follow us on Twitter http://twitter.com/razunahq -- Open BlueDragon Public Mailing List http://www.openbluedragon.org/ http://twitter.com/OpenBlueDragon mailing list - http://groups.google.com/group/openbd?hl=en !! save a network - please trim replies before posting !!
