IntelliJ IDEA Community Edition
To work with Tomcat, in the Community Edition you will need to install the plugin "Smart Tomcat"
Settings - Plugins - Marketplace
To work you need to download and unpack Tomcat.
In the launch settings you need:
Tomcat server: specify the folder with unpacked Tomcat.
Deployment directory: src/main/webapp
Context path: /
Example
3.1 Loading Tomcat
If for some reason you decide to install Tomcat manually, then you will need more instructions. To get started, again, download Tomcat from the page . But this time we select the zip archive at the very top:
3.2 Installing Tomcat
Installing Tomcat is very simple. After you download the zip file in the previous step, extract its contents to a specific folder. For example, inD:\DevPrograms:
To run Tomcat, you must have JRE 8 or higher installed on your computer. If you have several JREs installed, it is recommended to register one specific one directly in the Tomcat settings.
To do this, open the file startup.bat
in the bin folder in Tomcat (for the Linux/Ubuntu operating system, this will be the startup.sh file) and add a line there with JAVA_HOME
:
3.3 Configuring Tomcat
Next, I recommend setting up tomcat-users , various services will be authorized under them, which will automatically work with Tomcat.
To do this, open the tomcat-users.xml file (Located in the Tomcat 9.0\ conf folder ):
There will already be content like:
Change username
to password
the ones you like. Well, or at least remember the place where you can peep them when you need them. If you change these settings while Tomcat is running, you will need to restart it for them to take effect.
<role rolename="tomcat"/>
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<user username="tomcat" password="111" roles="tomcat, manager-gui, manager-script"/>
3.4 Starting and stopping Tomcat
To start Tomcat, double click on startup.bat (Or startup.sh for Linux/Ubuntu). To stop use the file shutdown.bat
You will see something like this - this is a running Tomcat:
If Tomcat is installed correctly, then at the link http://localhost:8080/ you will see a picture:
GO TO FULL VERSION