2, the establishment of the standalone running environment -- CentOS-6.4 installation and configuration tomcat7

Source: Internet
Author: User

Link.

1. Download Tomcat
cd /usr/local/srcwget http://labs.renren.com/apache-mirror/tomcat/tomcat-7/v7.0.39/bin/apache-tomcat-7.0.39.zip 
Ii. Unzip and install Tomcat
unzip -d /usr/local apache-tomcat-7.0.39.zip

cd /usr/local

mv apache-tomcat-7.0.39/ tomcat1
3. Configure Environment Variables
vi /etc/profile

(1) Add at the end of the file

export JAVA_HOME=/usr/java/jdk1.7.0_17export JRE_HOME=/usr/java/jdk1.7.0_17/jreexport CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jarexport PATH=$PATH:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:$JAVA_HOME/bin

(2)

CD/usr/local/tomcat1/bin

VI Catalina. Sh

#! /Bin/sh

Export tomcat_home =/usr/local/tomcat1

Export catalina_home =/usr/local/tomcat1

 

(3) Use the following command to grant the File Execution permission and make the configuration take effect.

# source /etc/profile

# cd /usr/local/tomcat1/bin

# chmod 777 *.*
4. Configure Tomcat

(1) Add tomcat to start automatically

Echo "Source/etc/profile">/etc/rc. d/rc. Local


Echo "/usr/local/tomcat1/bin/startup. Sh">/etc/rc. d/rc. Local



It should be noted that RC. Local is executed before/etc/profile, so the Java environment variable is not obtained, so you can add the code: Source/etc/profile before startup. Sh.

(2) Let the firewall open the Tomcat port. The last sentence is to save the rule.

# iptables -F# iptables -t nat -I PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8080# iptables -t nat -I OUTPUT -p tcp --dport 80 -j REDIRECT --to-ports 8080# /etc/rc.d/init.d/iptables save
V. Test
# cd /usr/local/tomcat1/bin
# ./startup.sh

 

 

 

 

 

 

Related Article

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.