1、安装rz,sz以便于上传和下载文件
- yum install -y lrzsz
2、安装java环境 -- jdk1.8
- 官网下载jdk1.8:http://www.oracle.com/technetwork/java/javase/downloads/index.html
- mkdir /usr/java/
- 用rz命令将 jdk-8u144-linux-x64.tar.gz 文件上传到该目录下
- tar -zxvf jdk-8u144-linux-x64.tar.gz
- vim /etc/profile 最后一行加入
export JAVA_HOME=/usr/java/jdk1.8.0_144
export PATH=$JAVA_HOME/bin:$PATHexport CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar- source /etc/profile
- java -version 检查一下是否安装成功
3、安装mysql
- 检测系统中是否自带:rpm -qa | grep mysql
- 如果有,强力删除mysqlrpm -ev --nodeps mysql-libs-5.1.73-8.el6_8.x86_64rpm -ev --nodeps mysql-devel-5.1.73-8.el6_8.x86_64rpm -ev --nodeps mysql-server-5.1.73-8.el6_8.x86_64rpm -ev --nodeps mysql-client-5.1.73-8.el6_8.x86_64rpm -e --nodeps mysql
- 去mysql官网下载tar文件:https://downloads.mysql.com/archives/community/
mysql-5.7.13-linux-glibc2.5-x86_64.tar.gz
- 安装mysql:http://www.cnblogs.com/bookwed/p/5896619.html
-
(1)解压:
tar
-zxvf mysql-5.6.33-linux-glibc2.5-x86_64.
tar
.gz
(2)复制解压后的mysql目录:
cp
-r mysql-5.6.33-linux-glibc2.5-x86_64
/usr/local/mysql
#添加用户组groupadd mysql#添加用户mysql 到用户组mysqluseradd -g mysql mysql#进入mysql目录,授权chown -R mysql:mysql ./
.
/scripts/mysql_install_db
--user=mysql --datadir=
/usr/local/mysql/data/mysql
(4)配置文件: cp
support-files
/mysql
.server
/etc/init
.d
/mysqld
chmod
755
/etc/init
.d
/mysqld
cp
support-files
/my-default
.cnf
/etc/my
.cnf
(5)修改启动脚本:
vi
/etc/init
.d
/mysqld
修改项:
basedir=
/usr/local/mysql/
datadir=
/usr/local/mysql/data/mysql
(6)加入环境变量:export
PATH=$PATH:
/usr/local/mysql/bin
(7)生效环境变量:source
/etc/profile
- 验证是否安装成功:mysqladmin --version
- 启动: service mysqld start
- 修改初始密码:mysqladmin -u root password "123456"
- 进入mysql:mysql -u root -p
- 授权远程连接:GRANT ALL PRIVILEGES ON *.* TO ‘root’@'%’ IDENTIFIED BY ‘123456’ WITH GRANT OPTION;
- 【坑】如果是阿里云服务器,远程连接时记得配置安全组,开启3306端口
4、安装Redis
- 去Redis官网下载tar文件:https://redis.io/download
- tar -zxzf redis-4.0.1.tar.gzcd redis-4.0.1make
- make完后 redis-4.0.1/src目录下会出现redis-server和redis-cli
- 编辑redis.conf,使其能够后台启动,远程访问后台启动:daemonize no 改成 damonize yes远程访问:(1)bind 127.0.0.1 注释掉(2)protected-mode yes 改成 no(3)requirepassword jli342i2 注释掉
- 进入src,启动redis:./redis-server ../redis.conf
- 【坑】如果是阿里云服务器,远程连接时记得配置安全组,开启6379端口
5、安装nginx
- 安装步骤可完全参考: