Location of localhost folder in Ubuntu 12.04 - java

I'm running eclipse Juno, with Tomcat 7.0.29. I have some files that are saved to the root of the webapp by my webapp and I want to delete them. I'm trying to find the localhost folder in order to be able to do this. Everything I'm reading tells me it should be at /var/www, however there is not /www directory in var. Where could it be?

Since you're using Eclipse IDE and you don't know where your Tomcat installation folder is, you can find it using the IDE by going to Windows/Preferences. It will pop a Preferences window, select the Server/Runtime Environment option in the left tree, in the right side must appear Apache Tomcat v7.x. Select it from the list and select the Edit... option, it will show you the tomcat installation directory. Let's call this folder <tomcat>
Now you know the folder installation, but maybe Eclipse is not using it to deploy the Java Web applications. To make sure of this, in your Eclipse, go to the Servers view (if it's not visible in the IDE, go to Window/Show view/Servers), it will show you your tomcat server (and others), double click on it. In the Tomcat overview window, check the Server locations panel, expand it and check where the webapp is deployed:
If selected option is Use Tomcat installation then the web app must be in <tomcat>webapps
If selected option is Use workspace metadata then the web app must be in your workspace inside .metadata/.plugins/org.eclipse.wst.server.core/tmp[number]/wtpwebapps (thanks to Lars Vogel blog post). This is a special folder created by Eclipse.

Default tomcat folder is at /var/lib/tomcat7. Your webapps are under /var/lib/tomcat7/webapps
Not sure what localhost folder you are referring to. There is /etc/tomcat7/Catalina/localhost but I dont see a reason why you should be touching it.
This assumes you used standard Ubuntu tools to install tomcat.

Related

Update files on a tomcat server, via Eclipse

I've recently found out how to remotely debug my java files on a Tomcat server via eclipse and was wondering something. I am wondering if I could import the same files into Eclipse that are currently housed in the webapps folder on my tomcat server, and instead of having to go to that filepath anytime I need to make a code change with the files in the tomcat server, be able to make them directly in Eclipse which I would be using to debug anyway.
Currently I've tried importing the same project folder from the webapps folder in Tomcat into Eclipse and made a small code change, relaunched my server, but am not seeing the change in my tomcat library.
When importing into Eclipse does it make it's own separate instance of the files, instead of actually being able to import the same exact files as in the tomcat server?
If you double-click the Tomcat server in the 'Servers' view inside Eclipse, you will see a configuration tab "Server Locations".
By default, eclipse doesn't make changes to the tomcat 'webapps' folder, it uses folders under its workspace.
Changing that option to 'Use tomcat installation' will make the changes be visible from the tomcat/webapps folder on your file system.

Tomcat interrogation with eclipse under linux/mac

I added my local tomcat 8.0.14 with eclipse successfully. My local tomcat is located at /Users/masum/tool/tomcat-8.0.14. I can see it form eclipse runtime Environment as well. Whenever I deploy any webapp to eclipse's tomcat. It doesn't appear in local tomcat-8.0.14/webapps directory. I expected it should go there. But it doesn't.
Also is I do any changes in tomcat/conf/server.xml. These changes doesn't effect in eclipse integrated tomcat. Also if local tomcat is running, port number conflicts with eclipse's tomcat. I have to stop local tomcat to work with eclipse tomcat. Looks like two different instance of tomcat.
My question is where does eclipse tomcat physically located? If I deploy any web app in eclipse tomcat where it actually goes? How can I configure Tomcat so that I can control it both from eclipse and also manually?
Thanks in advance.
Double click your tomcat server in the servers tab. In the servers tab you will see "Server path" under server locations. This is the location of eclipse's tomcat working directory. If you stop tomcat and undeploy all web apps, start and stop again, you will be able to select other options. Click "Use custom location" to set the location to a place of your choosing. In project Explorer you should see a tomcat folder. Under that folder you will find server.xml and the other config files, which you can modify as needed.

Bringing a remote tomcat/mySQL server to localhost Mac

I have a website someone's developing for me on a VPS (Java, javascript, CSS, HTML) that I would like to run on my Macbook Pro.
He commits the source on Github, which I download with Sourcetree.
I have Tomcat 6 and MySQL running on the Macbook fine.
Can I bring the root folder, the mySQL db and an associated media folder over without creating a .war file to run it on tomcat on localhost by simply setting up the connections properly in datanucleus, or is it much more complicated than that?
Thanks in advance for your thoughts.
I know people who try to develop application directly in die Webapp Folder from Tomcat but that is not the right way.
At your place i'll do this:
clone the application locale on your mac
Use an IDE(eclipse/Netbeans/IntelliJ) to open the project
Build a local war file which you can deploy directly to your $CATALINA_HOME/webapp/
Do not forget the make all required mySQL settings (context.xml) and so on...
Yes, you can. But it is necessary to have compiled webapp.
Simply put root folder contents (your deployed application) to "/webapps/ROOT" and start tomcat by running script in "bin" folder.
Make sure that you properly configured database properties of your application.
If you have only sources - it is not such simple. You have to build war and deploy it. Or ask developer to include "target" directory in git repository and then copy "classes" folder to /webapps/ROOT/"

Tomcat server could not start

I am developing a dynamic web application on JBoss developer, but I am getting an error message:
Could not load the Tomcat server configuration at
\Servers\Tomcat v6.0 Server at localhost-config. The Servers project
is closed.
Even when I try to start the server on the servers tab, it doesn't start.
Any suggestions?
Sounds to me as if you're doing this inside Eclipse with WTP?
If so then you need to make sure that the Eclipse project called Servers which is created and maintained by WTP is open.
Open the Navigator view
Locate the Servers project
right-mouse click
Open Project
You have been closed server project in eclipse which will come by default after adding tomcat into eclipse. So try to open server project and start Tomcat it will Work..
Steps:
Go to project explorer.
Double click on server project.
You installed Tomcat v6 within eclipse using the “Add server” wizard and the “download and install” button.
You tried to start Tomcat and got the following error:
****“Could not load the Tomcat server configuration at /Servers/Tomcat v6.0 Server at localhost-config. The configuration may be corrupt or incomplete”****
How to solve:
1) . Close Eclipse
2) . Copy all files from TOMCAT_6_HOME/conf to WORKSPACE_FOLDER/Servers/Tomcat v6.0 Server at localhost-config
3) . Start Eclipse
4) . Expand the Servers project, click on the Tomcat 6 project and hit F5
5) . Start Tomcat from Eclipse
6) . Enjoy!!!
Just after many trying I got the solution for this problem. The problem is when your server is created using your IDE(Eclipse, JBoss or any) that time the server is not getting the configuration file. To resolve this problem you need to copy all the configuration files from the tomcat conf directory to your IDE server directory. If I will step out the solution than I can list the steps as-
Locate your Tomcat installation directory
Find the conf directory, sometime you will get it into skel directory
Copy all the files from conf and now change the directory to your IDE workspace
In Server directory paste all the files in your Tomcat configuration directory.
If you are using a Linux-based Eclipse:
Check user and group ownership and permissions to your server directory and subdirectories inside Eclipse. It MUST allow read-write config files by the current Eclipse user. Test it copying config files directly to it and, after that, accessing it through Eclipse text/xml editor.
It's usefull too to check the same for tomcat directory, because Eclipse may be bloked if its owner doesn't have permissions to access that files.
the solution to this problem is :
cd /usr/local/tomcat//conf
chmod 777 *
and it's done
I got the same issue. This is because it's missing "Servers" folder that contains Tomcat in Project Explorer. I already downloaded and configured my Tomcat, but after I created another new java web project, Server stopped working.
To solve this problem right click on "Tomcat v6.0 Server at localhost
[Strated,Synchronized]"
at bottom of your Eclipse.
click "General"
click "Switch Location"
click "Apply"
enter image description here
This usually happens when the "Close unrelated projects" button is clicked. A simple and straightforward solution to this issue:
Go to the bottom of the Project Explorer tab and there will be a project named "Servers". If it's closed, the icon will have a different color than the projects that are open.
Double-click on "Servers". Now the project will be open and this issue will get resolved.

Java Web Project not building correctly

I've got a Java Web Project which I'm deploying to a Tomcat embedded in Eclipse's Servers Plugin, alas, when I navigate to the location of that webapp after publishing/starting the server, the .class files are all missing. I can navigate as far as ProjectName\WEB-INF\classes\path\to\packages\ -> All packages are empty.
Any Idea how to solve this problem?
Edit
Build Automatically is checked and it compiles just fine for another web project I've just included, just not for the one specified
Edit 2
Reinstalled Eclipse (because why not) - nothing's changed, works for Project #2, doesn't work for Project #1. Not even the path to the packages is existant now. The content of the src folder (that's supposed to be moved to WEB-INF/classes) isn't there at all - but the resources (I've got a resources folder with the same deployment assembly command) are.
A few steps to perform to restore sanity...
Refresh your project. It is possible that something was modified on the file system external to Eclipse.
Kick of Project -> Clean.
Now look at your project (not the deployed location) on the file system. Do you see the expected files in the /bin directory (or whatever you may have changed class output directory to)?
Let's now try exporting a war using the wizard. File -> Export -> Web -> WAR or something like that. Check the WAR contents. Are you .class files there?
If everything is good so far, there is nothing wrong with your project. The Tomcat server adapter just got confused.
In the Servers view... Make sure Tomcat is running. Next right click on Tomcat and select add/remove projects. Remove your project. Confirm that your web app is no longer accessible.
Now re-add your project via add/remove projects or invoke one of the run as actions.
The above should reset Tomcat server adapter and hopefully things should work as expected.
Check if you had deleted or moved your external JARs associated with the project on your IDE. I had moved it and ran into the same issue.

Categories

Resources