安卓手机使用termux搭建centos7个人博客服务器

安卓手机搭建centos7个人博客服务器

介绍

安卓termux下实现centos7搭建个人博客服务器
hexo-boot 是开源项目有兴趣的可以去gitee或者Githup获取源码自己打包编译

资源下载地址

jdk1.8   百度云下载链接: https://pan.baidu.com/s/13Tr831zl4YuVwZLHXgJ8QQ 提取码: z2p2 

tomcat9.037   百度云下载链接: https://pan.baidu.com/s/1FXZP6163Ouisuc3nzqTchw 提取码: 6s5p 

hexo-boot  百度云下载链接: https://pan.baidu.com/s/1ASHbEMfLkvl5G6hzuFYn2Q 提取码: h6uq 

安装教程

  1. 安装jdk
将下载好的jdk1.8的压缩包解压到/usr/local/
配置环境变量
[root@localhost ~]# vi /etc/profile

将下面类容添加进去

export JAVA_HOME=/usr/local/jdk1.8.0_202
export JRE_HOME=$JAVA_HOME/jre
export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib
export PATH=$JAVA_HOME/bin:$PATH

保存并执行生效环境变量
[root@localhost ~]# source /etc/profile
  1. 配置mysql5.7及以上
    安卓手机使用termux搭建centos7个人博客服务器_第1张图片
如果有mysql服务器的话 创建一个 hexo-boot 数据库 ,账号:root,密码:123456
如果没有,查看我的帖子有解压安装mysql5.7教程

mysql5.7解压安装教程

  1. 安装tomcat
将下载好的tomcat9.037的压缩包解压到/usr//local/
删除 webapps下所有项目

[root@localhost temp]# cd /usr/local/apache-tomcat-9.0.37/webapps/
[root@localhost webapps]# ls
ROOT  docs  examples  host-manager  manager
[root@localhost webapps]# rm -rf ROOT/ docs/ examples/ host-manager/ manager/
[root@localhost webapps]# ls

把下载好的博客war包放到 webapps/下
[root@localhost webapps]# pwd
/usr/local/apache-tomcat-9.0.37/webapps
[root@localhost webapps]# ls
ROOT.war
[root@localhost webapps]# 

启动tomcat
[root@localhost bin]# pwd
/usr/local/apache-tomcat-9.0.37/bin
[root@localhost bin]# ./startup.sh 

启动的过程中比较慢,可以看一下tomcat日志
24-Feb-2022 02:54:57.181 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version name:   Apache Tomcat/9.0.37
24-Feb-2022 02:54:57.197 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built:          Jun 30 2020 20:09:49 UTC
24-Feb-2022 02:54:57.198 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version number: 9.0.37.0
24-Feb-2022 02:54:57.198 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name:               Linux
24-Feb-2022 02:54:57.199 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version:            4.14.116
24-Feb-2022 02:54:57.199 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture:          aarch64
24-Feb-2022 02:54:57.200 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home:             /usr/local/jdk1.8.0_202/jre
24-Feb-2022 02:54:57.200 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version:           1.8.0_202-b08
24-Feb-2022 02:54:57.201 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:            Oracle Corporation
24-Feb-2022 02:54:57.201 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:         /usr/local/apache-tomcat-9.0.37
24-Feb-2022 02:54:57.201 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:         /usr/local/apache-tomcat-9.0.37
24-Feb-2022 02:54:57.211 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/usr/local/apache-tomcat-9.0.37/conf/logging.properties
24-Feb-2022 02:54:57.212 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
24-Feb-2022 02:54:57.213 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
24-Feb-2022 02:54:57.213 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
24-Feb-2022 02:54:57.214 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dorg.apache.catalina.security.SecurityListener.UMASK=0027
24-Feb-2022 02:54:57.214 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs=
24-Feb-2022 02:54:57.214 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/usr/local/apache-tomcat-9.0.37
24-Feb-2022 02:54:57.215 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/usr/local/apache-tomcat-9.0.37
24-Feb-2022 02:54:57.215 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/usr/local/apache-tomcat-9.0.37/temp
24-Feb-2022 02:54:57.216 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent The Apache Tomcat Native library which allows using OpenSSL was not found on the java.library.path: [/usr/java/packages/lib/aarch64:/lib:/usr/lib]
24-Feb-2022 02:55:08.935 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
24-Feb-2022 02:55:09.181 INFO [main] org.apache.catalina.startup.Catalina.load Server initialization in [5123] milliseconds
24-Feb-2022 02:55:09.434 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
24-Feb-2022 02:55:09.436 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet engine: [Apache Tomcat/9.0.37]
24-Feb-2022 02:55:09.632 INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [/usr/local/apache-tomcat-9.0.37/webapps/ROOT.war]

第一次会有点慢,会初始化所有的表和数据,请耐心等待~~~
启动成功可以去手机浏览器 访问
127.0.0.1:8080

安卓手机使用termux搭建centos7个人博客服务器_第2张图片

安卓手机使用termux搭建centos7个人博客服务器_第3张图片

版权声明

如有转载引用的话 希望标明文章出处!!!

你可能感兴趣的:(服务器,android,java)