Access to host manager in Lucee 5

OK Guys.

I know this is an old post, but I have managed to set up Apache Tomcat Host Manager on:

Environment:

  • Windows 2012R2
  • Lucee 5.3.6.61
  • IIS 8.5

This technique uses a standard Lucee Windows Installer, with Apache Tomcat already integrated within Lucee.
I know there are already solutions, that use a standalone version of Lucee.
So, I wanted to try and find a solution, for what I suspect, is the most typical kind of Lucee installation?

Add Directories:

The problem with the standard Lucee Windows Installer, is that the UI parts of the manager & host-manager modules, are not included within Tomcat.
I therefore needed to copy over the manager & host-manager folders, from a downloaded copy of:

apache-tomcat-9.0.35-windows-x64\apache-tomcat-9.0.35\webapps

From:

https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/

Into:

C:\lucee\tomcat\webapps

Update Config:

Then I edited:

C:\lucee\tomcat\conf\tomcat-users.xml

With:

<?xml version="1.0" encoding="UTF-8"?>
<tomcat-users xmlns="http://tomcat.apache.org/xml"
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:schemaLocation="http://tomcat.apache.org/xml tomcat-users.xsd"
              version="1.0">
	<role rolename="admin-gui"/>
	<role rolename="manager-gui"/>
	<user username="[create a username here]" password="[create a password here]" roles="admin-gui,manager-gui"/>
</tomcat-users>

Then I removed the comments around the JSP references inside:

C:\lucee\tomcat\conf\web.xml

Line 268:

<servlet>
        <servlet-name>jsp</servlet-name>
        <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
        <init-param>
            <param-name>fork</param-name>
            <param-value>false</param-value>
        </init-param>
        <init-param>
            <param-name>xpoweredBy</param-name>
            <param-value>false</param-value>
        </init-param>
        <load-on-startup>3</load-on-startup>
</servlet>

Line 511:

<servlet-mapping>
        <servlet-name>jsp</servlet-name>
        <url-pattern>*.jsp</url-pattern>
        <url-pattern>*.jspx</url-pattern>
</servlet-mapping>

Line 4834:

<welcome-file-list>
		<welcome-file>index.cfm</welcome-file>
        <welcome-file>index.html</welcome-file>
        <welcome-file>index.htm</welcome-file>
        <welcome-file>index.jsp</welcome-file>
</welcome-file-list>

And then I uncomented the section:

<Connector executor="tomcatThreadPool"
               port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />

In:

C:\lucee\tomcat\conf\server.xml

Restart Lucee Apache Tomcat:

And then I restarted the Lucee Apache Tomcat Server.

Apache Tomcat Host Manager:

Then navigate to:

http://localhost:8080/host-manager/

Now, there is one more important point.
In Apache Tomcat Host Manager:

You cannot add aliases to existing host entries

However, if you remove the host entry and then add the host entry again, with your aliases, it does the same thing.
I also unchecked all the associated checkboxes with the new host entry, but I am not entirely sure whether this is correct.
I just didn’t want to redeploy anything?
Maybe someone with more knowledge about Apache Tomcat Host Manager, could tell me whether this approach is correct or not?

Remember to add your new binding in IIS, first.

And the beauty is, this process does not require a Lucee Apache Tomcat restart.

Update DNS Record:

Having added a new IIS binding & Apache Tomcat Host alias, I then went to my 123-reg Domain DNS Control Panel and added the new domain name that matches the new binding/alias.

I then hit the new domain URL, in my browser and voila, everything works!

I can now see my website on a new domain, without having to restart Lucee Apache Tomcat.

Summary:

Now imagine you have a 1000 websites on your Lucee Application Server instance. This system makes things far more manageable.
You certainly don’t want to have to restart 1000 websites, every time you want to add one new alias.

Mod_cfml:

This procedure is good for admins who don’t want to use mod_cfml. Personally, I found that I could never get mod_cfml, to work.
I believe my approach, is a little less nuclear. Yes. It requires a bit more work and a little more config, but it is config that doesn’t seem to interfere with the way Lucee, works.

And Finally:

If you have any questions, please do not hesitate to reply to this comment. :slightly_smiling_face:

3 Likes