CentOS上javaweb开发环境搭建
安装jdk
- yum list java*
- yum install java-1.7.0-openjdk* -y
- java -version
安装tomcat
- cd /usr/local
- wgethttps://mc.qcloudimg.com/static/archive/fa66329388f85c08e8d6c12ceb8b2ca3/apache-tomcat-7.0.77.tar.gz(下载tomcat)
- tar -zxf apache-tomcat-7.0.77.tar.gz (解压这个文件夹)
- mv apache-tomcat-7.0.77 /usr/local/tomcat7 (重命名这个文件 )
- cd /usr/local/tomcat7/bin
- chmod 777 *.sh (给这个文件夹下的所有 shell 脚本授予权限)
- ./startup.sh(开启tomcat服务)
安装mysql
- yum install -y mysql-server mysql mysql-devel(安装mysql)
- service mysqld restart(启动服务)
- /usr/bin/mysqladmin -u root password 'root'(设置mysql 账户 root 密码)
如安装mysql时启动服务失败可参照如下文章解决 http://www.cnblogs.com/starof/p/4680083.html