Search code examples
opencms

How can I make my website (from custom template) visible? Only default demo site is shown in prod server


I have a new installation of OpenCMS (JDK11, tomcat8, MySQL). I followed the documentation to add my own template and modified it accordingly (Creating a template JSP). I also created a new site but I'm unable to find the correct URL to display it. For now I only have one web page and I published it.

The site's server URL is IPaddress:8081 as suggested by the documentation, but going to IPaddress:8081/opencms gives me a 404.

Tried deleting the demo site from the sites section but it still shows by default when going to IPaddress:8080/opencms (even after changing my site's port to :8080 and restarting tomcat).

Anyone with experience in setting up new sites from templates that can guide me?

Thank you very much.


Solution

  • it's not easy to guess what's wrong with your setup. I ask some questions. Maybe they guide you in the right direction.

    1. Did you create content in your site? If so and 3. is set correctly, you should be able to see your content by calling the server URI of your site, which you set in opencms-system.xml plus "opencms", plus the folder you created within the workplace. Don't add sites/yoursite. Example: IPaddress:8081/opencms/yourfolderinworkplace/. Be aware, that this only works, if your Tomcat listens to port 8081. If you are on your local machine, you can use 12 7.0.0.2, 127.0.0.3... for your different sites. So you can use port 8080 for all your sites.

    2. Can you open (not edit) a page by clicking on it from within the workplace?

    3. Did you set the template property correctly? It should contain the path to your master template jsp of your module. This is usually stored in the templates folder of your module.

    4. When deleting the demo content, did you also publish it? If not, the pages are still visible in the so called Online project.

    5. On your production server you should use Apache to differ between your sites.

    Hope this helps.

    Best regards Kai