On 11/11/2019 9:33 AM, Emilian Bold wrote:
>> Don't use the distribution's Tomcat. [...] The reason for doing all of this 
>> is quite simply, permissions.
> 
> This is an interesting remark. Couldn't this be fixed by NetBeans by
> simply copying the whole of Tomcat to an user temp folder?
> 
> --emi

There is an option in NetBeans to use a private configuration directory.
I just tried this, since I normally install my own copies of Tomcat.

You specify both the CATALINA_HOME directory (where your Tomcat is
installed), and the CATALINA_BASE directory (where your private
configuration lives).

It seems to copy MOST everything over, based on what RUNNING.txt requires.

Some things that are missing:

$CATALINA_BASE/bin directory with tomcat-juli.jar

$CATALINA_BASE/lib directory

The lib directory is not strictly required, but it would be nice to make
the lib directory since that's where things like the JDBC drivers live.

I don't know how this would work with a distribution's Tomcat. In
general, a distribution's Tomcat scatters components into non-standard
directories. I don't know if NetBeans would pick up where the
distribution places the files.

The original poster could try the following.

1. Create a new directory somewhere in home directory - maybe:

~/private-tomcat7
~/private-tomcat85
~/private-tomcat9

2. Add the Tomcat servers from the Services tab of NetBeans

Specify the appropriate installation directory for Catalina Home
Specify the appropriate target for Catalina Base (see directories above)

3. Once the subdirectories are created, go back into each CATALINA_BASE

3.a. create a bin directory
3.b. copy over the appropriate tomcat-juli.jar file from the distribution
3.c. possibly create and edit a setenv.sh file for extra configurations
3.d possibly create a lib directory to hold JDBC drivers, etc.

That should work. Again, your best chance of getting help with Tomcat
issues on the tomcat-users mailing list is to use an installation from
tomcat.apache.org.

Again, I also don't know if the NetBeans "use private configuration
folder" will work with distribution installations of Tomcat.

. . . just my two cents
/mde/

> 
> On Mon, Nov 11, 2019 at 7:24 PM Mark Eggers
> <its_toas...@yahoo.com.invalid> wrote:
>>
>> On 11/11/2019 8:23 AM, Mark Phillips wrote:
>>> I am running Apache NetBeans IDE 11.2 with Java: 1.8.0_201 on Debian (Linux
>>> version 5.0.0-32-generic running on amd64). I have a tomcat 7.09 server
>>> installed and running. I can deploy war files from the tomcat manager app
>>> and I can see the tomcat log files in the Netbeans app. However, I cannot
>>> find a way to associate the tomcat server with my Netbeans project. Tomcat
>>> shows up in the list of servers, and I can start and stop it from Netbeans
>>> Services tab.
>>>
>>> The project says I am missing a server association, but when I click on
>>> Resolve Missing Server the resulting dialog does not have my tomcat 7
>>> server listed. I have tried removing my tomcat installation from Netbeans
>>> and adding it from the Resolve Missing Server dialog, but I still cannot
>>> deploy directly from Netbeans because, you guessed it, I have a Missing
>>> Server Problem! I have also restarted Netbeans to no avail.
>>>
>>> I have fiddled with permissions for the tomcat7 installation to the point
>>> of chmod 755 for the whole directory (this is my development laptop and I
>>> only run instances locally), and that has not helped. Tomcat is installed
>>> in /var/lib/tomcat7. The user and group is tomcat7. Tomcat 7 should work
>>> with JDK 1.8, as it is certified for Java 6 and above.
>>>
>>> I also have issues with installing two tomcat servers - still can't deploy
>>> not does the project recognize any of them. I installed tomcat 9 in
>>> /var/lib/tomcat9 with user and group tomcat9.
>>>
>>> What I dream of is two tomcat instances, one tomcat 7 and the other tomcat
>>> 9, and the ability to deploy from Netbeans to test my project with both
>>> servers. How can I do that, or is that not possible? How do I get at least
>>> one server running so I can deploy from Netbeans?
>>>
>>> Thanks!
>>>
>>> Mark
>>>
>>
>> I'm using NetBeans 11.1, but it should be the same for 11.2.
>>
>> Don't use the distribution's Tomcat. Instead, do the following:
>>
>> 1. Download the latest versions (I use 9, 8.5, and 7) from
>> tomcat.apache.org.
>>
>> 2. Create a top level directory for convenience in your home directory.
>> I use ~/Apache
>>
>> 3. Copy the .tar.gz files for the various Tomcats into that directory
>>
>> 4. Unpack the .tar.gz files
>>
>> You should now have directories apache-tomcat-7.0.x,
>> apache-tomcat-8.5.x, and apache-tomcat-9.0.x.
>>
>> 5. In each apache-tomcat-x.y.z directory, you should find a conf folder
>>
>> 6. In the conf folder, you will find tomcat-users.xml
>>
>> 7. Edit tomcat-users.xml per instructions found in the comments of that
>> file.
>>
>> You will want a manager-script role / user so that NetBeans can control
>> the server.
>>
>> 8. When you add the server to NetBeans, use the same user name and
>> password created in step 7.
>>
>> The reason for doing all of this is quite simply, permissions. NetBeans
>> deploys WAR files to Tomcat by copying a context.xml file to
>> $CATALINA_BASE/conf/Catalina/localhost/app.xml.
>>
>> The contents of that app.xml file contain the actual location of the web
>> application (it's not copied over to the Tomcat distribution), as well
>> as the context path served by Tomcat.
>>
>> If you don't have write permissions to
>> $CATALINA_BASE/conf/Catalina/localhost, then the deploy / undeploy will
>> not work.
>>
>> I normally only run one Tomcat instance at a time on my development
>> systems. However, if you want to run more than one Tomcat instance,
>> you'll have to edit $CATALINA_BASE/conf/server.xml and change at least
>> the shutdown port and HTTP/1.1 ports to be unique across all Tomcat
>> instances.
>>
>> This setup is quite nice, in that I have full access to the Tomcat
>> installation with my user account. I can add jars to $CATALINA_BASE/lib
>> (for example, JDBC jars), and add environment settings to
>> $CATALINA_BASE/bin/setenv.sh.
>>
>> Finally, if you get stuck on a Tomcat-related issue, you're more likely
>> to get help on the Tomcat mailing list if you've installed the latest
>> version of Tomcat from tomcat.apache.org rather than use a distribution
>> version. It's not that distribution versions are necessarily bad, it's
>> just that each distribution does things differently. Apache Tomcat from
>> tomcat.apache.org is set up the same way regardless of OS (OK - .sh
>> versus .bat files not withstanding).
>>
>> . . . just my two cents
>> /mde/
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@netbeans.apache.org
> For additional commands, e-mail: users-h...@netbeans.apache.org
> 
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
> 


Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to