Can't access remote tomcat webapps - linux

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

Related

How do I choose the Host to deploy a web app project with netbeans and tomcat?

How do I choose a Host to deploy a web app project with netbeans and tomcat?
Or how do I migrate a project from one host to another?
I developed a web application with netbeans ide and tomcat.
It runs as expected with localhost.
I am about to link my domain name to the IP but I cant move the project from localhost to the domainHost.
I want to keep using the IDE because the web application will be changing and growing.
This is the web's context under Catalina at CatalinaHome/conf/Catalina/localhost/webtest1.xml
<?xml version="1.0" encoding="UTF-8"?>
<Context docBase="C:/me/NetBeansProjects/webtest1/build/web" path="/webtest1"/>
This is the context.xml at C:\me\NetBeansProjects\webtest1\web\META-INF\context.xml
<?xml version="1.0" encoding="UTF-8"?>
<Context path="/webtest1"/>
This is the server configuration at CatalinaHome/conf/server.xml
<Engine defaultHost="localhost" name="Catalina">
<!-- etc -->
<Host appBase="webapps" autoDeploy="true" name="localhost" unpackWARs="true">
</Host>
<Host appBase="domainapps" autoDeploy="true" name="www.mydomain.com" unpackWARs="true">
</Host>
</Engine>
How do I move the project to CatalinaHome/conf/Catalina/www.mydomain.com/ without loosing the project's control via the IDE ?
I even tried to create a new proyect and copy the sources but netbeans and tomcat deploys it under localhost. I dont´t know how to specify the host I want to deploy the project in.

Creating Virtual Directory on IIS for Coldfusion Lucee

I am trying to Move my Website on a local directory from Adobe Coldfusion to Lucee.
I was able to Install Lucee with the Windows Installer.
IIS is working fine.
When i Create a Virtual Directory from IIS to Map a Physical Path (C:/Website) outside the inetpub root folder (FOR IIS) or outside the Tomcat/webapps/ROOT folder (for Lucee), IIS doesn't load that physical folder. Instead it loads the inetpub root folder and i can't access files from the Physical Path Directory.
I am using //localhost/{The Alias} to call the Website but saying file not not found.
Obviously because it's calling from Inetpub file Directory, not the Physical path.
Are there any special configurations i need to make?
I have searched online and no post could help.
Note that i am using different computers.
Kindly Assist.
mod_cfml (the adapter that is used with Lucee/IIS along with the BonCode Connector) does not currently support virtual directories. You will need to configure those manually in the Tomcat context config, like so:
<Host name="lucee.org" appBase="/home/lucee/public_html">
<Context path="/vdir/" docBase="/home/other_user/public_html/some_other_directory/" />
<Alias>www.lucee.org</Alias>
</Host>

Please help in mod_jk/apache2/JBoss EAP 6.3

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">

Tomcat webapp configuration on linux

I have a webapp (springmvc 3.0.5/java 1.6 based) that I'm deploying to a tomcat (6.0.32) web server on a linux machine. Currently I copy the war file out to the server and let tomcat unpack it for me.
relevant lines in server.xml:
<Host appBase="webapps" autoDeploy="true" name="localhost" unpackWARs="true" xmlNamespaceAware="false" xmlValidation="false">
<Context docBase="fooapp" path="/" reloadable="true" source="org.eclipse.jst.jee.server:Fooapp"/>
</Host>
I want the webapp context path to be "/" so I don't have to add /fooapp/ to every url. http://www.mydomain.com/index.html instead of http://www.mydomain.com/fooapp/index.html
The issue is that in my current configuration the webapp is served from BOTH "/" and from "/fooapp" context paths because tomcat unpacks the war twice. Once to the fooapp directory and another time to the ROOT directory.
I'd like the web application to be unpacked just once to the fooapp directory and still served from the "/" context path. Can this be done on linux and if so how?
Note: This works on windows exactly as I want so I'm hopeful that linux can do the same thing.
The simplest method:
Delete your Context tag from the server.xml,
delete webapp/fooapp and webapp/ROOT directories,
copy your fooapp.war to the webapp directory as ROOT.war.
You can find some other methods in the Tomcat's documentation.

Tomcat Configure To Serve Static Files is not working

I have linux machine, on which I have deployed my project. I have some static content which I have placed at /var/grt_dynamic_images on physical harddisk on linux. I am using it as /EchlonSurvey/images/dynamic/images. It is working fine on windows but not on linux.
Here is the server.xml file snapshot, where I am doing this configuration.
<Context docBase="/var/grt_dynamic_images" path="/EchelonSurvey/images/dynamic_images" />
<Context docBase="/var/grt_dynamic_images/category_images" path="/EchelonSurvey/images/dynamic_images/cat_images" />
<Context docBase="/var/grt_dynamic_images/profile_images" path="/EchelonSurvey/images/dynamic_images/prof_images" />
In webpage, I get 404 error. The path is same but the image are not coming from docBase. I have checked, there are all image which I need.
http://.../EchelonSurvey/images/dynamic_images/cat_images/277152_9449%20sml.png
image not available
one suggestion. if you have a ROOT webapp, you can create a symbolic link within it and point to the folder you want to serve. so something like
/tomcat/webapps/ROOT: ln -s /var/grt_dynamic_images /EchelonSurvey/images/dynamic_images
when i do this, it 'works' but only if i am specifying an actual resource on the url, like a .png file. i still get 404's if i just stop the url at a folder level. i'm sure there's some Tomcat setting for displaying a folder listing but haven't looked into it.

Resources