% sudo cp apache-tomcat-5.5.20.tar.gz /usr/bin (do not include %)


17 Νοε 2013 (πριν από 4 χρόνια και 7 μήνες)

110 εμφανίσεις

Downloading apache tomcat:

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
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.

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

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.

You have successfully configured Apache Tomcat!

Configuring Eclipse

Locate the appropriate version of Eclipse on the downloads page:

I will be using the Mac OSX file.

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

The screen should now look like the following:

Installing the Apache Tomcat Plug-in for Eclipse
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)

% 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.

The Tom
cat Base Directory should m
tch the lo
cation specif
ed 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 Tom
cat Manag
r App you will specify
the path of the Tom
cat m
nager and an
appropriate usernam
/password pair for a
ger. NOTE: if you did not create an entry
in the tom
l file f
r a m
nager us
er you can create one via the “Add user to
” button on this page. Al
so be sure to enter the port as 8081.