Two sites on different ports in IIS

Hello!

I’m triyng to set 2 separate sites on new IIS 10 (Win 2019).
First site works okay.
Second site show the same as first.
Sites placed in different folders and different ports (81, 82)

Is anybody know what is happened?

And one more thing i found now: when I stop first site in IIS. I still can see the second site as first ((

Very probably you have a misconfiguration set up. To find out, please tell us more about your configuration:

  1. How did you install or are you running Lucee? Lucee Installer? CommandBox?

  2. How did you bind IIS to Lucee? Boncode-Connector during Installer installation? Or another way?

  3. Are you using mod_cfml?

  4. Are these websites running full apps/frameworks, or do they have just single basic templates, e.g. only one index page in each webroot without any application.cfc? To tacle down the issue, I would just place one basic cfm page in each webroot, instead of a full running app which might do some fancy content loading in reference to the URL.

  5. Are any URL rewrites or redirections happening in your IIS configuration?

What I would do first:
Run a simple basic cfml template in each webroot. Are you able to access both sites directly through Lucee Port 8888? And: If you open Lucees Web Administrator (NOT Server Administrator) for each site, what context paths do they show in the overview section?

My I guess is that one of your context configuration of one of your sites is missing in tomcat.

I checked this on two dedicated servers. And have a same problem.

On first server I use Win 2008 R2, IIS 7. I have nstalled Lucee from Intsller. And user mod_cfm.
There are a lot of sites which wirking propiertly but they use hostnames and all depends to 80 port.
New two sites use only port 81 ad 82 without hostname.

I do not use url rewriters to this two sites.

On the second server I use windows 2019 as host machine and same OS as VM on Hyper -V. On Gusest VM I have install new Lucee from Installer. Then was created a two web sites. And have tryed to open it from Host machine. The first website depended to 80 port works well. The secont site depended to port 81 show the same page as first site.

I have trying open these sites from Guest VM, where they placed, and see the same.

If I try to create index.htm pages, I can see different pages on different sites.

I have ckecked open Web admin on 8888 as you said. They show to me the same route for both sites.

It very strange.

Ok. I see and I think I understand what is happening. Go to your Lucee path Installation path-to-you-lucee-installation\tomcat\conf\Catalina\ There you should find the folders of the tomcat configurations of your sites (These are created by mod_cfml). Find the two configuration folders that are having the issue and have a look into each root.xml file. In the root.xml file you should see the webroots defined in the context directive tag. If they are the same, change it to point to the correct webroots and restart Tomcat-Lucee service. Hope that helps a little.

There is no forlder for second site ((
As I can see the ID of site has the same number of folder. Like 7th id = w3svc7.
I have folder for only one of sites.

Can you add different hostnames to IIS? I think the problem is that mod_cfm is not adding the second site because the hostnames aren’t defined within IIS. I don’t know how mod_cfml works in details when using just ports do define different web contexts.

Okay! I will use the tutorial about installing Lucee on a clean Windows 2019 Server Datacenter and connecting it to IIS 10 with boncode connector and cfml_mod. It also guides through resolving a common 500 status code error “can’t create directory WEB-INF” , caused by the tomcat service not having the corresponding file permissions (security by default). Probably it will helps.

I’m pretty sure your problem has to do with the mssing host header names in your IIS site bindings. These are used by mod_cfml to identify the sites and create tomcats site configurations.

Is it possible to separate sites to different ports if I will not use mod_cfm?

As far as I can tell, I think the installer installation isn’t very suitable for this kind of setup. I never needed such setup myself. But I think in that case you should take a deeper look into running Lucee with Ortus commandbox that should be more suitable to run in that specific way.

I would think Andreas is on the right path. The mod_cfml valve may not distinguish by port so only sets up one tomcat context for both IIS sites.

The easiest way to test this to just change the site-name slightly

asite:81/
bsite:82/

And see how this behaves.

I can only see one way to do a port level distinction otherwise. This will require:
a) Two setups of Lucee
b) Install connector in site-specific mode for each site.
The general Lucee installer may not work to do this but you can try. You need to skip the connector installation and specify different ports for each install.

To a)
There was an article at one point on how to install two or more Lucee instances on one machine. You have to change the port numbers. The second instance will not start otherwise. I would simply add +4 to all numbers and see.
Make note of the server AJP port you use.

When using the Lucee installer skip the connector installation.

Test your Lucee installs by opening them in your browser directly. For example:
http://localhost:8888
http://localhost:8892

Is everything working? You have two different sites? Then move on to connection step.

To b)
Run connector installer and choose site specific install.
Pick your port:81 site and add matching your AJP port.

Then, re-run, connector installer, and pick second site (port 82) and match AJP port

This should do it.

Best,
Bilal

1 Like