Search code examples
javaapachejsptomcatopencms

Change domain name on OpenCMS website


I have bought website running on an OpenCMS and I've migrated the database to my own system. However, I would like to keep the original version running on old. subdomain. And here's the problem:

  • original opencms domain was www.example.org (app) and rs.example.org (admin panel), now, it's where new webapp is running.
  • openCMS should be running on old.example.org
  • httpd on the server (port 80) is configured to redirect requests to tomcat (localhost:8080), /etc/hosts has hardcoded 127.0.0.1 for www.example.org and rs.example.org
  • OpenCMS config opencms-system.xml contains the following:

    <sites> <workplace-server>http://rs.example.org</workplace-server> <default-uri>/sites/default/</default-uri> <shared-folder>/shared/</shared-folder> <site server="http://rs.example.org" uri="/sites/default/"/> <site server="http://www.example.org" uri="/sites/www.example.org/" /> </sites>

I tried to simply change "server" attribute in XML config and modify hosts (change www. to old.).

Result was not what I was expecting - webapplication has started, but totally different template has been used (different html output for homepage).

Any ideas, what to do to be able to run the same application with only the domain change?

Application runs on gentoo server.


Solution

  • This one is working :)

            <site server="http://www.example.org" uri="/sites/www.example.org/">
                <alias server="http://old.example.org"/>
            </site>