首先准备tomcat,jdk,jpress安装包
一. tomcat8的安装
1. 使用xftp等工具将软件包上传至Linux
2. 将jdk移至/usr/local/tomcat并安装jdk
mv jdk-8u261-linux-x64.rpm /usr/local/tomcat
yum localinstall jdk-8u261-linux-x64.rpm -y
3. 将tomcat解压至/usr/local/tomcat中
mkdir /usr/local/tomcat
mv apache-tomcat-9.0.78.tar.gz /usr/local/tomcat
cd /usr/local/tomcat
tar xvf apache-tomcat-9.0.78.tar.gz
4. 进入/usr/local/tomcat/bin目录启动tomcat
bash startup.sh
5. 进入浏览器输入网址将会看到如下展示(输入自己IP:8080端口号即可查看)
二. 部署jpress应用
1. 配置启动服务脚本
[Unit]
Description=tomcat.service
[Service]
Type=forking
ExecStart=/usr/local/tomcat/apache-tomcat-9.0.78/bin/startup.sh
ExecStop=/usr/local/tomcat/apache-tomcat-9.0.78/bin/shutdown.sh
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
2. 创建数据库
mysql -uroot -pCentOS@MySQL123 -e "create database jpress DEFAULT CHARACTER SET utf8;"
mysql -uroot -pCentOS@MySQL123 -e "grant all on jpress.* to jpress@'localhost' identified by 'CentOS@MySQL123';"
3. 将jpress的war包放入/usr/local/tomcat/webapps
4. 输入(IP:8080/war包名字/install)即可进行jpress安装