CFM adresses go the wrong directory (apache)

Looks like mod_cfml is not detecting the new virtual host of apache2. Let me think… Is it possible that any of these configuration folders in /tomcat/catalina/conf/ (with the exception of 127.0.0.1) isnt correctly assigned to an virtual host of apache2? Are they all working properly and configured to one apache2 virtual host domain name, and just demeter04.fr missing?

Another thing that comes to my mind: this is the virtual host configuration for port 80 http, but you are directing each request to https with url rewrite. Did you already configure that virtual host (the one with port 443)? That should be another virtual host file, one named with ssl. That virtual host needs to be a2enabled also.

As you can see in the catalina folder in previous reply,
I have :

1- cinema-leol-fr-cinema-leol-fr-confl1
and url hhtp://cinema.leol.fr is working (not redirected to an https://)

2 - leol-fr-leol-fr-le-ssl-confl2
and url hhtp://leol.fr is redirected to https://leol.fr and working
and www-leol-fr-leol-fr-le-ssl-confl2 (the alias name)

3 - www-sinistre-laclue-fr-sinistre-laclue-fr-le-ssl-confl2
and url http://sinistre-laclue.fr is redirected to https://sinistre-laclue.fr and working
and url http://www.sinistre-laclue.fr is redirected to https://www.sinistre-laclue.fr but ssl certificat not good

4 - plarts-creaweb-fr-000-default-confl1 (not used, I do not know why I have this, came at install ?)

But :
nothing about demeter04.fr

All of these are not in a good logic (strange)
And all the “Virtual Host” apache files are of same structure (coding)
See below the existing files in “sites_available” and 'sites_enabled"
apache_sites_available
apache_sites_enabled

Thanks for any idea
I may start with NO SSL first.
When all is good, I will see to add the SSL url.

Also, you said that SSL sites should be a2enabled too ?
With what name ?
Thanks.

Just for you to know, I’m not sure if you are aware of that: The sites-available folder is where your virtual hosts configuration files are. This is the place you make your changes. As soon as you do a2ensite name-of-configuration-file-without-file-extension apache2 will activate the site and set sites-enabled folder. The files in sites-enabled MUST NOT be edited. You edit the files in sites-available and do an apache2 reload with systemctl apache2 reload. That will make the sites-enabled folder get updated by apache2 itself.

Antoher thing is that usually you have one virtual host conf file for HTTP, and another one virtual host conf file for HTTPS. If you can’t see a demetre04.fr.conf without it’s https version in sites-enabled, that means the site is not active ( it’s just like in a “paused” mode). Also cinema.leol.fr-le-ssl.conf is available but not enabled. That is just as information.

Now what I see:
You have 000-default.conf enabled. If you didn’t do any changes to that file by adding a host name, then this “default” site will act as a wildcard for non-configured virtual host names. That means: As soon as you register a new domain name in DNS to point to your servers IP address and you hit it with a browser without having another configuration file set up for that domain name, 000-default.conf will be used. And this might be used also by mod_cfml to setup the catalina/conf files.

Now that is whal I’d do in you case:

Step 1: Deactivate the default virtual host with a2dissite 000-default. This will force you to always need a working configuration file for each site and host name, so that it won’t be used as a host name wildcard. BUT (!!!) don’t delete the file sites-available/000-defalut.conf (just keep it disabled)

Step 2: If you don’t know what plarts-creaweb-fr-000-default-conf is, and you are sure you are not using it anything, I would delete it. But make a copy of that directory to somewhere as a backup, just in case you need it’s content if something fails. Just to be sure, restart Lucee/Tomcat after deleting.

Step 3: You don’t have demeter04.fr-le-ssl.conf in apache2 enabled. If you are using https you’ll need to activate it.

YES!!! Make http version work first:

  1. As a first step I’d set in demeter04.fr.conf the urlrewrite rules as comment.

  2. Then look if the site http://demeter04.fr is responding and tomcat lucee is also acting correctly. Hit that 1site with a pure http request in your browser. Make sure your browser is not using any pre cached redirect to https.

  3. After you have successfully requested a cfm page at http://demeter04.fr and you are getting responses from tomcat/lucee and the correct webroot is being used, then you can go and try enabling the ssl version with `a2ensite demeter04.fr-le-ssl’.

  4. The UrlRewrite rules should only be enabled in the last step, step by step, rule by rule.

Step 4: Then you can also try enabling the https version of cinemas.leol.fr with a2ensite cinemas.leol.fr-le-ssl

I have a2dissite all SSL sites
and deleted all SSL conf files in “site-available”.
But now I can’t restart apache, I get this error (see screen attached)


So no sites are working. (page unreachable)
What do you think about this apache error ?
I do not know about “systemctl status apache2.service” and “journalctl -xe”
How to make apache working again ?
Thanks for help.

Why did you delete also all working SSL conf sites? They were working, or not?
Also: always backup before doing any changes, so you can go back if you break something. And always do step by step, so you can easily detect what went wrong by the changes. If you don’t have any backups, you need to troubleshoot. Take a lookt at this link for more information

The error you are facing is a typical apache error that might be caused because now there is something missing or you set something where it isn’t allowed, e.g. wrong syntax, directives in a wrong place and more.

I had a backup.
So, I reload all http conf files and ssl conf files in “sites available”
I restart apache, i did work. I restart also lucee.
But all sites are unreachables
with that error : PR_END_OF_FILE_ERROR
see below conf files.


and files in “catalina” folder

In apache , all conf files have a new date of today.
But, in catalina, all keep old/original dates
Is that a clue ? thanks for help.

PR_END_OF_FILE_ERROR: this is a typical firefox error, if he can’t connect to a ssl site. Did you reenable all the deleted ssl sites in apache2? Do these show now in sites-enabled?

Just confirming that your ssl sites seem to be disabled, e.g. https;//cinema.leol.fr. Chrome is redirecting to the https, but not receiving a response.

Did you try to reenable the ssl version with sudo apache2 cinema.leol.fr-le-ssl ?

Well, I did enable the SSL sites, in fact all sites
a2ensite HTTP sites and HTTPS sites.
And now apache does not restart again


And I can see all sites in apache “sites_enabled”

And in Lucee Tomcat “catalina” folder, it is all same as before.

Thanks for help.
Some logic which is not clear to me ?
Can I erase all site available and start with a single site (leol.fr) ?
Pierre.

No need to do that. Please remember to always do step by step, NOT enable all sites at once. Enable one site, check if apache2 works, then the other and check, then the other and check. You can just have one configuration file with wrong syntax and that can crash apache. Better is to disable them, not delete.

How can I start from scratch ?
I want to take all off, and start again, one site, make sure it is working
then next.
But it seems that these software have memory and it’s difficult to come back to Zero.

What 's your advise ?
Thanks, Pierre.

Getting better.
I take all off (a2dissite and delete conf files)
Then I restart with leol.fr (without rewrite to SSl) and apache restart did work
Then I continued as same, without SSL.
And it did work.
Now the 4 sites are working.
leol.fr
cinema.leol.fr
demeter04.fr
sinistre-laclue.fr

May be , it was my comments lines, that apache did not like ?
I used<!-- -->
Is that the comments tag in CONF files ? or something else ?
Thanks you.

Thats right! Those comments won’t work on apache2 configuration files. To comment a line you need to use number sign # as the first character of the line, like so

# this is a comment
<Directory /var/...
...

That’s right. That was the silly thing I did which bring all these problems.
Ithink, I have seen this type of comment somewhere in a conf file, and I did not think about it. Thanks for your assistance.
Now all should be solved. (and I remember # as comment)
Pierre.

Sorry, problems are not finished.
All is working well for 3 or 4 minutes,
And then I can’t access pages, it takes time and I get this error
502 Proxy Error

Proxy Error

The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request GET /index.cfm.
Reason: Error reading from remote server
Apache/2.4.38 (Debian) Server at leol.fr Port 80

If I stop and start Lucee, it works again well.
And same, after 4 minutes of navigation through any pages.
I get that error.

Any idea ?
Thanks.

This happens if Apache2 doesn’t get a response in a certain period of time. It is possible that Tomcat is crashing, it can also be that your app is taking too long to fullfill requests. What does catalina log show? And can you see any application error exceptions somewhere?

No application error exceptions. All these ran under Windows Coldfusion with no errors before.

Where is located the catalina log ?
I found catalina.2021-04-06.log
in Tomcat logs folder
Inside I see this (partial)

06-Apr-2021 14:58:42.703 INFOS [main] org.apache.catalina.startup.VersionLoggerListener.log Version du serveur: Apache Tomcat/9.0.24
06-Apr-2021 14:58:42.709 INFOS [main] org.apache.catalina.startup.VersionLoggerListener.log Serveur compilé: Aug 14 2019 21:16:42 UTC
06-Apr-2021 14:58:42.709 INFOS [main] org.apache.catalina.startup.VersionLoggerListener.log Version du serveur: 9.0.24.0
06-Apr-2021 14:58:42.709 INFOS [main] org.apache.catalina.startup.VersionLoggerListener.log Nom de l’OS: Linux
06-Apr-2021 14:58:42.710 INFOS [main] org.apache.catalina.startup.VersionLoggerListener.log Version de l’OS: 4.19.0-6-amd64
06-Apr-2021 14:58:42.710 INFOS [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: amd64
06-Apr-2021 14:58:42.710 INFOS [main] org.apache.catalina.startup.VersionLoggerListener.log Répertoire de Java: /opt/lucee/jre
06-Apr-2021 14:58:42.710 INFOS [main] org.apache.catalina.startup.VersionLoggerListener.log Version de la JVM: 11.0.4+11
06-Apr-2021 14:58:42.710 INFOS [main] org.apache.catalina.startup.VersionLoggerListener.log Fournisseur de la JVM: AdoptOpenJDK
06-Apr-2021 14:58:42.710 INFOS [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: /opt/lucee/tomcat
06-Apr-2021 14:58:42.711 INFOS [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: /opt/lucee/tomcat
06-Apr-2021 14:58:42.728 INFOS [main] org.apache.catalina.startup.VersionLoggerListener.log Argument de la ligne de commande: --add-opens=java.base/java.lang=ALL-UNNAMED
06-Apr-2021 14:58:42.728 INFOS [main] org.apache.catalina.startup.VersionLoggerListener.log Argument de la ligne de commande: --add-opens=java.base/java.io=ALL-UNNAMED
06-Apr-2021 14:58:42.729 INFOS [main] org.apache.catalina.startup.VersionLoggerListener.log Argument de la ligne de commande: --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED
06-Apr-2021 14:58:42.729 INFOS [main] org.apache.catalina.startup.VersionLoggerListener.log Argument de la ligne de commande: -Djava.util.logging.config.file=/opt/lucee/tomcat/conf/logging.properties
06-Apr-2021 14:58:42.729 INFOS [main] org.apache.catalina.startup.VersionLoggerListener.log Argument de la ligne de commande: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
06-Apr-2021 14:58:42.729 INFOS [main] org.apache.catalina.startup.VersionLoggerListener.log Argument de la ligne de commande: -Djdk.tls.ephemeralDHKeySize=2048
06-Apr-2021 14:58:42.729 INFOS [main] org.apache.catalina.startup.VersionLoggerListener.log Argument de la ligne de commande: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
06-Apr-2021 14:58:42.729 INFOS [main] org.apache.catalina.startup.VersionLoggerListener.log Argument de la ligne de commande: -Dorg.apache.catalina.security.SecurityListener.UMASK=0027
06-Apr-2021 14:58:42.730 INFOS [main] org.apache.catalina.startup.VersionLoggerListener.log Argument de la ligne de commande: -Xms256m
06-Apr-2021 14:58:42.730 INFOS [main] org.apache.catalina.startup.VersionLoggerListener.log Argument de la ligne de commande: -Xmx512m
06-Apr-2021 14:58:42.730 INFOS [main] org.apache.catalina.startup.VersionLoggerListener.log Argument de la ligne de commande: -Dignore.endorsed.dirs=
06-Apr-2021 14:58:42.730 INFOS [main] org.apache.catalina.startup.VersionLoggerListener.log Argument de la ligne de commande: -Dcatalina.base=/opt/lucee/tomcat
06-Apr-2021 14:58:42.730 INFOS [main] org.apache.catalina.startup.VersionLoggerListener.log Argument de la ligne de commande: -Dcatalina.home=/opt/lucee/tomcat
06-Apr-2021 14:58:42.730 INFOS [main] org.apache.catalina.startup.VersionLoggerListener.log Argument de la ligne de commande: -Djava.io.tmpdir=/opt/lucee/tomcat/temp
06-Apr-2021 14:58:42.731 INFOS [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent La librairie Apache Tomcat Native basée sur APR qui permet des performances optimales dans les environnements de production n’a pas été trouvée sur le java.library.path: [/usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib]
06-Apr-2021 14:58:43.129 INFOS [main] org.apache.coyote.AbstractProtocol.init Initialisation du gestionnaire de protocole [“http-nio-8888”]
06-Apr-2021 14:58:43.163 INFOS [main] org.apache.coyote.AbstractProtocol.init Initialisation du gestionnaire de protocole [“ajp-nio-8009”]
06-Apr-2021 14:58:43.170 INFOS [main] org.apache.catalina.startup.Catalina.load L’initialisation du serveur a pris [759] millisecondes
06-Apr-2021 14:58:43.218 INFOS [main] org.apache.catalina.core.StandardService.startInternal Démarrage du service [Catalina][catalina.2021-04-06.log|attachment]
The full log file here
(upload://wOpqItCBWdFzRtOJX8VzkcXqyWe.log) (22.3 KB)

Thanks, I have no idea. Why it works some minutes , then I need to restart Lucee.

I am SORRY,
YES there are application errors.
But I did not see them, because I had a CFerror which send error to me by mail.
So I got thousand and thousand mails from demeter04.fr
That should be the differences between Coldfusion and Lucee
I take off the mailing code.
And tomorrow, I will look at each application error.

1 Like

In fact, it is more differences between Windows and Linux
The / or \ when detecting name in adresss (thirst bug I found)
And I may find, uppercase and lowercase incoherences.
I Think , all will go fine now.
Thanks again.

Yeah, this is due to both different worlds of Linux and Windows: