Take the 2-minute tour ×

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/...?


  <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" />
    <Resource name="UserDatabase" auth="Container"
              description="User database that can be updated and saved"
              pathname="conf/tomcat-users.xml" />
  <Service name="Catalina">
               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"
      <!-- *** and here: -->
      <Host name="my.external.hostname"  appBase="webapps"
            unpackWARs="true" autoDeploy="true"
            xmlValidation="false" xmlNamespaceAware="false">
share|improve this question

2 Answers 2

Have you seen this bug entry Shindig Jira Issue 272? At least in last December there were no news on a potential resolution. Obviously some hard coded paths are in the way of using a different servlet container than Jetty if your hostname should not be localhost. There is a temporary solution described in the Jira ticket. Does it work for you?

share|improve this answer
That seems to deal more with the path in the deployment; I have mine at ROOT... –  Paul Fisher Feb 6 '11 at 19:21
up vote 0 down vote accepted

It turns out that there's a separate settings file for Shindig that isn't mentioned in the setup documentation. You have to edit the WEB-INF/classes/containers/default/container.js file in order to change the host name. There are a bunch of places that use ${HOST_NAME} or localhost, which I changed to my.external.hostname. Now it works!

share|improve this answer

Your Answer


