Build Tomcat7.0 under Ubuntu12.04

Source: Internet
Author: User
The record of the process for building atat7.0 under Ubuntu12.04. 1. install JAVA environment apt-getupdateapt-getinstallopenjdk-7-jdk to configure JAVA environment variables: vi/etc/environmentJAVA_HOME = JDK directory (usually in =/usr/lib/jvm/jdk1.7.0 _ 04/) CLASSPATH =. :/usr/lib/jvm/jdk1.7.0 _

Set up Tomcat 12.04 in Ubuntu 7.0.

1. Install the JAVA environment
Apt-get update
Apt-get install openjdk-7-jdk

Configure JAVA environment variables:
Vi/etc/environment
JAVA_HOME = JDK directory (usually in =/usr/lib/jvm/jdk1.7.0 _ 04 /)
CLASSPATH =.:/usr/lib/jvm/jdk1.7.0 _ 04/lib

Get Tomcat installation package
Download an official package and unzip it.

# Add a system user tomcat and set it as not logged on to the system.
Useradd-d/tomcat extract directory/tomcat-s/usr/sbin/nologin tomcat
D. Set tomcat's access permissions to the tomcat directory.
Chown-R tomcat. tomcat/tomcat unzip directory/tomcat/

E. Configure Tomcat Environment Variables
Vi/etc/environment
CATALINA_BASE =/tomcat extract directory/tomcat
CATALINA_HOME =/tomcat extract directory/tomcat
TOMCAT_USER = tomcat
Run the following command to make the configuration take effect:
./Etc/environment

F. start tomcat
/Tomcat extract directory/tomcat/bin/startup. sh
Using CATALINA_BASE:/usr/local/webserver/tomcat Using
CATALINA_HOME:/usr/local/webserver/tomcat Using
CATALINA_TMPDIR:/usr/local/webserver/tomcat/temp
Using JRE_HOME:/usr
Using CLASSPATH:/usr/local/webserver/tomcat/bin/bootstrap. jar:/usr/local/webserver/tomcat/bin/tomcat-juli.jar

G. Test
Access http: // ip: 8080/. If you see the default Tomcat interface, it indicates that the operation is successful.

I. Set the Tomcat Administrator Account
Add the following content before the tag
Nano/usr/local/webserver/tomcat/conf/tomcat-users.xml







After saving and disabling, run tomcat again and enter the user name and password set above. Then, log on to the Tomcat Management page.

J. Run tomcat as a daemon
According to official tomcat requirements, jsvc is required for running tomcat as a daemon.
Install jsvc
Cd/usr/local/webserver/tomcat/bin/
Tar xvzf commons-daemon-native.tar.gz
Cd commons-daemon-1.0.5-native-src/unix/./configure
Make cp jsvc ../..
Cd ../..
Run the following command to run tomcat in the daemon
Access http: // ip: 8080/. If you see the default Tomcat interface, it indicates that the operation is successful.
K. Set startup tomcat
This is intended to be set to boot in the daemon mode. Study N for a long time. Use the following method for the time being!
Edit/etc/rc. local and add the Startup Script
Vi/etc/rc. local
/Usr/local/webserver/tomcat/bin/startup. sh
Restart and access http: // ip: 8080/. If you see the default Tomcat interface, it indicates that the operation is successful.

Touch: cannot touch '/root/tomcat/logs/catalina. out': No such file or directory
./Bin/catalina. sh: 389:./bin/catalina. sh: cannot create/root/tomcat/logs/catalina. out: Directory nonexistent

If this occurs, run./etc/environment.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.