服务器系统部署
一、准备工作
下载所需软件安装包
JDK:Java开发工具包,用于运行Java应用程序。
Tomcat:Web应用服务器,用于部署和管理Java Web应用。
MySQL:关系型数据库管理系统,用于数据存储和管理。
Redis:内存中的高性能键值对存储系统。
Nginx:高性能的HTTP和反向代理服务器。
Node.js:基于Chrome V8引擎的JavaScript运行环境。
Maven:项目管理和自动构建工具。
Git:版本控制系统,用于代码管理和协作。
准备服务器文件传输工具
推荐使用FileZilla,用于将本地文件上传至服务器。
二、本地虚拟机网络设置(云服务器跳过)
查看有无分配的IP地址
ifconfig
修改虚拟机网络配置
根据本机的网络信息修改虚拟机的IP地址、子网掩码、网关和DNS服务器。
vi /etc/sysconfig/network-scripts/ifcfg-ens33
示例配置如下:
TYPE=Ethernet PROXY_METHOD=none BROWSER_ONLY=no BOOTPROTO=static //静态IP 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=31ddae9d-57fd-46ee-a464-bd0c0ee6f913 DEVICE=ens33 ONBOOT=yes //开机启动 IPADDR=192.168.1.100 //静态IP地址 NETMASK=255.255.255.0 //子网掩码 GATEWAY=192.168.1.1 //默认网关 DNS1=8.8.8.8 //DNS服务器
重启网卡服务
systemctl restart network.service
测试网络连接
使用ping命令测试主机与虚拟机之间的网络连通性。
ping [目标IP]
三、安装JDK
上传JDK压缩包到服务器
使用FileZilla等工具上传JDK压缩包到服务器。
解压并安装JDK
tar -zxvf jdk-8uXXX-linux-x64.tar.gz sudo mv jdk1.8.0_xxx /usr/local/java
配置环境变量
vim /etc/profile
在文件末尾添加以下内容:
export JAVA_HOME=/usr/local/java/jdk1.8.0_xxx export PATH=$PATH:$JAVA_HOME/bin
使配置生效:
source /etc/profile
检查JDK是否安装成功:
java -version
四、安装Tomcat
上传Tomcat压缩包到服务器
使用FileZilla等工具上传Tomcat压缩包到服务器。
解压Tomcat文件
tar -zxvf apache-tomcat-8.5.15.tar.gz -C /usr/local/ mv apache-tomcat-8.5.15 /usr/local/Tomcat
配置环境变量
vim /etc/profile
在文件末尾添加以下内容:
export TOMCAT_HOME=/usr/local/Tomcat export PATH=$PATH:$TOMCAT_HOME/bin
使配置生效:
source /etc/profile
启动和关闭Tomcat
启动Tomcat:
$TOMCAT_HOME/bin/startup.sh
关闭Tomcat:
$TOMCAT_HOME/bin/shutdown.sh
查看Tomcat日志:
tail -f $TOMCAT_HOME/logs/catalina.out
五、安装MySQL
上传MySQL压缩包到服务器
使用FileZilla等工具上传MySQL压缩包到服务器。
卸载旧版MySQL(如果有)
rpm -qa | grep mysql sudo yum remove mysql* -y sudo yum remove mariadb* -y
安装MySQL 5.7社区版
rpm -ivh mysql-community-common-5.7.27-1.el7.x86_64.rpm mysql-community-libs-5.7.27-1.el7.x86_64.rpm mysql-community-client-5.7.27-1.el7.x86_64.rpm mysql-community-server-5.7.27-1.el7.x86_64.rpm mysql-community-devel-5.7.27-1.el7.x86_64.rpm mysql-community-test-5.7.27-1.el7.x86_64.rpm mysql-community-embedded-5.7.27-1.el7.x86_64.rpm mysql-community-manpages-5.7.27-1.el7.x86_64.rpm mysql-community-sysschema-5.7.27-1.el7.x86_64.rpm mysql-community-shared-5.7.27-1.el7.x86_64.rpm mysql-community-private-5.7.27-1.el7.x86_64.rpm mysql-community-docs-5.7.27-1.el7.x86_64.rpm mysql-community-info-5.7.27-1.el7.x86_64.rpm mysql-community-palindrome-5.7.27-1.el7.x86_64.rpm mysql-community-ptest-5.7.27-1.el7.x86_64.rpm mysql-community-benchmarks-5.7.27-1.el7.x86_64.rpm mysql-community-embedded-test-5.7.27-1.el7.x86_64.rpm mysql-community-sandbox-5.7.27-1.el7.x86_64.rpm mysql-community-gdb-5.7.27-1.el7.x86_64.rpm mysql-community-audit-plugin-5.7.27-1.el7.x86_64.rpm mysql-community-authentication-caching-5.7.27-1.el7.x86_64.rpm mysql-community-authentication-caching-for-unixcompat-plugin-5.7.27-1.el7.x86_64.rpm mysql-community-authentication-caching-mbstring-plugin-5.7.27-1.el7.x86_64.rpm mysql-community-authentication-caching-windows-plugin-5.7.27-1.el7.x86_64.rpm mysql-community-authentication-plugin-5.7.27-1.el7.x86_64.rpm mysql-community-authentication-source-plugin-5.7.27-1.el7.x86_64.rpm mysql-community-authentication-test-plugin-5.7.27-1.el7.x86_64.rpm mysql-community-blackhole-5.7.27-1.el7.x86_64.rpm mysql-community-blackhole-maxscale-agent-5.7.27-1.el7.x86_64.rpm mysql-community-blackhole-maxscale-simulator-5.7.27-1.el7.x86_64.rpm mysql-community-blackhole-maxscale-standalone-5.7.27-1.el7.x86_64.rpm mysql-community-blackhole-maxscale-tabletops-5.7.27-1.el7.x86_64.rpm mysql-community-blackhole-maxscale-tablettopsanitychecker-5.7.27-1.el7.x86_64.rpm mysql-community-blackhole-maxscale-tablettopsanitychecker-debuginfo-5.7.27-1.el7.x86_64.rpm mysql-community-blackhole-maxscale-test-5.7.27-1.el7.x86_64.rpm mysql-community-blackhole-maxscale-testrun-5.7.27-1.el7.x86_64.rpm mysql-community-blackhole-maxscale-testrun-debuginfo-5.7.27-1.el7.x86_64.rpm mysql-community-blackhole-maxscale-testrunstandalone-5.7.27-1.el7.x86_64.rpm mysql-community-blackhole-maxscale-testrunstandalonedebuginfo-5.7.27-1.el7.x86_64.rpm mysql-community-blackhole-maxscale-testrunstandalonedebugsources-5.7.27-1.el7.x86_64.rpm mysql-community-blackhole-maxscale-testrunstandalonesources-5.7.27-1.el7.x86_64.rpm mysql-community-blackhole-maxscale-testrunstandalonetests-5.7.27-1.el7.x86_64.rpm mysql-community-blackhole-maxscale-testrunstandalonetestsdebuginfos-5.7.27-1.el7.x86_64.rpm mysql-community-blackhole-maxscale-testrunstandalonetestssources-5.7.27-1.el7.x86_64.rpm mysql-community-blackhole-maxscale-testrunstandalonetestssourcesdebuginfos-5.7.27-1.el7.x86_64.rpm mysql-community-blackhole-maxscale-testrunstandalonetestssourcessourcesdebuginfos-5.7.27-1.el7.x86_64.rpm mysql-community-blackhole-maxscale-testrunstandalonetestssourcessourcessourcesdebuginfos-5,``` 注意:安装过程中可能会提示需要安装其他依赖包,按照提示进行安装即可。
小伙伴们,上文介绍了“服务器系统部署”的内容,你了解清楚吗?希望对你有所帮助,任何问题可以给我留言,让我们下期再见吧。
原创文章,作者:K-seo,如若转载,请注明出处:https://www.kdun.cn/ask/699159.html