I'm trying to use mod_jk for getting a result something like localhost/hello should display result as same as http://localhost:8081/hello
My next goal is LoadBalancing but I'm stuck with my 1st step because:
localhost:8081/hello - works
localhost/hello - Fails with 404 page cannot be found
To give overview of environment:
JBoss 6.3.0 Alpha1
Apache2
mod_jk
I'm using domain and hostcontroller environment (not standalone). I have 2 JVMs in hostcontroller (TEST21 and TEST22). As of now my target is just to redirect all content of TEST21 jvm to localhost.
Let me try TEST22 part later.
I have edited apache2.conf, worker.properties, jk.conf.
Unfortunately I'm getting only 404 page cannot be displayed every time.
I did multiple restarts of all JVMs and Apache2 services. I did not see any errors in any logs.
I have attached all files and cross-posted the same question on jboss forum as well. It would help if you could refer to that link because I have too many files to add here.
https://developer.jboss.org/thread/269451
Configure your server.xml as following
<Connector port="8009" address="${jboss.bind.address}" protocol="AJP/1.3"
emptySessionPath="true" enableLookups="false" redirectPort="8443" maxThreads="1000" connectionTimeout="60000000" />
Also make sure you set correct JVM Route in jboss-as/server/${profile}/deploy/jbossweb.sar/server.xml that looks like: <Engine name="jboss.web" defaultHost="localhost" jvmRoute="node1">
Related
I upgraded Apache tomcat from 7.x to 8.5.29 recently. tomcat is deployed inside my application. I have /etc/init.d script which starts tomcat (off course along with some of my project specific other services as well).
Command: service start was working fine till I was on tomcat 7 and then after upgrade to tomcat 8.5.29 this command stopped working. There are no changes in /etc/init.d script at all. Just matter of tomcat upgrade only. Servlet.log is not showing any error but if I compare servlet.log of tomcat 7 and tomcat 8.5.29 then I can figure out that my application is not loading. As such there are no errors in servlet.log of tomcat 8.
Whereas all things works prefectly fine if I use /etc/init.d/<myapp -tomcat8> start.
I'll really appreciate if I can get any help from you all guys.
So after 2-3 days of struggle, I found solution to my own question. Someone may find useful.
I switched on debug mode of apache tomcat 7 (I am using log4j2 and already it was configured) and apache tomcat 8 on two different system and compared working log of apache tomcat 7 with non-working log of apache tomcat 8. I found that tomcat8 is scanning many extra and irrelevant things.
I updated context.xml, located in Tomcat's /conf directory as follow and that worked for me.
<JarScanner scanClassPath="false"/>
Please note following :
Placing above in app specific context.xml didn't worked for me.
Updating catalina.properties file with tomcat.util.scan.StandardJarScanFilter.jarsToSkip=\*.jar was also not working for me.
After doing changes I was facing error : java.lang.IllegalStateException: No output folder but that was due to wrong permission/ownership of tomcat folder.
I've tried almost everything.
When I go to a docker container by ssh and curl localhost:8080 there, I get normal welcome page, but If I do curl host_machine_hostname:8082 from my hostmachine by ssh or from everything else using hostname of my hostmachine, I get error, access forbidden.
I have read alot of suggestions but nothing helped.
Connector settings without address does not help, Valve rules with allow=".*" does not help, Host address=host_machine_hostname" does not help.
UPD
I'm sorry. I realized about the root of the problem. I'm using a custom fork of the tomcat and there were specific options for ROOT and other preinstalled packages to block everything while the 127.0.0.1 and the localhost are allowed. So I've got this thing working by removing package-specific context.xml files.
This is because the context.xml in webapps/{package}/META-INF/ was modified to block everytyhing, and if to Read TFM, package's context.xml has more power above the global context.xml file, that's why I couldn't change anything by modifying the global context.xml.
I realized about the root of the problem. I'm using a custom fork of the tomcat and there were specific options for ROOT and other preinstalled packages to block everything while the 127.0.0.1 and the localhost are allowed. So I've got this thing working by removing package-specific context.xml files.
This is because the context.xml in webapps/{package}/META-INF/ was modified to block everytyhing, and if to Read TFM, package's context.xml has more power above the global context.xml file, that's why I couldn't change anything by modifying the global context.xml.
i just upgraded tomcat to 7.0.54 from 7.0.42 and started it.. Everything is looking as expected but while starting the tomcat it showing "Starting Servlet Engine: Apache Tomcat/7.0.42" this line in logs..
i checked all my configurations again and but couldn't found from where that line is coming.
Please help me with this
Are you sure you have upgraded correctly. If you unpacked new tomcat to new location, but left the CATALINA_HOME variable unchanged most likely you still start up the old tomcat and hence the logs.
So check if you don't have system variables set to point to wrong paths. If you overwrote the old instalation check if you really did it, in linux there would be typically read only.
Thanks for the advise. I found the issue. I was overriding new tomcat on old tomcat. But i didn't replace new lib with old lib. After doing so, issue resolved
I've got tomcat running on a remote Linux box. We have one web app running on it okay,
/project1 (not root), with a "project1.war" auto deployed. I've now uploaded "project2.war" and I can see it's been extracted etc., but when I go to mysite/project2 I get a "not found" error.
I can't for the life of me see any references in server.xml, context.xml, web.xml for project1 to map its URL, so I'm really at a loss for how I'm supposed to get /project2 seeable. I'm very new to Linux, looking for some advice. Here's my server.xml entry:
<Host name="mysite.co.nz" appBase="webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
</Host>
Have to add it to apache 2 sites-available list
I am very new to Linux but I am trying best to learn. We have dedicated hosting server of CentOS 6. It is configure with Apache Server as our public website. Now we need to install PHP JAVA Bridge on it.
What I did is, I install TomCat 6 and jdk 1.6. Then I copy JavaBridge.war file to $CATALINA_HOME/webapps folder and jar files on $CATALINA_HOME/lib folder. When I check from tomcat 8080 port JavaBridge is working very good.
Then I make symlink of $CATALINA_HOME/webapps/JavaBridge on my apache server. Untill here everything is okay
But when I try to browse from browser like http://www.xxx.com/JavaBridge I will get following error
You don't have permission to access /JavaBridge/ on this server.
Apache Server at www.gizeleonline.com Port 80
Now my question is that do I am doing it in wrong way or do I have to get rid of Apache server or I am missing something.
Kindly help on this experts :)
Actually it was my mistake. I just re-image my server and re-install everything it start working everything. thanx for help every body