Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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" />
    <Resource name="UserDatabase" auth="Container"
              description="User database that can be updated and saved"
              pathname="conf/tomcat-users.xml" />
  <Service name="Catalina">
    <Connector port="8080" protocol="HTTP/1.1" 
               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

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


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.