WEB站点部署

上线的代码有两种方式:

第一种方式是直接将程序目录放在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

 

转载于:https://www.cnblogs.com/2567xl/p/11574339.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值