jboss server root folder - jboss

how can i find which folder is the jboss root dir?
where can i find the root folder variable mentioned in a war file

IF you are looking for root folder that is right option. It would be
/opt/jboss/jboss-as
But if you want to access anything (xml, file) at root directory say using 'http://ip:port/abc.xml' url you want to open abc.xml or any file, put that file in
/opt/jboss/jboss-as/server/default/deploy/jboss-web.deployer/ROOT.war

The root folder of a JBoss AS installation is generally considered to be the ../jboss-as folder...
For example if your deploy folder would be
/opt/jboss/jboss-as/server/default/deploy
the root folder would be
/opt/jboss/jboss-as
I don't know what you mean by the variable mentioned in a .war file.

Somehow the maven-war-plugin , can solve this issue very easily. If web.xml context-root didn't work the plugin could move the application to the root of deployments on tomcat. Everything that isn't captured by a more specialized service is delegated to the application from web root /* to the web-app, :)
source : https://developers.openshift.com/servers/jbossas/deployment-options.html

Related

How to include public_html sibling folder in a PhpStorm project?

I have the following site directory structure (on a shared hosting):
/home/username/
public_html/
index.html
resources/
config.php
I am trying to set up a new project using the remote deployment in PhpStorm. I'd like to have both public_html and resources folders accessible, since both contain PHP files. I am confused by what should be the Project Root. Logic suggests that my project root is the top level directory containing all my files, i.e. /home/username/.
However if I mark it such in PhpStorm, the next screen (Specify Web Path) automatically maps my web root folder to the project root.
As the result, if I run /home/username/public_html/index.html from PhpStorm, it tries browsing to https://webroot/public_html/index.html. This is wrong. The web root should be mapped to /home/username/public_html. Actually, the very question ("Web path for project root '/home/username'") is invalid, since there is no web path to folders above public_html, that's the whole point of putting resources there. How should I properly configure folders in PhpStorm?
Such setup is definitely possible -- its very common to have website root folder as a sub-folder of the actual project.
As far as I'm aware it is not possible to create such setup right from New Project Wizard -- it has to be done at later stage when project creation was completed.
You need to go into Settings/Preferences | Build, Execution, Deployment | Deployment and add new mapping. Here is an example:
Here my website root is located in web folder -- you will have to change that to yours public_html. This way when you use Open in Browser on file inside your web root folder it will be opened with correct URL.

Deploying GWT in localhost and see that webpage

I am a new user in GWT and I want to deploy one of existed samples in my localhost. I could run the example by eclipse and get the result. But I need to deploy that example in my localhost (IIS). How can I do this?
Copy the contents of your project's war directory to your server's document root. You could create a folder there, mproject for example. Then load your project on a web browser: localhost/mproject to view.
Go into your project's war directory For EX:
C:\workspace\HelloWorld\war
Select all the files & folders available inside war directory.
Zip all the selected files & folders in a file called HelloWorld.zip.
Rename HelloWorld.zip to HelloWorld.war.
Deploy it to the server

Eclipse WebContent directory deployment in tomcat

In Eclipse, the folder structure when I create a Dynamic Web Project is
[srikanth#hana Sample]$ ls -R
.:
build src WebContent
./build:
classes
./build/classes:
./src:
./WebContent:
index.html META-INF scripts WEB-INF
./WebContent/META-INF:
MANIFEST.MF
./WebContent/scripts:
jquery-1.7.1.js
./WebContent/WEB-INF:
lib web.xml
./WebContent/WEB-INF/lib:
As you can see, there is this WebContent directory, When I copy the directory structure from Eclipse workspace and put in webapps directory of Tomcat, it didn't work. But, if I moved all the directories and files under WebContent directory a level above, it worked fine.
This is the folder structure in Tomcat's webapps directory under application:
[srikanth#hana Sample]$ ls -R
.:
build index.html META-INF scripts src WEB-INF
./build:
classes
./build/classes:
./META-INF:
MANIFEST.MF
./scripts:
jquery-1.7.1.js
./src:
./WEB-INF:
lib web.xml
./WEB-INF/lib:
So, now I can just go to http://localhost:8080/Sample and can go to index.html properly
What am I doing wrong? Why didn't it work just copying the application
from Eclipse to tomcat webapps directory directly? Why do I have to
change the directory structure?
I had the same problem, ./WebContent/index.html not appearing in the Eclipse-exported .war. This occurred on my new Eclipse system after I recreated a working project from my old system with Kepler Eclipse to a new system with Luna Eclipse.
I fixed this by going to Project / Properties / Deployment Assembly. I discovered that the old working system had this rule, while my new non-working systems was missing this rule ...
Source = /WebContent
Deploy Path = /
I corrected this on the new system by Pressing "Add..." and adding the missing rule.
Eclipse allows deploying the webapp directly to a server, without needing to copy anything by yourself. It also allows generating a deployable war file when you're ready to deploy to a test or production server.
Open the "Servers" view, right-click, and choose to create a new server. Once created, right-click on the server and choose to add your web-app into it. And then Eclipse will deploy your web-app to the server.
You're not supposed to manually copy anything from Eclipse. And if you need or want to do this, then you should probably use some ant script which generates the proper deployment structure. This structure is described in the servlet specification. It should have, under the root directory of the webapp, a WEB-INF directory containing:
classes: a directory containing your classes
lib: a directory containing all the jar files your app depends on
web.xml the webapp's deployment descriptor
All the other directories and files that are not under WEB-INF can be served by the web container.
When I copy the directory structure from Eclipse workspace and put in
webapps directory of Tomcat, it didn't work. But, if I moved all the
directories and files under WebContent directory a level above, it
worked fine
Not sure what you mean if I moved all the directories and files under WebContent directory a level above, it worked fine here and what you mean by saying a level above.
What you should be doing is not copy anything manually but right-click on the project and select Export as WAR option.
This will create a file named Project.war that contains the proper file structure i.e. WEB-INF etc that you are supposed to put under tomcat's webapps dir

Problem with paths when deploying my web app

I am having big issues deploying my web app to Tomcat 5.5
My server side code must access files found under a directory parallel to my WEB-INF folder.
When on developement mode, a simple relative path (mydirectory/myfile) works prefectly.
When deployed, the sayed path does not work anymore I dont know why.
Is there a way to make it work without using any absolute path?
Here is my War directory
War
WEB-INF
Mydirectory
Myfile
Mywebbapp.html
Obtain your root folder relative to contextRoot by calling javax.servlet.ServletContext.getRealPath("/"). Then proceed with this path...
Using relative path will work, but you need to be aware of what the containers considers to be the root directory and base your relative path from there. If you specify your directory structure better, I can help you with the path - Basically try using the .. operator to move from the container root to the needed directory

How to get a welcome page from Tomcat root, rather than webapp context?

In Tomcat 7, I want my welcome page (index.html) to load when I access localhost:8080/. Right now, I have to go to the webapp context, localhost:8080/MyWebApp.
Is there a folder in Tomcat to place pages that are not part of a webapp? I'm confused how this works...
EDIT: I notice that the web.xml for the Server in Eclipse has a servlet called "default" which is mapped to "/"... I wonder if I have to change something here?
EDIT2: I found this: http://wiki.apache.org/tomcat/HowTo#How_do_I_override_the_default_home_page_loaded_by_Tomcat.3F
But, I already have an index.html in my ROOT folder, and still getting 404 from the root URL. If I start the server without using Eclipse, it works. What's going on here? What exactly does Eclipse do when you start the server through it? Obviously it's not reproducing the ROOT folder of my installation.
You are missing ROOT folder from 'webapps' - maybe it was deleted during installation of the other app. ROOT folder has config files for 'Welcome' page for tomcat. You can copy it from the other tar file into ../webapps folder and you'll be good.
In Apache Tomcat, all websites are deployed as individual web applications. You can verify this with the Tomcat configuration manager, where you are able to start/stop/reload certain web applications.
I believe you would like to place the welcome page in path tomcat/webapps/index.html - all files located here not in a webapp of subfolders should be viewable as the root of the url.
It's only anything above webapps in tomcat that's protected from web browsing. maybe you can try putting the file in index.html, and setup a link preceded by ../ to indicate "go a directory level above in the tree" to fetch this required file, or try listing the directory of the url root to see in which context you're in actually.
Hope this helps clarify something at least.
Solved!
http://wiki.eclipse.org/WTP_Tomcat_FAQ#If_I_start_my_Tomcat_server_and_try_to_display_Tomcat.27s_default_page.2C_why_do_I_see_a_directory_listing_or_404_error_page.3F