Downloading apache tomcatbi/eclipse/setting-up-eclipse-for...Next, unarchive the contents of the...

6
Downloading apache tomcat: http://apache.edgescape.com/tomcat/tomcat-5/v5.5.20/bin/apache-tomcat- 5.5.20.tar.gz Save the file to the desktop and copy into the /usr/bin directory The command from the terminal is: % sudo cp apache-tomcat-5.5.20.tar.gz /usr/bin (do not include %) Provided that you are in the directory containing the file. Next, unarchive the contents of the archive file: % cd /usr/local % sudo gnutar –xzvf apache-tomcat-5.5.20.tar.gz You should now be able to access the apache tomcat folder % cd apache-tomcat-5.5.20 To start Tomcat use the following code segment: % sudo /usr/local/apache-tomcat-5.5.20/bin/startup.sh and likewise to stop Tomcat: % sudo /usr/local/apache-tomcat-5.5.20/bin/shutdown.sh When you access http://localhost:8080 you should see the following screen: Now, we would like to configure the default access port to be 8081 instead of 8080 because the University of Scranton blocks incoming traffic on the 8080 port.

Transcript of Downloading apache tomcatbi/eclipse/setting-up-eclipse-for...Next, unarchive the contents of the...

Page 1: Downloading apache tomcatbi/eclipse/setting-up-eclipse-for...Next, unarchive the contents of the archive file: % cd /usr/local % sudo gnutar –xzvf apache-tomcat-5.5.20.tar.gz You

Downloading apache tomcat: http://apache.edgescape.com/tomcat/tomcat-5/v5.5.20/bin/apache-tomcat-5.5.20.tar.gz Save the file to the desktop and copy into the /usr/bin directory The command from the terminal is: % sudo cp apache-tomcat-5.5.20.tar.gz /usr/bin (do not include %) Provided that you are in the directory containing the file. Next, unarchive the contents of the archive file: % cd /usr/local % sudo gnutar –xzvf apache-tomcat-5.5.20.tar.gz You should now be able to access the apache tomcat folder % cd apache-tomcat-5.5.20 To start Tomcat use the following code segment: % sudo /usr/local/apache-tomcat-5.5.20/bin/startup.sh and likewise to stop Tomcat: % sudo /usr/local/apache-tomcat-5.5.20/bin/shutdown.sh When you access http://localhost:8080 you should see the following screen:

Now, we would like to configure the default access port to be 8081 instead of 8080 because the University of Scranton blocks incoming traffic on the 8080 port.

Page 2: Downloading apache tomcatbi/eclipse/setting-up-eclipse-for...Next, unarchive the contents of the archive file: % cd /usr/local % sudo gnutar –xzvf apache-tomcat-5.5.20.tar.gz You

Open the server.xml file in a file editor, I will use the VI editor: % cd /usr/local/apache-tomcat-5.5.20/conf/ % sudo vi server.xml In the following code segment we need to change the port from 8080 to 8081 (note the / character followed by a query string allows you to search the document for a string: <!-- Define a non-SSL HTTP/1.1 Connector on port 8080 --> <Connector port="8080" maxHttpHeaderSize="8192" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" enableLookups="false" redirectPort="8443" acceptCount="100" connectionTimeout="20000" disableUploadTimeout="true" /> <!-- Note : To disable connection timeouts, set connectionTimeout value to 0 --> Now you should be able to access the Tomcat Homepage via http://localhost:8081. If you would like to enable the feature that displays the directory structures you must modify the web.xml file located in the conf folder. % sudo vi web.xml In the following code we must turn on the listing feature by changing the parameter value from false to true. <servlet> <servlet-name>default</servlet-name> <servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class> <init-param> <param-name>debug</param-name> <param-value>0</param-value> </init-param> <init-param> <param-name>listings</param-name> <param-value>true</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> You have successfully configured Apache Tomcat!

Configuring Eclipse

Page 3: Downloading apache tomcatbi/eclipse/setting-up-eclipse-for...Next, unarchive the contents of the archive file: % cd /usr/local % sudo gnutar –xzvf apache-tomcat-5.5.20.tar.gz You

Locate the appropriate version of Eclipse on the downloads page: http://www.eclipse.org/downloads/ I will be using the Mac OSX file. http://www.eclipse.org/downloads/download.php?file=/eclipse/downloads/drops/R-3.2.1-200609210945/eclipse-SDK-3.2.1-macosx-carbon.tar.gz&url=http://mirror.uta.edu/eclipse/eclipse/downloads/drops/R-3.2.1-200609210945/eclipse-SDK-3.2.1-macosx-carbon.tar.gz&mirror_id=329. Move the archived file to the /usr/local folder: % sudo mv eclipse-SDK-3.2.1-macosx-carbon.tar.gz /usr/local/ Next, unarchive the file % sudo gnutar -xzvf eclipse-SDK-3.2.1-macosx-carbon.tar.gz Finally, run eclipse: You will be prompted for the workspace. It is not very important where the workspace is

You will now be brought into the Eclipse IDE. Note: the first time you enter Eclipse you will be brought to a different splash screen that you will just close

Page 4: Downloading apache tomcatbi/eclipse/setting-up-eclipse-for...Next, unarchive the contents of the archive file: % cd /usr/local % sudo gnutar –xzvf apache-tomcat-5.5.20.tar.gz You

The screen should now look like the following:

Installing the Apache Tomcat Plug-in for Eclipse

Page 5: Downloading apache tomcatbi/eclipse/setting-up-eclipse-for...Next, unarchive the contents of the archive file: % cd /usr/local % sudo gnutar –xzvf apache-tomcat-5.5.20.tar.gz You

To install the Tomcat Plugin download the following file into the /eclipse/plugins directory and unarchive: (I downloaded to the desktop first and then moved the file) http://www.sysdeo.com/sysdeo/content/download/678/7757/file/tomcatPluginV32beta3.zip % sudo mv tomcatPluginV32beta3.zip /usr/local/eclipse/plugins % cd /usr/local/eclipse/plugins % sudo unzip tomcatPluginV32beta3.zip Quit Eclipse and restart. When Eclipse is restarted it should show an additional menu item for Tomcat.

Configuring the Apache Tomcat Plug-in for Eclipse In the Preferences Menu (Eclipse Preferences) Select the Tomcat option.

When you enter the home directory for Tomcat it will copy into the bottom form. Please select the “Server.xml” radio button on the bottom form.

Page 6: Downloading apache tomcatbi/eclipse/setting-up-eclipse-for...Next, unarchive the contents of the archive file: % cd /usr/local % sudo gnutar –xzvf apache-tomcat-5.5.20.tar.gz You

The Tomcat Base Directory should match the location specified in the last step. Also the Security Manager feature should be selected. In the JVM Settings either JVM 1.5 or 1.5.0 should be selected.

In the Tomcat Manager App you will specify the path of the Tomcat manager and an appropriate username/password pair for a manager. NOTE: if you did not create an entry in the tomcat-users.xml file for a manager user you can create one via the “Add user to tomcat-users.xml” button on this page. Also be sure to enter the port as 8081.