Hi folks, today I will teach you how to install Apache Tomcat 7 on your Windows 7 machine, but first a little introduction about Tomcat.
Tomcat it's a Java Servlet container, which means that you it to run you that web services that you write in Java. I will teach you how to create a web service in a future post but for now, let's install Tomcat.
First you need to download and install the most recent JDK (Java Development Kit ) here . The installation is very simple, just press next until it's done.
Then you need to download Apache Tomcat here. You need to select under Core the zip suitable for the version of Windows installed on your machine (32 bit or 64 bit).
After you download you need to extract the zip for a location on your computer, I choose "C:\apache-tomcat-7.0.29". Ok, now if you go under \bin you will find two batch files, startup.bat and shutdown.bat, but if you give a try to those scripts you will see that they will not work right of the box.
For Tomcat work you need to set some environment variables in Windows, so let's do it.
First go to Control Panel > System > Advanced System Settings under the tab Advanced (true windows advanced stuff bro) and click the button Environment Variables.
On the System Variables box you need to create two entries, the first with the name CATALINA_HOME and as value you need to put the path to where you extracted Tomcat ( in my case "C:\apache-tomcat-7.0.29"). The second one is called JAVA_HOME and you should set as value the path to your JDK installation (mine is "C:\Program Files\Java\jdk1.7.0_05").
You need then to edit a variable called Path, find it, and click edit. On the value field you will see a lot of stuff, go to the end of the field and insert this info ;%CATALINA_HOME%\bin;%JAVA_HOME%\bin
Hit OK a couple of time and restart your computer, when it's back online go for that startup.bat and give hit a double-kick and you will see the server starting. Go to a browser and access http://localhost:8080 to see if tomcat is running.
That's it my friends, easy as you can see.
Nenhum comentário:
Postar um comentário