Try adding <alias>1234x.mydomain.com</alias> to your Tomcat "host"
configuration block. Tomcat uses the host name to match the incoming
ajp request from Apache to the correct "host" block in Tomcat. If you
don't have 1234x.mydomain.com in your Tomcat host, then you will get the
Tomcat admin page as you stated.
You could also add this if you want a * like matching:
<Host name="localhost" ...>
...
<Valve className="org.apache.catalina.valves.RemoteHostValve"
allow="*.mycompany.com,www.yourcompany.com"/>
<Valve className="org.apache.catalina.valves.RemoteAddrValve"
deny="192.168.1.*"/>
...
</Host>
HTH,
.Peter
Mats Stromberg said the following on 06/02/10 17:39:
Hi,
When I use the www.mydomain.com <http://www.mydomain.com> my page
shows up but changing it to 12345.mydomain.com
<http://12345.mydomain.com> I get the Tomcat Administration page...
My Virtual Host is now
<VirtualHost 94.199.241.124:80 <http://94.199.241.124:80>>
DocumentRoot /var/www/mydomain.com <http://mydomain.com>
ServerName mydomain.com <http://mydomain.com>
ServerAlias *.mydomain.com <http://mydomain.com>
ProxyPreserveHost On
ProxyPass / ajp://localhost:8009/
ProxyPassReverse / ajp://localhost:8009/
RewriteEngine On
RewriteRule ^/(.*\.cf[cm]/?.*)$ ajp://localhost:8010/$1 [P]
ErrorLog logs/mydomain_error.log
CustomLog logs/mydomain_access.log combined
</VirtualHost>
and in the server.xml I have
<Host name="mydomain.com <http://mydomain.com>" appBase="webapps">
<Alias>www.mydomain.com <http://www.mydomain.com></Alias>
<Context path="" docBase="/var/www/mydomain.com <http://mydomain.com>"
allowLinking="true" />
</Host>
AJP seems to work atleast for the www but not for 1234x.mydomain.com
<http://1234x.mydomain.com>
I must be doing something really stupid here that I can't seen...
/Mats/
On Sat, Feb 6, 2010 at 12:26 AM, Nitai @ Razuna <[email protected]
<mailto:[email protected]>> wrote:
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 <http://razuna.org>" appBase="webapps">
<Alias>www.razuna.org <http://www.razuna.org></Alias>
<Context path="" docBase="ABSOLUTEPATHHERE" allowLinking="true" />
</Host>
<Host name="razuna.com <http://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 <http://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
--
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 !!
--
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 !!