Apache Tomcat virtual directories. Redirects to wrong location. ColdFusion Lucee - apache

I am trying to get a local version of Lucee ColdFusion running my app - which resides as two directories... the main app, and the client custom code.
To that myDomain.com should pull from the 'site' and myDomain.com/app/ should pull from the app.
I can be logged in to my site, and pulling data via includes etc, but if I try to browse (or make a call to) /app/cfc/myCFC.cfc ...
the behavior redirects to the 'root' and logs my app out.
my server XML looks like this
<?xml version='1.0' encoding='utf-8'?>
<Server port="8005" shutdown="SHUTDOWN" >
<Listener className="org.apache.catalina.startup.VersionLoggerListener" />
<Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
<Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
<Service name="Catalina" >
<Connector port="8888"
protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
<Connector port="8009"
protocol="AJP/1.3"
redirectPort="8443" />
<Engine name="Catalina"
defaultHost="127.0.0.1" >
<Host name="local.dev.myDomain.com" appBase="webapps" >
<Context path="/" docBase="C:\wwwroot\site" />
<Context path="/app" docBase="C:\wwwroot\app" />
</Host>
</Engine>
</Service>
</Server>
If it helps to understand; this is a legacy app running in production on Windows, Apache 2.2 and ColdFusion 11. I have the app aliased in Apache 2.2 like this:
Alias /app/ C:/wwwroot/app
I am trying to evaluate Lucee to see if our app will work on that platform without too many changes.
One noticeable difference, due to using the built in webserver, is the port 8888
so the actual url looks like: mydomain.com:8888/app/cfc
I do not know if this is the problem or something else. If I cannot find a solution, I'll install Apache 2.2 and match the config
Any help is greatly appreciated - jp
NOTE: I just changed the host in this txt to accurately mimic my setup - if that makes a difference.
local.dev.myDomain.com (only the 'myDomain' is specifically my domain, not literally myDomain)

Related

All static content requests going to Jboss EAP 7.1 , instead of looking in Webserver

Recently, I migrated from Jboss EAP 6.4 to Jboss EAP 7.1.
I have a Jboss EWS in front of Jboss EAP, with mod cluster to connect to them.
I use some static content which is kept in websever (Jboss EWS).
While accessing the webserver URL it used to server the static content in websever.
However, after migrating to JBoss EAP 7.1, it is looking for static content in Appserver and giving 404. This possibly is due to new addition of undertow, which wasn't in place in Jboss EAP 6.x
What changes should I do ( possibly in undertow config) so that it looks for static content in webserver itself, instead of appservers.
You need to add file handler and another location to the undertow subsystem in standalone.xml to serve static content (like images):
<server name="default-server">
<http-listener name="default" socket-binding="http"/>
<host name="default-host" alias="localhost">
<location name="/" handler="welcome-content"/>
<location name="/img" handler="images"/>
</host>
</server>
<handlers>
<file name="welcome-content" path="${jboss.home.dir}/welcome-content" directory-listing="true"/>
<file name="images" path="/var/images" directory-listing="true"/>
</handlers>

Tomcat 8 RemoteHostValve not working

The access to my server should be limited to some Remote hosts, and I want to allow Uptimerobot to monitor my server.
Currently uptimerobot gets always a 403 Forbidden.
I added Server.xml looks like this:
<Server .........>
<Service name="Catalina">
<Engine>
<Value className="org.apache.catalina.valves.RemoteHostValve" allow=".*\.uptimerobot\.com" />
</Engine>
</Service>
To match all hosts in this list UptimeRobot Whitelist
But after restarting server nothing changed, still 403.
I also tried to use a domain-name without wildcards like this:
allow="engine19\.uptimerobot\.com"
allow="engine19.uptimerobot.com"
But still 403,
I tried to enable hostnamelookups with adding
enableLookups="true"
to the <Connector
tag, but again no effect.
But in my logs I see that the access is resolved to "engine19.uptimerobot.com" wich matches my RemoteHost-Pattern.
Any Ideas, why it is still forbidden ?
EDIT:
Access via IP with
<Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="63\.143\.42\.244"/>
is working. But I dont want to add the whole list of ips there.
Is it possible that RemoteAddrValve and RemoteHostValve are disturbing eachother ?
I have tried this and this worked for me
set useIPVHosts to true in connector (Inside server.xml).
I am using HTTP connector and it looks as follow
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443"
enableLookups="true"
useIPVHosts="true" />
Details of attributes can be found here
Check tomcat/logs/local_access_log... to see what host name used for 403.
I found that our company DNS reports some names in all uppercase and others in all lowercase. Use (?i) to have regex be case insensitive:
allow="(?i)engine19\.uptimerobot\.com"
If you have both RemoteHostValve and RemoteAddValve, both must allow an incoming host. If either does not allow then 403 will be returned.

How to change port of Pentaho 5.1

May I ask How to change port of Pentaho 5.1. I am using windows 10. Now the value is 8080 but I need to change, I have searched on the internet information, they asked me to modify some xml file, but the problem is, the files they mentioned does not exist in my Pentaho.
Thank you very much!
According to this official 5.1 documentation,
Edit this /pentaho/server/biserver-ee/tomcat/conf/server.xml.
<!-- Define a non-SSL HTTP/1.1 Connector on port 8080 -->
<Connector port="8080" maxHttpHeaderSize="8192"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
connectionTimeout="20000" disableUploadTimeout="true" />
Then change the port number in /tomcat/webapps/pentaho/WEB-INF/web.xml
<context-param>
<param-name>fully-qualified-server-url</param-name>
<param-value>http://localhost:8080/pentaho/</param-value>
</context-param>
Restart the BA server.
I have done this earlier and worked for me.

how to redirect domian.com to www.domain.com in jboss 7.1.1 server

In my website i get ssl for www.domain.com. i open using this its worked fine, when i use domain.com it show security exception how to resolve that
i used url rewrite in my standalone.xml file like below but it not worked for me
<virtual-server name="default-host" enable-welcome-root="false">
<alias name="domain.com"/>
<alias name="www.domain.com"/>
<rewrite pattern="^(.*)$" substitution="https://$1" flags="R=301,L">
<condition test="%{HTTP_HOST}" pattern="^www\.(.+)$" flags="NC"/>
</rewrite>
</virtual-server>
please let me know if i did anything wrong?
its worked fine after this changes
<rewrite pattern="^(.*)$" substitution="https://www.domain.com$1" flags="R=301,L">
<condition test="%{HTTP_HOST}" pattern="!^www\.domain\.com$" flags="NC"/>
</rewrite>

How to connect JBoss AS 7.1.1 with IIS 7 using Apache ISAPI Redirector 1.2.37

I am trying to migrate my web app from JBoss EAP 5 to AS 7.1.1 and I am not able to get the IIS requests redirected to JBoss Web (Tomcat) on Windows 2008 R2 X64.
I have the filter authorized and running in IIS and pointing to the proper DLL and properties files and followed all the instructions I could find to get this working under JB 7 (it worked under JB 5). I am missing the last step which no one seems to be covering in their posts and answers.
Where do you make the changes to connect JBoss Web to port 8009 used by the AJP 1.3 connector?. Most of the examples refer to updating the connector in the server.xml file in JBOSS_HOME/server/default/Deploy/jbossweb.sar.
I don’t have anything like that under the new JBOSS_HOME/standalone/deployments folder. Where is JBoss Web configured?
Thank you for any pointers or examples you could supply.
Finally figured it out, the problem was a missing ajp connector that had to be defined in standalone.xml in the web subsystem as follows:
<subsystem xmlns="urn:jboss:domain:web:1.1" default-virtual-server="eStar-Host" native="false">
<connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http"/>
<connector name="https" protocol="HTTP/1.1" scheme="https" socket-binding="https" secure="true">
<ssl/>
</connector>
<connector name="ajp13" protocol="AJP/1.3" scheme="http" socket-binding="ajp" redirect-port="8443"/>
<virtual-server name="eStar-Host" enable-welcome-root="true">
<alias name="localhost"/>
</virtual-server>
</subsystem>