I'm trying to deploy the WAR file of Apache Shindig to an apt-installed Tomcat 6 server on Ubuntu 10.04. Unfortunately, when it writes out things like <script>
tags, all the URLs are http://localhost/...
, even though I think I've told Tomcat that this server has an external name. The non-comment contents of my server.xml
file are here. This is essentially the default configuration, save for that I've changed all instances of localhost
to my.external.hostname
(of course, my actual hostname in the actual configuration file).
How do I get Tomcat6/Shindig to realize that it lives at my.external.hostname
so it doesn't refer to http://localhost/...
?
<?xml version='1.0' encoding='utf-8'?>
<Server port="8005" shutdown="SHUTDOWN">
<Listener className="org.apache.catalina.core.JasperListener" />
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
<Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" />
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
<GlobalNamingResources>
<Resource name="UserDatabase" auth="Container"
type="org.apache.catalina.UserDatabase"
description="User database that can be updated and saved"
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
pathname="conf/tomcat-users.xml" />
</GlobalNamingResources>
<Service name="Catalina">
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
URIEncoding="UTF-8"
redirectPort="8443" />
<!-- *** THIS IS WHERE IT GETS INTERESTING: hostname set here: -->
<Engine name="Catalina" defaultHost="my.external.hostname">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/>
<!-- *** and here: -->
<Host name="my.external.hostname" appBase="webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
</Host>
</Engine>
</Service>
</Server>