How to hide context root - apache

I've configured Glassfish 3.1 + Apache 2 with jk_mod.
All is well when I type in http://myserver.com/myapp, it does displays the index page.
I need help to change from http://myserver.com/myapp to http://myserver.com and it should still go to myapp.
Please let me know if this is even possible.?
Thanks.

Yes, this is possible.
You can set a Default Web Module for the default Virtual Server named server.
To do this, deploy your application, open the GlassFish Admin GUI, go to server-config -> Virtual Servers -> server and look for the setting Default Web Module. Select your web application and save. Now you can reach your web application on http://myserver.com. Be aware that your Apache configuration has to be in sync with the new context root.
You can also set it up via asadmin:
set server-config.http-service.virtual-server.server.default-web-module=<YOUR_WEBAPP>
See also:
Oracle GlassFish Server 3.1 Administration Guide - Administering Virtual Servers
Glassfish unable to deploy at root because default-web-module is declared

Related

Unable to access glassfish served content when using localhost

I created this simple dynamic web project (glassfish 4.1.1 latest atm) using eclipse java ee Mars.2 that I installed 2 days ago.
Checking on the admin, the app is deployed and running fine. I could not access the web app using the localhost:8080 url but it works when I use <computername>:8080.
I could access the admin using localhost:4848.
I tried disabling the firewall but the problem persists. What could be the problem?
The error is:
404 Not Found
No context found for request
In eclipse I see the log int he console that says: Automatic timeout occurred
As I pointed out in comments, you can configure listeners in Configuration -> needed configuration -> Network Config -> Network Listeners. However, it is still rather strange that your localhost doesn't work with 0.0.0.0 IP address, since it is a special address which means "listen on all available IPs on given port". Perhaps your network is somehow misconfigured.

Glassfish application displays blank screen when deployed with default web module

I've had an issue with glassfish for years and figured it was time to see if anyone else ran into this issue. All versions 3 and the latest 4.
I can deploy a web application (different instances on different servers/builds) with a default web module set with no issue. The web application starts up and runs fine.
The problem I'm having is that once I have to restart the server, simply relaunching the web server only shows a blank white screen with no error and no information anywhere. I have to then go into the admin console, undeploy the application, stop the glassfish server, redeploy, and then go back into the admin console and set the default web module.
If I do not set the default web module I do not run into these errors and I can stop/start/restart the server at will with no issues. It's only when I designate a default web module that it shows the blank screen. This is repeatable 100% for me.
Any ideas as to how to fix it? It takes far too long to get the application back up and running when this happens.
After a lot of research here is what I have found out.
The blank page means that the contextroot defined during deployment gets overwritten by the default contextroot which glassfish gets from the name of the WAR file being deployed.
If deploying an application with the name Application-1.0-SNAPSHOT.war from as admin console or admin GUI and you either specify the contextroot as:-
/application in the glassfish-web.xml configuration file or
from the admin console ./asadmin deploy --contextroot application path-to/Application-1.0-SNAPSHOT.war
The application with only be accessible from the browser by enter URL <domain-name>/Application-1.0-SNAPSHOT but what you want is your default web app to load when you access the domain name where it is deployed.
To achieve this you have to use the --name parameter to make sure that you the deployment name used matches the contextroot parameter value you want therefore
instead of:
from the admin console
./asadmin deploy --contextroot application path-to/Application-1.0-SNAPSHOT.war
you should do
./asadmin --name application deploy --contextroot application path-to/Application-1.0-SNAPSHOT.war

how to make sur that Jboss is well installed and configured?

I m using eclipse indigo and i installed the Jboss Server earlier.i though that every thing is fine;
But when i make a right clik on a JSP page for exemple ,there is no "Deploy" ,and if i what to deploy the whole project..the same thing i can't do it because the is no "Deploy" option.
iand if i ighone all that and do a "Run As" --> "Run on a server" i get a http 404 error saying the requested ressource is not available.
i have Jboss in my eclipse ,is there any why to know that Jboss is well insatlled??
Thank you
The easiest way to check whether JBoss 7 is running is to access native management interface.
Usually it's bound to 9999 port.
In order to verify the port look for port attribute of management native interface socket binding in standalone.xml (standalone-full.xml or whatever configuration you are using)
For localhost it would be:
http://localhost:9999
Another way to check JBoss 7 status is to use management console.
Usually it's bound to 9990 port.
In order to verify the port look for port attribute of management HTTP interface socket binding in standalone.xml (standalone-full.xml or whatever configuration you are using).
For localhost it would be:
http://localhost:9999
Additionally, you can check the so called marker files.
Just go to deployments directory and look for .deployed file (if the file exists it means that your application is successfully deployed).
You can read more about deployment descriptors at:
https://docs.jboss.org/author/display/AS7/Application+deployment

Steps to execute .ear file from Glassfish server into Tomee+ server

As a newbie to Enterprise Applications I'm trying to get it done.
I developed an Enterprise application in Netbeans 7.1.2. It runs successfully using the default Glassfish server. With the need to change the server, I downloaded and installed Tomee+ server, and made some changes to make Tomee Manager Interface work on my system.
I deployed the .ear file (Glassfish server output) into Tomee+ by placing it in the Tomee webapps folder, with the server in the running state. It gets automatically deployed and appears in the Tomcat Web Application Manager interface.
Then, by providing the suitable path in the address bar, like http://localhost:8080/app-war/faces/app.xhtml, it provides the frontend screen but the backend process is not working if I click the submit button. Instead, it simply provides a status page, like HTTP Status 500 - javax.el.ELException: javax.ejb.EJBTransactionRolledbackException: Transaction was rolled back, presumably because setRollbackOnly was called during a synchronization.
My question is: what went wrong with the steps I took for deploying it in Tomee+ server?
no more verbose stack?
btw can you try to:
1) check you have in tomee.xml the line
2) put your ear in /apps/ instead of webapps/
The point is by default (can be configured with the snapshot/next release) tomee extracts the ear in a folder simply removing the extension (webapps/your-ear/ for instance) and then tomcat takes this folder as a webapp so your deployment is no more the one expected. That's why moving it over a folder not managed by tomcat (apps) is often enough.
That's said, Glassfish transaction management is sometimes too tolerant (why i ask the full stack you got).

Deploy WCF REST 4.0 to XP IIS 5?

I am trying to deploy a simple "Hello World" .NET 4.0 REST-style WCF service on WinXP (IIS5). It works fine in Cassini.
I tried to adapt the info here to me:
http://haacked.com/archive/2008/11/26/asp.net-mvc-on-iis-6-walkthrough.aspx
but something is not clicking. Can anyone lend ideas or comments? Yes, I must stay with WinXP.
Thanks.
After a fair amount of struggling I was able to successfully deploy a WCF 4.0 REST web service on XP/IIS5. For the benefit of you and others in the same situation, here's what I did (let me know if you need more detail):
Using VS 2010, build a deployment
package for the project and then
install it on the target machine
(your web server). The following
link will show you how to do this: http://vishaljoshi.blogspot.com/2009/03/web-packaging-installing-web-packages.html
Make sure that your virtual directory in IIS is configured to use .NET 4 (right click on virtual directory > properties > ASP.NET tab > ASP.NET Version)
Configure your virtual directory to support extensionless requests (i.e. your REST API) by creating a wildcard mapping (right click on virtual directory > properties > configuration > mappings tab) with the following properties:
Executable: C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll
Extension: .*
Check that file exists: unchecked
(Note: watch out for the bug that keeps the "OK" button on this dialog grayed out. To get around this just click in the executable textbox after entering your extension and the "OK" button should get enabled).
If you get an authentication error when accessing the service then turn off integrated authentication on the virtual directory. This should fix the problem if you have used the defaults in the generated web.config of your service. If you have explicitly modified the authentication mode then you will have to adapt accordingly.
Have you considered self-hosting your service instead of trying to use IIS. That will probably be easier to do than use IIS.
In case above steps dont work. There could be a problem with permissions on your App pool for that website / virtual directory , you can try to set that right and try it out.
You can refer this article for more help on this.
http://technicalwizardry.blogspot.in/2013/04/wcf-rest-service-hosted-on-iis-5.html#!/2013/04/wcf-rest-service-hosted-on-iis-5.html