一、安装JDK
1.安装
wget http://gw.gxkjbg.com:8080/201703/tools/jdk7u79linuxx64.tar.gz
cp dk-7u79-linux-x64.tar.gz /usr/jdk
tar -zxvf jdk-7u79-linux-x64.tar.gz
2.配置环境
在 /etc/profile文件的最后加入
export JAVA_HOME=/usr/jdk/jdk1.7.0_79
export PATH=PATH:/usr/jdk/jdk1.7.0_79/bin
6、在Linux中使用命令 source /etc/profile,使profile配置的文件生效即可。
7、使用java -version查看java版本。
二、安装Tomcat7
1.安装
通过wget命令下载并安装
https://tomcat.apache.org/download-70.cgi
解压apache-tomcat-7.0.103.tar.gz 到当前目录下
tar zxvf apache-tomcat-7.0.103.tar.gz
复制apache-tomcat-7.0.68到上级tomcat目录
cp -r apache-tomcat-7.0.68 ../tomcat
2.配置环境变量
vim /etc/profile
添加环境变量
export TOMCAT_HOME=/usr/local/tomcat
export CATALINA_HOME=/usr/local/tomcat
设置环境变量立即生效
source /etc/profile www.gendan5.com
进入/usr/local/tomcat/bin目录
cd /usr/local/tomcat/bin
查看当前目录下的文件
ls
启动tomcat
./startup.sh
三、安装mysql
1.安装
#cd /etc/yum.repos.d/#sudo vi mysql-community.repo找到mysql-56-community将enable置为0 enable=0
安装yum install mysql-server
重新安装mysql sudo yum install mysql-server
2.重新设置密码
[mysqld]下添加一行,使其登录时跳过权限检查
skip_grant_tables
命令行:
service mysqld start
mysql -u root -p
USE mysql;
UPDATE user SET password=PASSWORD(‘newpasswd’)WHERE user=’root’;
grant all privileges on *.* to 'root'@'%' identified by 'XXXX ' with grant option;
flush privileges;
[mysqld]下删除一行,使其登录时不跳过权限检查(或加#注释)
skip_grant_tables
3.配置新用户及开通远程访问权限
create use 'yw'@'%' identified by 'XXXX ';
grant all privileges on *.* to yw@localhost identified by 'Xeh-123-mysql' with grant option;
grant all privileges on *.* to 'yw'@'%' identified by 'XXX' with grant option;
flush privileges;