카테고리 없음
centos 에 tomcat7 설치
[czar]
2011. 7. 11. 15:04
http://www.tech-problems.com/install-tomcat-7-on-fedoracentos/
Find and copy download link from here: http://www.oracle.com/technetwork/java/javase/downloads/jdk-6u25-download-346242.html
2 |
mv jdk-6u25-linux-x64.bin* /opt/jdk-6u25-linux-x64.bin |
5 |
sh /opt/jdk-6u25-linux-x64.bin |
1 |
JAVA_HOME=/usr/java/jdk1.6.0_25 |
3 |
PATH=$JAVA_HOME/bin:$PATH |
5 |
vi /etc/profile.d/java.sh |
Add to file
1 |
JAVA_HOME=/usr/java/jdk1.6.0_25 |
3 |
PATH=$JAVA_HOME/bin:$PATH |
Save and exit using :x
1 |
chmod +x /etc/profile.d/java.sh |
Should display /usr/java/jdk1.6.0_25
Find the latest download link here for the Core Tar file http://tomcat.apache.org/download-70.cgi
3 |
mv apache-tomcat-7.0.12. tar .gz /usr/share/apache-tomcat-7.0.12. tar .gz |
5 |
tar -xzf apache-tomcat-7.0.12. tar .gz |
In this new file copy the following:
05 |
JAVA_HOME=/usr/java/jdk1.6.0_25 |
07 |
PATH=$JAVA_HOME/bin:$PATH |
09 |
CATALINA_HOME=/usr/share/apache-tomcat-7.0.12 |
13 |
sh $CATALINA_HOME/bin/startup.sh |
16 |
sh $CATALINA_HOME/bin/ shutdown .sh |
19 |
sh $CATALINA_HOME/bin/ shutdown .sh |
20 |
sh $CATALINA_HOME/bin/startup.sh |
Save this and run the following command
3 |
chkconfig --level 234 tomcat on |
You can now start, stop and restart tomcat using:
Allowing Port 80 through firewall and redirecting 8080 to port 80
1 |
/sbin/iptables -I INPUT 1 -p tcp --dport 8080 -j ACCEPT |
2 |
/sbin/iptables -I INPUT 1 -p tcp --dport 80 -j ACCEPT |
3 |
iptables -t nat -A PREROUTING -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 8080 |
4 |
iptables -t nat -A PREROUTING -p udp -m udp --dport 80 -j REDIRECT --to-ports 8080 |
5 |
/sbin/service iptables save |
6 |
service iptables restart |
1 |
vi /usr/share/apache-tomcat-7.0.12/conf/tomcat- users .xml |
2 |
<role rolename= "manager-gui" > |
3 |
<user username= "tomcat" password= "s3cret" roles= "manager-gui" > |