How to add context to the tomcat 8 configuration for java web application - war

I have deployed a Java Web application wbs.war in tomcat 8 and the application name is wbs. now when i enter http://localhost:8080 tomcat home page is coming but my requirement is user should see my application home page when he enters http://localhost:8080. is there way to append /wbs/ to the tomcat url so the url looks like http://localhost:8080/wbs/ by default?

Deploy your war as wbs.war and configure the context root in conf/server.xml to use your war file:
<Context path="" docBase="wbs.war" debug="0" reloadable="true"></Context>
Please remove default ROOT.war and ROOT folder from webapps(folder)

Related

IIS 8.5 application folder URL error

I have IIS 8.5 and under Sites > Default Web Site i have application folder Test. When i put my deployed application in that Test folder and enter localhost/Test in browser i am redirected to localhost/Test/Test and i get error. How can i prevent this extra /Test in my link to happen? Is that somewhere in IIS setting or is it application related (it's asp.net MVC 3/4 application).
When i put deployed application in Default Web Site root folder everything works fine but i need to have it in extra folder.

Publish website via Web Deploy

I am publishing a MVC website using web deploy. the Publish succeeds but the website never loads. I think it might be the url I have given it. I am using Windows Server 2012. This is an internal server for testing. But the URL I have used in IIS config and web config is a made up url that is not registered. i.e. logman.com. Am I doing this wrong? Since it will only run on our network, should I use some ip address instead? How should I configure this?
edit * with some new settings i am using an ip adress from the Edit Bindings menu. Not giving it a host name;
here are the results from visual studio:
`2>Start Web Deploy Publish the Application/package to https://myserver/msdeploy.axd?site=lmsmobile.com ...
2>Adding ACL's for path (lmsmobile.com)
2>Adding ACL's for path (lmsmobile.com)
2>Updating file (lmsmobile.com\bin\LMSMobile.dll).
2>Updating file (lmsmobile.com\bin\LMSMobile.pdb).
2>Updating file (lmsmobile.com\Views\Web.config).
2>Updating file (lmsmobile.com\Web.config).
2>Adding ACL's for path (lmsmobile.com)
2>Adding ACL's for path (lmsmobile.com)
2>Publish Succeeded.
2>Site was published successfully http://10.58.158.75/
Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped
Publish: 1 succeeded, 0 failed, 0 skipped`
These are my publish settings:
`<?xml version="1.0" encoding="utf-8"?>
<publishData>
<publishProfile
publishUrl="https://myserver:8172/msdeploy.axd"
msdeploySite="lmsmobile.com"
destinationAppUrl="http://10.58.158.75:80/"
mySQLDBConnectionString=""
SQLServerDBConnectionString=""
profileName="Default Settings"
publishMethod="MSDeploy"
userName="MYSERVERNAME\myusername" />
</publishData>`
Currently when i navigate to the ip adress I get the IIS 8 Web page. Still can't see my site.
Edit 2:
I got past the IIS page by entering the IP address and refreshing the page (shift + refresh). I get a 403 forbidden. I changed the Directory browser settings in IIS to enable and when i refresh I get the directory listing of the folder where my site exists. Still no website. Set directory browsing to disable I get 403.
internally for testing I would consider using an ip address. To get the dns domain name to resolve correctly it would need to be added to your internal dns server to point at your web server.
Multiple web sites can be run for different phases of development by using the same ip address and when the site is created assign to a 4 digit port number like 192.168.100.201:8090.
This would need to be configured as part of the bindings for the web site when configured for IIS.

after changing to port 80 I cannot access tomcat home page

I need to access tomcat web manager, but how to do it if server_ip:8080 is no longer valid?
application is deployed as root, so I get to my application when trying server_ip:80
Do not run a server as root. Use Commons Deamon or Apache Web Server with mod_proxy.

How to define context path of context.xml in web application in Tomcat 6?

Can anyone suggest to me where I have to put the context path in a Tomcat server? Do I have to put it in context.xml or do I have to create a new .xml inside this apache-tomcat-6.0.18\conf\Catalina\localhost?
When I type the URL http://localhost:9796/ this should redirect me to the login page. But I am getting 404 exception. Any suggestions would be really helpful.
You can define the context root information in Server.xml, for all the web modules(WAR) deployed in a server.
If you are deploying the application directly from the tomcat server
by copying the WAR directly into webapps folder you can add the
context's information in server.xml.
If you are deploying the app in
Eclipse then you need to create a context.xml in the META-INF folder
and add the entry like below
<Context crossContext="true" docBase="{urModuleName}" path="/{URL}"
reloadable="true">

Http Module & Http Handler is not firing when it is under a virtual directory of a ASP.NET website

Problem: There is a website(localhost:85) configure to C:\abc. I have created a seperate website which has HttpModule and HttpHandler in it. This new website should not be in the main application(C:\abc). So I have put a seperate folder like D:\xyz. And configured a virtual directory under port 85.
Using ISAPI filter whenever related to xyz application request comes, i am mapping the url to \xyz\URIRequest.aspx?RequestURL=ActualQuerystring.
Issue is the request is reaching the XYZ application Global.asax Application_start(). But it is not going through the pipeline(running httpmodule and httphandler).
If i configure this XYZ application as a seperate website or creating virtual directory under website with no web.config in it. The application works fine.
Solution tried:
Moved the web.config entry of xyz application to Abc application web.config and copy pasted the xyz application dlls to ABC/bin directory.
Have you marked the virtual directory as an application? i.e. does it have a cog in IIS? This is the usual problem when a sub-folder doesn't execute as intended.
That's the way virtual directories work in IIS when it comes to web.configs, they are "inherited" from the app above the virtual directory, all the way up to the machine.config in the "windows\Microsoft.NET\etc..." folder.

Resources