How install and configure Tomcat 8 on windows ?

First You may go to http://tomcat.apache.org website.
Click on Tomcat 8.0 link in Download section on the left the website.

01p

Choose zip in Cores section.
02p
When your file is downloading, copy it into any path. I copy it into D disc.
Unzipp it and change name for tomcat8. It will be shorter name.
03p
In this moment your tomcat server is installed. But it is time configure it.

If you want to work in tomcat server you must install java jdk environment. Last version java is in this time java 8. After instalation java set JAVA_HOME and JRE_HOME path.

So go to Start -> Control Panel -> System -> Advanced system settings. Switch to
Advanced tab -> Environment Variables. In System Variables section click the New buton.

In Variable Name field write JAVA_HOME and in Variable Value write your
JDK installed directory. In my it is C:\Program Files\Java\jdk1.8.0

0405Click the OK button.

In System Variables section another time click the New buton.

In Variable Name field write JAVA_JRE and in Variable Value write your
JRE installed directory. In my it is C:\Program Files\Java\jre8

0607Click the OK button.

Check your JDK and JRE settings. Open CMD console and type:

set JAVA_HOME

Type Enter.

08In the same way type in the console:

set JRE_HOME

and type Enter.

09Tomcat configuration files are in conf folder.

10Tomcat has configured TCP port as 8080. You may change it on another between 1024 and 65535. I change it to 9090. Open server.xml file and change port in connector element.

Before change:

11After  change:

12You must either open this port on windows firewall.

So go to Start -> Control Panel -> Windows Firewall. Click on change settings. Switch to Exceptions tab. Click Add port. In the window in Name field write name of port, example: localhost:9090 and in Number of port field write 9090. Select TCP protocol and click the OK button. You see this name on the list. Click OK button in another window.

13If you have installed another firewall you must unblock this port.

In the next step I must configure running default servlets. Open web.xml file and find part with default servlet.

14

Change value in listings parameter from false to true.

15Save this file.

This configuration listings is handy for test.

Open context.xml configuration file and add reloadable atributte with true value. It is handy for test. Changes in code will be automatic reload on the server.

16

 

17And you may add user for manage tomcat server. So open tomcat-users.xml file.

18Uncomment user element and in username write any name and in password write any pass. In role write several roles: manager-status, manager-gui, manager-script. All roles write without space.

<user username=”tomcat” password=”tomcat” roles=”manager-status,manager-script,manager-gui“/>

19Next step you may start tomcat server. Open CMD console and go to the bin folder in tomcat. Mine is D:\tomcat8\bin . Write command startup.

a1

It command start tomcat server.

a2

In browser write address:

http://localhost:9090

If you see this website:

25

Stopping tomcat in console write shutdown.

a3a4