更新中。
环境配置记录: 192.168.1.7 宿主机 172.20.10.10 192.168.1.8 CentOS-7 172.20.10.11 192.168.1.9 CentOS-7 172.20.10.12 39.101.189.62阿里云服务器
0.Linux环境
网络配置
su root
dhclient
dhclient(7353) is already running - exiting.问题解决:杀死进程
ps -ef | grep dhclient
kill -9 7587
172.20.10.11
vim /etc/sysconfig/network-scripts/ifcfg-ens33
systemctl restart network.service
ping www.baidu.com
ping 172.20.10.10
ping 172.20.10.11
TYPE="Ethernet"
PROXY_METHOD="none"
BROWSER_ONLY="no"
BOOTPROTO="static"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_FAILURE_FATAL="no"
IPV6_ADDR_GEN_MODE="stable-privacy"
NAME="ens33"
UUID="f14aacb1-441e-4bbb-8018-014e4a84b842"
DEVICE="ens33"
ONBOOT="yes"
IPADDR=192.168.1.8
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
DNS1=119.29.29.29
1.Git安装
安装包
https://mirrors.edge.kernel.org/pub/software/scm/git/
安装可能需要的依赖
yum install curl-devel expat-devel gettext-devel openssl-devel zlibdevel gcc-c++ perl-ExtUtils-MakeMaker
报错解决:https://blog.csdn.net/weicuidi/article/details/52935100
编译安装
[root@localhost ~]
[root@localhost git-2.26.2]
[root@localhost git-2.26.2]
[root@localhost git-2.26.2]
[root@localhost git-2.26.2]
make: *** [configure] Error 127解决:https://blog.csdn.net/weixin_42890739/article/details/107316049
加入环境变量
export GIT_HOME=/usr/local/git
export PATH=$PATH:$GIT_HOME/bin
source /etc/profile
查看结果
[root@localhost git-2.26.2]
git version 1.8.3.1
2.JDK安装
安装包
jdk-8u161-linux-x64.tar.gz
https://www.cnblogs.com/aijiao/p/14344582.html
卸载已有的OPENJDK(如果有)
rpm -qa | grep java
yum -y remove java-1.8.0-openjdk-1.8.0.131-11.b12.el7.x86_64
yum -y remove java-1.7.0-openjdk-1.7.0.141-2.6.10.5.el7.x86_64
yum -y remove java-1.7.0-openjdk-headless-1.7.0.141-2.6.10.5.el7.x86_64
yum -y remove java-1.8.0-openjdk-headless-1.8.0.131-11.b12.el7.x86_64
创建?录并解压
cd /usr/local/
mkdir java
cd java
tar -zxvf /root/jdk-8u161-linux-x64.tar.gz -C ./
配置JDK环境变量
JAVA_HOME=/usr/local/java/jdk1.8.0_161
CLASSPATH=$JAVA_HOME/lib/
PATH=$PATH:$JAVA_HOME/bin
export PATH JAVA_HOME CLASSPATH
source /etc/profile
验证JDK安装结果
java -version
javac
java version "1.8.0_161"
3.Node安装
安装包
node-v14.18.1-linux-x64.tar.xz
创建目录并解压
cd /usr/local/
mkdir node
cd node
tar -xJvf /root/node-v14.18.1-linux-x64.tar.xz -C ./
配置NODE系统环境变量
export PATH=/usr/local/node/node-v14.18.1-linux-x64/bin:$PATH
source ~/.bash_profile
检查安装结果
node -v
v14.18.1
npm version
{
npm: '6.14.15',
ares: '1.17.2',
brotli: '1.0.9',
cldr: '39.0',
icu: '69.1',
llhttp: '2.1.4',
modules: '83',
napi: '8',
nghttp2: '1.42.0',
node: '14.18.1',
openssl: '1.1.1l',
tz: '2021a',
unicode: '13.0',
uv: '1.42.0',
v8: '8.4.371.23-node.84',
zlib: '1.2.11'
}
npx -v
6.14.15
4.Python安装
CentOS 7.4 默认?带了?个 Python2.7 环境,然?现在主流都是 Python3 ,所以接下来再装?个 Python3 ,打造?个共存的环境。
准备PYTHON3安装包并解压
Python-3.8.3.tgz
tar zxvf Python-3.8.3.tgz
安装相关预备环境
yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlitedevel readline-devel tk-devel gcc make
编译并安装
cd Python-3.8.3/
./configure prefix=/usr/local/python3
make && make install
添加软链接
我们还需要将刚刚安装?成的?录 /usr/local/python3 ?的 python3 可执??件做?份软链接,链接到 /usr/bin 下,?便后续使?python3
ln -s /usr/local/python3/bin/python3 /usr/bin/python3
ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3
验证安装
命令?输? python3 ,即可查看 Python3 版本的安装结果
Python 3.8.3 (default, Oct 22 2021, 22:05:23)
?输? python ,依然还是 python2.7.5 环境
5.Maven安装
准备MAVEN安装包并解压
apache-maven-3.6.3-bin.tar.gz 安装包,并将其放置于提前创建好的 /opt/maven?录下。
tar zxvf apache-maven-3.6.3-bin.tar.gz
配置MAVEN加速镜像源
配置的是阿?云的maven镜像源。
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
配置环境变量
因为下载的是?进制版安装包,所以解压完,配置好环境变量即可使?了。
export MAVEN_HOME=/opt/maven/apache-maven-3.6.3
export PATH=$MAVEN_HOME/bin:$PATH
source /etc/profile
检验安装结果
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: /opt/maven/apache-maven-3.6.3
6.MySQL安装
?先准备安装包
mysql-5.7.26-linux-glibc2.12-x86_64.tar.gz
卸载系统?带的MARIADB(如果有)
rpm -qa|grep mariadb
yum -y remove mariadb-libs-5.5.56-2.el7.x86_64
解压MYSQL安装包
tar -zxvf /root/mysql-5.7.30-linux-glibc2.12-x86_64.tar.gz -C /usr/local/
mv mysql-5.7.30-linux-glibc2.12-x86_64 mysql
创建MYSQL?户和?户组
groupadd mysql
useradd -g mysql mysql
mkdir data
修改MYSQL?录的归属?户
chown -R mysql:mysql ./
准备MYSQL的配置?件
[mysql]
default-character-set=utf8
socket=/var/lib/mysql/mysql.sock
[mysqld]
skip-name-resolve
port = 3306
socket=/var/lib/mysql/mysql.sock
basedir=/usr/local/mysql
datadir=/usr/local/mysql/data
max_connections=200
character-set-server=utf8
default-storage-engine=INNODB
lower_case_table_names=1
max_allowed_packet=16M
mkdir /var/lib/mysql
chmod 777 /var/lib/mysql
正式开始安装MYSQL
cd /usr/local/mysql
./bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
2021-10-23T05:44:11.126582Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2021-10-23T05:44:11.304715Z 0 [Warning] InnoDB: New log files created, LSN=45790
2021-10-23T05:44:11.327973Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2021-10-23T05:44:11.409104Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 3f87734f-33c4-11ec-afb2-000c29ec8a06.
2021-10-23T05:44:11.411183Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2021-10-23T05:44:11.411892Z 1 [Note] A temporary password is generated for root@localhost: oF&_dewD-7Gd
oF&_dewD-7Gd
复制启动脚本到资源?录
cp ./support-files/mysql.server /etc/init.d/mysqld
basedir=/usr/local/mysql
datadir=/usr/local/mysql/data
设置MYSQL系统服务并开启?启
chmod +x /etc/init.d/mysqld
chkconfig --add mysqld
chkconfig --list mysqld
这样就表明 mysqld 服务已经?效了,在2、3、4、5运?级别随系统启动??动启动,以后可以直接使? service 命令控制 mysql 的启停。
启动MYSQLD
service mysqld start
将 MYSQL 的 BIN ?录加? PATH 环境变量
export PATH=$PATH:/usr/local/mysql/bin
source ~/.bash_profile
?次登陆MYSQL
https://blog.csdn.net/qq_38695182/article/details/79953474
mysql -u root -p
接下来修改ROOT账户密码
mysql>alter user user() identified by "111111";
mysql>flush privileges;
设置远程主机登录
mysql> use mysql;
mysql> update user set user.Host='%' where user.User='root';
mysql> flush privileges;
最后利?NAVICAT等?具进?测试即可
172.20.10.12
7.Redis安装
?先准备REDIS安装包
解压安装包
cd /usr/local/
mkdir redis
cd redis
tar zxvf /root/redis-6.2.4.tar.gz -C ./
编译并安装
cd redis-6.2.4/
make && make install
将 REDIS 安装为系统服务并后台启动
cd utils/
https://blog.csdn.net/weixin_45949073/article/details/109213758
./install_server.sh
查看REDIS服务启动情况
systemctl status redis_6379.service
启动REDIS客户端并测试
[root@localhost utils]
127.0.0.1:6379>
127.0.0.1:6379> set foo bar
OK
127.0.0.1:6379> get foo
"bar"
设置允许远程连接
vim /etc/redis/6379.conf
systemctl restart redis_6379.service
设置访问密码
vim /etc/redis/6379.conf
systemctl restart redis_6379.service
[root@localhost utils]
127.0.0.1:6379> get foo
(error) NOAUTH Authentication required.
127.0.0.1:6379> auth 1
OK
127.0.0.1:6379> get foo
"bar"
8.消息队列RabbitMQ安装
?先安装ERLANG环境
curl -s https://packagecloud.io/install/repositories/rabbitmq/erlang/script.rpm
.sh | sudo bash
安装RABBITMQ
https://www.cnblogs.com/huifeidezhuzai/p/15047976.html
yum install erlang-22.3.3-1.el7.x86_64
设置RABBITMQ开机启动
启动RABBITMQ服务
开启WEB可视化管理插件:
访问可视化管理界?:
9.应用服务器Tomcat安装
准备安装包
解压并安装
启动TOMCAT
配置快捷操作和开机启动
10.Web服务器Nginx安装
?先安装包并解压
11.Docker环境安装
|