惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

aimingoo的专栏
aimingoo的专栏
Jina AI
Jina AI
WordPress大学
WordPress大学
Recent Announcements
Recent Announcements
G
Google Developers Blog
I
InfoQ
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Google DeepMind News
Google DeepMind News
P
Proofpoint News Feed
MyScale Blog
MyScale Blog
M
MIT News - Artificial intelligence
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
C
Check Point Blog
J
Java Code Geeks
T
Tailwind CSS Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Microsoft Security Blog
Microsoft Security Blog
MongoDB | Blog
MongoDB | Blog
V
Visual Studio Blog
人人都是产品经理
人人都是产品经理
量子位
A
About on SuperTechFans
D
DataBreaches.Net
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知

沐凉`Blog

沐凉·日记 沐凉·日记 沐凉·日记 Flutter开发Linux程序中文乱码解决 | 沐凉`Blog Docker安装Nginx | 沐凉`Blog 沐凉·日记 flutter loading 动画插件(flutter_spinkit 4.1.2) | 沐凉`Blog 关于使用@CrossOrigin遇见的的一些问题和理解 | 沐凉`Blog 沐凉·日记 Linux 常用指令、IntelliJ IDEA 常用快捷键 | 沐凉`Blog 了解23种设计模式-单例模式 | 沐凉`Blog Spring Boot 邮件服务提供者 | 沐凉`Blog Docker 搭建redis单节点以及一主两从三哨兵模式 | 沐凉`Blog 沐凉·日记 Hello World | 沐凉`Blog
Ubuntu Server 安装 Java、Tomcat、mysql | 沐凉`Blog
2019-06-27 · via 沐凉`Blog

安装Java

使用xftp把压缩包上传到Ubuntu 中,我这里使用的是JDK1.8

https://www.oracle.com/technetwork/java/javase/downloads/index.html

解压缩

1
tar -zxvf jdk-8u152-linux-x64.tar.gz

创建目录

1
mkdir -p /usr/local/java

移动解压好的安装包

1
mv jdk1.8.0_152/ /usr/local/java/

设置所有者

1
chown -R root:root /usr/local/java/

配置系统环境变量

1
2
3
4
5
6
vim /etc/environment

在第二行加入
export JAVA_HOME=/usr/local/java/jdk1.8.0_152
export JRE_HOME=/usr/local/java/jdk1.8.0_152/jre
export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib

配置用户环境变量

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/etc/profile

修改为如下

if [ "$PS1" ]; then
if [ "$BASH" ] && [ "$BASH" != "/bin/sh" ]; then
# The file bash.bashrc already sets the default PS1.
# PS1='\h:\w\$ '
if [ -f /etc/bash.bashrc ]; then
. /etc/bash.bashrc
fi
else
if [ "`id -u`" -eq 0 ]; then
PS1='# '
else
PS1='$ '
fi
fi
fi
#加入的语句
export JAVA_HOME=/usr/local/java/jdk1.8.0_152
export JRE_HOME=/usr/local/java/jdk1.8.0_152/jre
export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH:$HOME/bin
#加入的语句

if [ -d /etc/profile.d ]; then
for i in /etc/profile.d/*.sh; do
if [ -r $i ]; then
. $i
fi
done
unset i
fi

使环境变量生效

1
source /etc/profile

测试安装是否成功

1
java -version

安装Tomcat

我这里安装的是Tomcat 8.5.23

https://tomcat.apache.org/

解压缩上传的压缩文件

1
tar -zxvf apache-tomcat-8.5.23.tar.gz

改成简短的文件名

1
mv apache-tomcat-8.5.23 tomcat

移动目录

1
mv tomcat/ /usr/local/

启动
执行tomcat/bin/目录下的startup.sh

安装MySql

更新数据源

1
apt-get update

安装

1
2
3
apt-get install mysql-server

#安装途中需要设置root密码

如遇到如下问题,则执行划线部分代码

E: dpkg was interrupted, you must manually run ‘++dpkg –configure -a++’ to correct the problem

配置允许远程连接

1
2
3
4
vim /etc/mysql/mysql.conf.d/mysqld.cnf

#注释掉如下行(前面加上#号)
bind-address = 127.0.0.1

重启Mysql服务

1
service mysql restart

授权 root 用户允许所有人连接

1
grant all privileges on *.* to 'root'@'%' identified by '你的 mysql root 账户密码';

如果出现如下情况,是由于密码安全级别太低

1
2
3
4
5
6
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements

使用如下设置即可

set global validate_password_policy=0; //设置密码安全级别
set global validate_password_length=1; //设置密码长度限制

重启Mysql服务

1
service mysql restart