1,下载apache-tomcat-6.0.35.tar.gz
2,md5sum apache-tomcat-6.0.35.tar.gz
3,su - root,mv apache-tomcat-6.0.35.tar.gz /usr/share
4,cd /usr/share,tar zxvf apache-tomcat-6.0.35.tar.gz
5,到tomcat的bin目录测试下启动:./startup.sh
6,把tomcat安装成系统服务:
cd /etc/init.d
vi tomcat
- #!/bin/bash
- # description: Tomcat Start Stop Restart
- # processname: tomcat
- # chkconfig: 234 20 80
- JAVA_HOME=/usr/java/jdk1.6.0_30
- export JAVA_HOME
- PATH=$JAVA_HOME/bin:$PATH
- export PATH
- CATALINA_HOME=/usr/share/apache-tomcat-6.0.35
-
- case $1 in
- start)
- sh $CATALINA_HOME/bin/startup.sh
- ;;
- stop)
- sh $CATALINA_HOME/bin/shutdown.sh
- ;;
- restart)
- sh $CATALINA_HOME/bin/shutdown.sh
- sh $CATALINA_HOME/bin/startup.sh
- ;;
- esac
- exit 0
chmod 755 tomcat
chkconfig --add tomcat
chkconfig --level 2345 tomcat on
chkconfig --list tomcat
7,测试下:
service tomcat start
service tomcat restart
service tomcat stop
附:安装mysql5的步骤:
# sudo yum -y install mysql-server
# sudo /etc/rc.d/init.d/mysqld start
# sudo chkconfig mysqld on
# mysql -u root
mysql>
select user,host,password from mysql.user;
mysql>
set password for root@localhost=password('password');
mysql>
set password for root@'127.0.0.1'=password('password');
mysql>
set password for root@''=password('password');
mysql>
delete from mysql.user where user='';
mysql>
select user,host,password from mysql.user;
# mysql -u root -p
输入密码进入即可。
附:安装phpMyAdmin
# sudo yum install phpMyAdmin
# su - root
# cd /usr/share/phpmyadmin/
# cp config.sample.inc.php config.inc.php
# vim config.inc.php
// $cfg['Servers'][$i]['controluser'] = ‘pma’;
// $cfg['Servers'][$i]['controlpass'] = ‘pmapass’;
将“//”注释号删除,同时输入您在 MySQL 中配置的用户名和密码