jdk8和tocmat
略
tar -zxvf jdk-8u152-linux-x64.tar.gz
mkdir -p /usr/local/java
mv jdk1.8.0_152/ /usr/local/java/
chown -R root:root /usr/local/java/
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
vim /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
source /etc/profile
root@UbuntuBase:/usr/local/java# java -version
java version "1.8.0_152"
Java(TM) SE Runtime Environment (build 1.8.0_152-b16)
Java HotSpot(TM) 64-Bit Server VM (build 25.152-b16, mixed mode)
####Java 安装完成
tar -zxvf apache-tomcat-8.5.23.tar.gz
mv apache-tomcat-8.5.23 tomcat
mv tomcat /usr/local/tomcat
echo 'hello tomcat
' > /usr/local/tomcat/webapps/ROOT/index.html
/usr/local/tomcat/bin/startup.sh
就可查看是否成功
/usr/local/tomcat/bin/shutdown.sh
apt-get update
apt-get install mysql-server
系统将提示您在安装过程中创建 root 密码。选择一个安全的密码,并确保你记住它,因为你以后需要它。接下来,我们将完成 MySQL 的配置。
mysql_secure_installation
mysqladmin -p -u root version
vim /etc/mysql/mysql.conf.d/mysqld.cnf
bind-address = 127.0.0.1
service mysql restart
mysql -u root -p
-- 设置密码安全策略
set global validate_password_policy=0;
-- 设置密码最少长度
set global validate_password_length=1;
-- 允许root用户/密码“123456”,在localhost发起的访问
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY '123456' WITH GRANT OPTION;
-- 允许root用户/密码“123456”,在127.0.0.1发起的访问
GRANT ALL PRIVILEGES ON *.* TO 'root'@'127.0.0.1' IDENTIFIED BY '123456' WITH GRANT OPTION;
-- 允许root用户/密码“123456”,在局域网所以ip发起的访问
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;
-- 刷新权限
FLUSH PRIVILEGES;
vi /etc/mysql/mysql.conf.d/mysqld.cnf
[client]
default-character-set=utf8
default-storage-engine=INNODB
character-set-server=utf8
collation-server=utf8_general_ci
lower-case-table-names = 1