1. jdk 1.8 安装(jdk-8u401-linux-x64.tar.gz)
a. 传输jdk安装包到服务器,进入安装包所在同级目录
b. 解压安装包到“/usr/local/”目录下
tar -zxvf jdk-8u401-linux-x64.tar.gz -C /usr/local/
c. 修改配置文件
vim /etc/profile
ⅰ. 在配置文件的结尾追加:
export JAVA_HOME=/usr/local/jdk1.8.0_401
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=.:${JAVA_HOME}/bin:$PATH
ⅱ. 保存并退出
d. 重新加载配置文件
source /etc/profile
2. maven 安装(apache-maven-3.9.5-bin.tar.gz)
a. 传输maven安装包到服务器,并进入安装包所在同级目录
b. 解压安装包到“/usr/local/”目录下
tar -zxvf apache-maven-3.9.5-bin.tar.gz -C /usr/local/
c. 修改配置文件
vim /etc/profile
ⅰ. 在配置文件的结尾追加:
export MAVEN_HOME=/usr/local/apache-maven-3.9.5/bin/
export PATH=$PATH:$MAVEN_HOME
ⅱ. 保存并退出
d. 重新加载配置文件
source /etc/profile
3. mysql 8.0安装
a. 首先,下载 MySQL APT Repository 的 DEB 安装包:
wget https://dev.mysql.com/get/mysql-apt-config_0.8.17-1_all.deb
b. 安装下载的DEB文件
sudo dpkg -i mysql-apt-config_0.8.17-1_all.deb
c. 更新软件包列表
sudo apt update
如果出现报错:
root@iZ2vc6ann86y2ph7kj7k97Z:/usr/local/ishaoapp# sudo apt update
Hit:1 http://mirrors.cloud.aliyuncs.com/ubuntu bionic InRelease
Get:2 http://repo.mysql.com/apt/ubuntu bionic InRelease [20.0 kB]
Err:2 http://repo.mysql.com/apt/ubuntu bionic InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B7B3B788A8D3785C
Hit:3 http://mirrors.cloud.aliyuncs.com/ubuntu bionic-updates InRelease
Hit:4 http://mirrors.cloud.aliyuncs.com/ubuntu bionic-security InRelease
Reading package lists... Done
W: GPG error: http://repo.mysql.com/apt/ubuntu bionic InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B7B3B788A8D3785C
E: The repository 'http://repo.mysql.com/apt/ubuntu bionic InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
这个错误是因为系统无法验证 MySQL 软件源的公钥。
你需要手动导入 MySQL 的公钥
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys B7B3B788A8D3785C
然后再次运行
sudo apt update
d. 安装msyql 8.0
sudo apt install mysql-server
e. 安装完成后检查mysql 版本
mysql --version
f. 查询mysql服务名称
sudo systemctl list-unit-files | grep mysql
g. 设置mysql服务开机自启
sudo systemctl start mysql
sudo systemctl enable mysql
h. 创建一个用户,并允许其远程链接
// 创建用户,并设置密码
CREATE USER 'username'@'%' IDENTIFIED BY 'password';
// 授予用户远程链接的权限
GRANT ALL PRIVILEGES ON *.* TO 'username'@'%';
// 授予用户对所有数据库和所有表的完全访问权限
GRANT ALL PRIVILEGES ON *.* TO 'username'@'%' WITH GRANT OPTION;
// 取消新用户的授予权限特权
REVOKE GRANT OPTION ON *.* FROM 'username'@'%';
// 刷新权限,以生效
FLUSH PRIVILEGES;
4. tomcat 安装 (apache-tomcat-9.0.82.tar.gz)
a. 传输tomcat安装包到服务器,进入安装包所在同级目录
b. 解压安装包到“/usr/local/”目录下
tar -zxvf apache-tomcat-9.0.82.tar.gz -C /usr/local/
c. 进入Tomcat的bin目录启动服务
sh startup.sh 或者 ./startup.sh
ps:(tomcat与jdk版本对应关系)
5. redis 安装(redis-4.0.0.tar.gz)
a. 传输redis安装包到服务器,进入安装包所在同级目录
b. 解压安装包到“/usr/local/”目录下
tar -zxvf redis-4.0.0.tar.gz -C /usr/local/
c. 更新apt
sudo apt update
d. 安装Redis的依赖环境gcc
sudo apt install gcc
e. 安装make命令
sudo apt install make
f. 进入/usr/local/redis-4.0.0,进行编译
make
g. 进入redis的src目录,进行安装
make install
h. 打开配置文件
sudo vim /usr/local/redis-4.0.0/redis.conf
修改一下配置:
(修改配置根据个人需要修改)
设置daemonize为yes 表示后台运行
设置密码 requirepass 123456
i. 启动redis
src/redis-server ./redis.conf
6. nginx 安装 (nginx-1.16.1.tar.gz)
a. 传输redis安装包到服务器,进入安装包所在同级目录
b. 解压安装包到“/usr/local/”目录下
tar -zxvf nginx-1.16.1.tar.gz -C /usr/local/
c. 进入“usr/local/nginx-1.16.1”目录下
d. 指定nginx的安装目录
./configure --prefix=/usr/local/nginx
如果出现报错:
./configure: error: the HTTP rewrite module requires the PCRE library.
You can either disable the module by using --without-http_rewrite_module option,
or install the PCRE library into the system, or build the PCRE library
statically from the source with nginx by using --with-pcre=<path> option.
表明缺少 PCRE(Perl Compatible Regular Expressions)库
安装PCRE库:
sudo apt install libpcre3 libpcre3-dev
./configure: error: the HTTP gzip module requires the zlib library.
You can either disable the module by using --without-http_gzip_module
option, or install the zlib library into the system, or build the zlib library
statically from the source with nginx by using --with-zlib=<path> option.
表明缺少zlib 库
安装zlib库:
sudo apt install zlib1g zlib1g-dev
e. 安装nginx
make && make install
自己安装软件过程中的一点心得,如果有什么不对的地方,欢迎指正。