Setting Up Tomcat Without Admin PrivilegeThis guide describes how to set up Tomcat on a Linux server under a regular user account (i.e. no root or sudo privilege). It is intended for students who need to run their own Tomcat instances on shared servers like cs3 and csproject. Download and ConfigurationDownload the zip or tar.gz file of the Core Tomcat binary distribution and unzip it under your account. It will create a new directory under your account, e.g. apache-tomcat-7.0.29, and we'll refer to this directory as $TOMCAT. Edit $TOMCAT/conf/server.xml as follows:
<Server port="8005" shutdown="SHUTDOWN">
<Connector port="8080" protocol="HTTP/1.1"
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" /> Edit $TOMCAT/conf/tomcat-users.xml to add a user with the manager-gui role. This will allow you to use the web manager interface to deploy your applications. Start and Stop the ServerTo start the Tomcat server, run the script $TOMCAT/bin/startup.sh, and to stop the server, run $TOMCAT/bin/shutdown.sh. Deploy ApplicationFirst you need to package your application into a WAR file. If you use Eclipse, you can export a Dynamic Web Project into a WAR file. If you use Maven, you can run mvn package (or the equivalent in Eclipse if you use the m2eclipse plugin) which will create a WAR file under the /target folder of the project. Use a browser to go to the address http://<host>:<port>, where <host> is the server address and <port> is the HTTP connector port number you specified in server.xml. Click on Manager App on the page and enter the username and password of the manager-gui user you specified in tomcat-users.xml. In the manager interface you can deploy an application by uploading the WAR file, and after that you should be able to access your application at http://<host>:<port>/<project>/. |