CentOS+VMware8环境配置

CentOS下载地址:(附件中包含bt种子文件CentOS-6.3..........rar)

http://mirror.lug.udel.edu/pub/centos/6.3/isos/

 

VMware8配置见附件

 

 

centos6.2安装jdk1.6.0_30:

 

1,卸载原来的openJDK:yum -y remove java

2,在oracle官网下载jdk-6u30-linux-i586-rpm.bin

3,复制jdk-6u30-linux-i586-rpm.bin到/usr/目录下

4,cd /usr,然后更改文件权限:chmod +x jdk-6u30-linux-i586-rpm.bin

5,./jdk-6u30-linux-i586-rpm.bin

6,vi /etc/profile,在文件最后面输入:

Config代码 复制代码 收藏代码
  1. JAVA_HOME=/usr/java/jdk1.6.0_30
  2. PATH=$PATH:$JAVA_HOME/bin
  3. CLASSPATH=.:$JAVA_HOME/jre/lib:$JAVA_HOME/lib:$JAVA_HOME/lib/tools.jar
  4. export JAVA_HOME
  5. export PATH
  6. export CLASSPATH

7,更新配置文件:source /etc/profile

8,查看java版本:java -version 或者javac -version

 

centos6.2安装tomcat6和mysql5:

 

1,下载apache-tomcat-6.0.35.tar.gz

2,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

Bash代码 复制代码 收藏代码
  1. #!/bin/bash
  2. # description: Tomcat Start Stop Restart
  3. # processname: tomcat
  4. # chkconfig: 234 20 80
  5. JAVA_HOME=/usr/java/jdk1.6.0_30
  6. export JAVA_HOME
  7. PATH=$JAVA_HOME/bin:$PATH
  8. export PATH
  9. CATALINA_HOME=/usr/share/apache-tomcat-6.0.35
  10. case $1 in
  11. start)
  12. sh $CATALINA_HOME/bin/startup.sh
  13. ;;
  14. stop)
  15. sh $CATALINA_HOME/bin/shutdown.sh
  16. ;;
  17. restart)
  18. sh $CATALINA_HOME/bin/shutdown.sh
  19. sh $CATALINA_HOME/bin/startup.sh
  20. ;;
  21. esac
  22. 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@'www.server.world'=password('password');
mysql>
delete from mysql.user where user='';
mysql>
select user,host,password from mysql.user;
mysql>
exit
# mysql -u root -p
输入密码进入即可。

你可能感兴趣的:(centos)