微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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

 

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐