Download Netbeans to your local computer. Be sure to download a version of Netbeans that includes Tomcat. The labs are still using NetBeans 8.2, so that is the one I recommend that you download to your computer. NetBeans is transitioning from Oracle to Apache. For now, we will stay with the last, stable, Oracle release.
If you have already installed Netbeans and did not install the Web version or the full version, then download either of those versions and reinstall. Netbeans will upgrade your current installation.
All web applications that are deployed to my Tomcat server on ocelot must use the secure web.xml file, which only allows access to your web applications to you and me. In order to make it easy to develop locally and deploy remotely, it is necessary to set up your local Tomcat server that Netbeans is using, so that it also restricts access to your web applications.
Before you can edit the tomcat-users file, you must run a web application in NetBeans. Once a web application is run, then Tomcat will create many files and folders, including the tomcat-users file.
Edit the tomcat-users.xml file. This is the file that identifies the users and their roles in Netbeans. Some roles are predefined by Tomcat: manager and admin. These roles give access to the admin and manager applications. Other roles can be created and then used to restrict access to resources. Each user name is assigned various roles.
To edit the tomcat-users.xml file:
You have a copy of tomcat-users.xml in your local directory. You have the ability to edit this file to configure who has access to your web applications.
<role rolename="your-user-name" />
<user | username="your-user-name" |
Refer to this example of a tomcat-users file. Anything between an opening <!-- and --> is a comment.
user
entry for ide
. It is the username that Netbeans uses to manage your web applications.
role
before any user
tags.
Restart tomcat after modifying the tomcat users file. Go to the Services tab, select Servers, Select Tomcat, right-click and choose restart.
Newer versions of NetBeans do not add a web.xml to the web application, automatically. To add a web.xml to your web app, select File -> New File -> Web -> Standard Deployment Descriptor (web.xml)
.
The final step is to use the secure web.xml file for your web appilcation. When you run the application, it will force you to log in, using the tomcat password that I sent to you. Once this is done, you will be able to deploy your web application to ocelot without having to change it.
Don't forget to edit the secure web.xml file and change all occurences of your-user-name with your PantherMail username.