1:上传解压jdk,也可以使用
解压
tar -xzvf ************.tar.gz
或者
sudo apt-get install oracle-java8-installer
找到安装位置
然后配置环境变量
sudo vi /etc/profile 输入 JAVA_HOME=/opt/jdk1.8.0_141 PATH=$PATH:$JAVA_HOME/bin CLASSPATH=$JAVA_HOME/lib/ export PATH JAVA_HOME CLASSPATH 刷新文件 sudo source /etc/profile 使用java -version测试
2:安装redis
sudo apt-get install redis-server 查看安装位置 sudo whereis redis 找到redis.conf 进行修改 sudo vi redis.conf
3: 安装mysql
sudo apt-get install mysql-server 如果不知道密码 1 打开文件使用这个用户登陆 sudo cat /etc/mysql/debian.cnf host = localhost user = debian-sys-maint password = ************ 2 创建用户,使用这个用户进行链接 create user 'user'@'localhost' IDENTIFIED BY 'passward' 3 查看用户权限 SHOW GRANTS FOR 'user'@'localhost'; 4 授权命令(如果使用该命令不能执行成功,请问度娘,该命令与版本有关系): grant all privileges on *.* to 'user'@'localhost'; 关于授权命令有多种,指定操作权限 grant select,insert,update,delete,create on *.* to 'user'@'localhost'; 创建远程链接用户,也可修改用户 create user 'user'@'%' identified by 'password' 查看用户(use mysql) select host,user from user; 可以看到用户和host数据,host为localhost的时候该用户只能在本机访问, 如果需要远程连接则需要将localhost修改为%,或者添加一个远程用户 create user 'user'@'%' identified by 'password' 刷新 mysql> flush privileges; 修改密码使用update、set mysqladmin 等命令都不能执行,经过测试使用: alter user 'root'@'localhost' identified by '123'; 成功,然后刷新 、退出(quit) 登陆mysql 使用 sudo mysql -u root -p 如下: user@user:$ sudo mysql -u root -p [sudo] password for user: 系统user密码 Enter password: mysql root 密码 Welcome to the MySQL monitor. Commands end with ; mysql> 注:涉及到修改命令的需要使用 mysql -u user -p 进行登陆,不然命令大多都会执行错
mysql> use mysql Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed mysql> select user,host from user -> ; +------------------+-----------+ | user | host | +------------------+-----------+ | debian-sys-maint | localhost | | mysql.infoschema | localhost | | mysql.session | localhost | | mysql.sys | localhost | | root | localhost | | system | localhost | +------------------+-----------+ host 值%的时候可以进行远程链接
4:安装nginx
sudo apt-get install nginx 然后使用whereis nginx命令查看各个相关目录 配置文件在:/etc/nginx/ 下
安装压缩 sudo apt-get install unzip