2567xl

上线的代码有两种方式:

第一种方式是直接将程序目录放在webapps目录下面。

第二种方式是使用开发工具将程序打包成war包,然后上传到webapps目录下面。

 

使用 war 包部署 web 站点

部署 Tomcat 内存检测包

上传 meminfo.war 包到 /usr/local/tomcat/webapps 目录中

[root@localhost webapps]# ls
docs  examples  host-manager  manager  meminfo.war  ROOT

站点会主动解压部署

[root@localhost webapps]# ls
docs  examples  host-manager  manager  meminfo  meminfo.war  ROOT

 

部署开源站点(jpress)

jpress官网:http://jpress.io

下载地址:https://github.com/JpressProjects/jpress

安装数据库

[root@localhost ~]# yum -y install mariadb-server mariadb
[root@localhost ~]# systemctl start mariadb

配置数据库

[root@localhost ~]# mysql
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 2
Server version: 5.5.56-MariaDB MariaDB Server

Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.

Type \'help;\' or \'\h\' for help. Type \'\c\' to clear the current input statement.

MariaDB [(none)]> create database jpress DEFAULT CHARACTER SET utf8;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> grant all on jpress.* to jpress@\'localhost\' identified by \'123456\';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> exit
Bye

jpress 站点上线

[root@localhost ~]# wget  https://github.com/JpressProjects/jpress/archive/0.4.0.tar.gz
[root@localhost ~]# tar xf 0.4.0.tar.gz
[root@localhost ~]# cd jpress-0.4.0/wars/
[root@localhost wars]# mv jpress-web-newest.war /usr/local/tomcat8/webapps/
[root@localhost wars]# /usr/local/tomcat8/bin/shutdown.sh 
[root@localhost wars]# /usr/local/tomcat8/bin/startup.sh 
[root@localhost wars]# ls /usr/local/tomcat8/webapps/
docs  examples  host-manager  jpress-web-newest  jpress-web-newest.war  manager  ROOT

 

分类:

技术点:

相关文章:

  • 2021-09-26
  • 2021-06-29
  • 2021-12-10
  • 2021-10-05
  • 2018-07-07
  • 2019-07-08
猜你喜欢
  • 2021-12-04
  • 2021-05-21
  • 2021-10-09
  • 2021-12-04
  • 2021-10-18
  • 2022-01-02
  • 2021-11-13
相关资源
相似解决方案