标签:trade   使用   format   ade   cer   art   files   朋友   linux

前言

之前一直用的eolinker的免费版,但是人数有限,所以想找个免费开源的API管理平台,然后就选择了CRAP-API。

步骤

部署环境

LNMT部署

我的环境是之前部署的是LNMP,后面又增加的JDK和Tomcat没部署的朋友可以使用oneinstack一键自动部署来安装好。

Maven部署

Maven部署 | 其实正常来说,直接下载编译好的安装包更改下数据库配置就阔以了,但是我当时用NGINX忘记将静态资源跳转,一直加载不到静态资源,所以克隆了源码,用Maven重新又打了包。

创建虚拟主机

# cd oneinstack

# ./vhost.sh?

#######################################################################

#? ? ? ?OneinStack for CentOS/RedHat 6 Debian 8 and Ubuntu 14 ? ? ? #

#? ? ? ?For more information please visit https://oneinstack.com? ? ? #

#######################################################################

Please choose to use environment:

? ? ? ? 1. Use php

? ? ? ? 2. Use java

Please input a number:(Default 1 press Enter) 1

What Are You Doing?

? ? ? ? 1. Use HTTP Only

? ? ? ? 2. Use your own SSL Certificate and Key

? ? ? ? 3. Use Let's Encrypt to Create SSL Certificate and Key

? ? ? ? q. Exit

Please input the correct option: 3

Please input domain(example: www.example.com):

domain=

Please input the directory for the domain: :

(Default directory: /data/wwwroot/):?

Virtual Host Directory=/data/wwwroot/

Create Virtul Host directory......

set permissions of Virtual Host directory......

Do you want to add more domain name? [y/n]: n

Do you want to redirect all HTTP requests to HTTPS? [y/n]: n

[2019年 10月 16日 星期三 09:27:58 CST] Single domain=''

[2019年 10月 16日 星期三 09:27:58 CST] Getting domain auth token for each domain

[2019年 10月 16日 星期三 09:27:58 CST] Getting webroot for domain=''

[2019年 10月 16日 星期三 09:27:58 CST] Getting new-authz for domain=''

[2019年 10月 16日 星期三 09:28:00 CST] The new-authz request is ok.

[2019年 10月 16日 星期三 09:28:00 CST] Verifying:

[2019年 10月 16日 星期三 09:28:05 CST] Pending

[2019年 10月 16日 星期三 09:28:08 CST] Pending

[2019年 10月 16日 星期三 09:28:10 CST] Pending

[2019年 10月 16日 星期三 09:28:13 CST] Pending

[2019年 10月 16日 星期三 09:28:16 CST] Pending

[2019年 10月 16日 星期三 09:28:19 CST] Pending

[2019年 10月 16日 星期三 09:28:22 CST] Success

[2019年 10月 16日 星期三 09:28:22 CST] Verify finished, start to sign.

[2019年 10月 16日 星期三 09:28:24 CST] Cert success.

-----BEGIN CERTIFICATE-----

xxxxxxxxxxxxxxxx

-----END CERTIFICATE-----

[2019年 10月 16日 星期三 09:28:24 CST] Your cert is in? /root/.acme.sh//.cer?

[2019年 10月 16日 星期三 09:28:24 CST] Your cert key is in? /root/.acme.sh//.key?

[2019年 10月 16日 星期三 09:28:25 CST] The intermediate CA cert is in? /root/.acme.sh//ca.cer?

[2019年 10月 16日 星期三 09:28:25 CST] And the full chain certs is there:? /root/.acme.sh//fullchain.cer?

Do you want to add hotlink protection? [y/n]: n

Allow Rewrite rule? [y/n]: n

Allow Nginx/Tengine/OpenResty access_log? [y/n]: y

You access log file=/data/wwwlogs/_nginx.log

nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok

nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful

Reload Nginx......

#######################################################################

#? ? ? ?OneinStack for CentOS/RedHat 6 Debian 8 and Ubuntu 14 ? ? ? #

#? ? ? ?For more information please visit https://oneinstack.com? ? ? #

#######################################################################

Your domain:? ? ? ? ? ? ? ? ?

Virtualhost conf:? ? ? ? ? ? ?/usr/local/nginx/conf/vhost/.conf

Directory of:? ? ? ? ? ? ? ? ?/data/wwwroot/

Let's Encrypt SSL Certificate:/usr/local/nginx/conf/ssl/.crt

SSL Private Key:? ? ? ? ? ? ? /usr/local/nginx/conf/ssl/.key

修改NGINX配置

注意静态资源的跳转不要忘记了!!!不要忘记了!!!不要忘记了!!!我就掉在这个坑里过...修改完成后,重新载入下配置文件。

# cd /usr/local/nginx/conf/vhost/

# vi .conf

server {

listen 80;

listen 443 ssl http2;

ssl_certificate /usr/local/nginx/conf/ssl/xxxxx.crt;

ssl_certificate_key /usr/local/nginx/conf/ssl/xxxxx.key;

ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;

ssl_ciphers TLS13-AES-256-GCM-SHA384:TLS13-CHACHA20-POLY1305-SHA256:TLS13-AES-128-GCM-SHA256:TLS13-AES-128-CCM-8-SHA256:TLS13-AES-128-CCM-SHA256:EECDH CHACHA20:EECDH AES128:RSA AES128:EECDH AES256:RSA AES256:EECDH 3DES:RSA 3DES:!MD5;

ssl_prefer_server_ciphers on;

ssl_session_timeout 10m;

ssl_session_cache builtin:1000 shared:SSL:10m;

ssl_buffer_size 1400;

add_header Strict-Transport-Security max-age=15768000;

ssl_stapling on;

ssl_stapling_verify on;

server_name xxxx;

access_log /data/wwwlogs/xxxxxx_nginx.log combined;

index index.html index.htm index.jsp;

root /data/wwwroot/xxxxx/;

#error_page 404 /404.html;

#error_page 502 /502.html;

location / {

proxy_set_header Host $host:80;

proxy_set_header X-Real-IP $remote_addr;

proxy_set_header x-forwarded-for $remote_addr;

proxy_pass http://127.0.0.1:8080;

}

location ~ [^/].php(/|$) {

# comment try_files $uri =404; to enable pathinfo

try_files $uri =404;

fastcgi_pass unix:/tmp/php-cgi.sock;

fastcgi_index index.php;

include fastcgi.conf;

#include pathinfo.conf;

}

location ~ .*.(gif|jpg|jpeg|png|bmp|swf)$ {

proxy_pass http://127.0.0.1:8080;

expires 30d;

}

location ~ .*.(js|css)?$ {

proxy_pass http://127.0.0.1:8080;

expires 12h;

}

}

# service nginx reload

下载CRAP

CRAP历史版本源码|安装包下载 | 我这边部署的时候,使用的是最新的包v8.1.5版本的,这边推荐直接下载编译好的包,并通过远程工具SCRT上传到服务器上。

创建数据库

解压压缩文件

# unzip CrapApi.v8.1.5.zip

查看SQL文件

这是便于后面方便直接导入sql文件。

# cd CrapApi.v8.1.5

# ll

总用量 120

-rw-r--r-- 1 root root 112251 10月 26 16:52 2019-10-26.V8.1.5.sql

drwxr-xr-x 5 root root 4096 10月 26 16:56 api

-rw-r--r-- 1 root root 583 2月 17 2019 readme.txt

# pwd

/root/CrapApi.v8.1.5/CrapApi.v8.1.5

# mv 2019-10-26.V8.1.5.sql api.sql

# ll

总用量 120

drwxr-xr-x 5 root root 4096 10月 26 16:56 api

-rw-r--r-- 1 root root 112251 10月 26 16:52 api.sql

-rw-r--r-- 1 root root 583 2月 17 2019 readme.txt

建库并导入SQL文件

# mysql -uroot -p

Enter password:

Welcome to the MySQL monitor. Commands end with ; or g.

Your MySQL connection id is 150536

Server version: 5.6.42-log MySQL Community Server (GPL)

Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its

affiliates. Other names may be trademarks of their respective

owners.

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

MySQL [(none)]> create database api_test;

Query OK, 1 row affected (0.00 sec)

MySQL [(none)]> use api_test;

Database changed

MySQL [api_test]> source /root/CrapApi.v8.1.5/CrapApi.v8.1.5/api.sql

Query OK, 0 rows affected (0.00 sec)

:

:

:

Query OK, 0 rows affected (0.00 sec)

MySQL [api_test]>

修改CRAP-API配置

这里只修改了数据的配置文件config.properties,日志的未做修改。

# cd api/WEB-INF/classes/

# vi config.properties

配置Tomcat

删除webapps下的所有文件

# cd /usr/local/tomcat/webapps/

# rm -rvf *

修改编译包名

# cd /root/CrapApi.v8.1.5/CrapApi.v8.1.5

# mv api ROOT

# ll

总用量 120

-rw-r--r-- 1 root root 112251 10月 26 16:52 api.sql

-rw-r--r-- 1 root root 583 2月 17 2019 readme.txt

drwxr-xr-x 5 root root 4096 10月 26 16:56 ROOT

移包并启动服务

# cd CrapApi.v8.1.5/CrapApi.v8.1.5/

# cp -rvf ROOT/ /usr/local/tomcat/webapps/

# cd /usr/local/tomcat/bin/

# ./ startup.sh

访问页面

CRAP-API——如何在Linux服务器部署CRAP-API教程

标签:trade   使用   format   ade   cer   art   files   朋友   linux

如何部署linux服务器,CRAP-API——如何在Linux服务器部署CRAP-API教程相关推荐

  1. linux查看图像大小_如何在Linux上调整一批图像的大小?

    linux查看图像大小 Resizing images on Linux with gThumb is easy. However, I have a batch of images inside a ...

  2. linux 封禁端口,如何在Linux服务器中使用防火墙封禁端口?

    我们知道服务器的防火墙是一种以软件为基础的网络安全系统,或者在某些情况下,是一种以硬件为基础的网络安全系统.它能自动监控系统中的流量流入和流出,并根据预先配置的规则阻止某些类型的数据流. 在Linux ...

  3. linux中DNS服务器查看域名,如何在Linux中查看DNS服务器设置

    1. 前言 DNS(域名系统)是非常重要的基础网络服务,如邮件服务器.互联网浏览和流媒体服务,如Netflix和Spotify等网络服务都依赖于它. 它在一个叫做DNS服务器的特殊计算机上工作-它保存 ...

  4. linux下安装sbt_如何在Linux上安装SBT

    linux下安装sbt 介绍 (Introduction) Hi! I am Sanjula, and in this guide I hope to teach you how to install ...

  5. linux 当前活动用户,如何在Linux上自动记录所有用户的终端会话活动

    如何在Linux上自动记录所有用户的终端会话活动 不久前,我们写了一篇文章,使用script命令记录Linux终端会话活动. 今天,我们还将讨论相同的主题. 但是,本教程允许您自动记录所有用户的终端会 ...

  6. linux如何检查进程,如何在Linux中检查进程的执行时间

    在Linux或Unix系统中,你是否一直想知道如何找到进程的执行时间? 本指南将向你展示一些在Linux中查找进程执行时间时非常方便的工具. 本指南中显示的每个命令都已在Ubuntu服务器上和Cent ...

  7. linux上安装osg_如何在 Linux 上安装并启用 Flatpak 支持? | Linux 中国

    Flatpak 提供了一种通用的包封装格式,可以在任何 Linux 发行版中使用.它提供了一个沙箱(隔离的)环境来运行应用程序,不会影响其他应用程序和发行版核心软件包.-- Magesh Maruth ...

  8. linux aide使用方法,如何在Linux中使用“AIDE”检查文件和目录的完整性

    在我们关于加强和保护CentOS 7的大型指南中,在" 内部保护系统 "一节中,我们列出的用于内部系统保护以防病毒,rootkit,恶意软件和检测未授权活动的有用安全工具之一是AI ...

  9. linux中安装pip_如何在Linux中安装PIP

    linux中安装pip In this tutorial, we'll go over the steps to install pip in Linux. The pip command allow ...

  10. linux检测软件温度,如何在Linux系统上监测系统温度?(亲测可用)

    转载自:http://os.51cto.com/art/201311/417208.htm 按理说,在大多数情况下,你用不着为电脑的运行温度而操心.除了制造瑕疵外,电脑硬件在设计时确保温度不会超过最高 ...

最新文章

  1. vue-devTools插件安装流程
  2. java 关于String
  3. Eclipse连接数据库MySQL以及一些有关数据库的知识
  4. struts2 中文件的位置问题
  5. 零空间,Markov‘s inequality, Chebyshev Chernoff Bound, Union Bound
  6. UESTC 1143 数据传输 网络流 最大流 Dinic
  7. ajax原理总结,Ajax原理
  8. antd table动态表头_react动态配置antd table的columns
  9. html脚本src,HTML script脚本标签
  10. 软件安全测试--详细总结
  11. 电脑大写,电脑大写键盘怎么打开
  12. 计算机网络基本知识(八):域名、IP地址简介及分类
  13. android新浪微博开发Sso登录(转)
  14. 电信天翼 java_电信天翼云对象存储java实现
  15. 体验Mac OS Monterey前,应做好这5件事
  16. 放开我们追梦的翅膀——致所有无私的父母
  17. 【离职总结复盘】在墨刀远程实习的两个半月,既不舍,又感激,这是初恋的感觉……
  18. 12 MongoDB - 数据查询(消除重复)
  19. 【WebSocket】断连问题排查
  20. yelp dataset导入Neo4j详解(二)

热门文章

  1. 个人商城二开逍遥B2C商城系统源码-可商用版/拼团拼购优惠折扣秒杀源码
  2. 龙芯平台python答案_在龙芯平台上自己编写原创应用——“动态壁纸”
  3. flowable6.4.1+springboot使用dmn
  4. 房贷,商转公积金贷款,所需资料
  5. 论文精读——基于机器学习的越南生活固体废弃物预测
  6. Java基础语法(二)——数据类型
  7. springboot配置http、https访问
  8. MATLAB用GARCH模型对股票市场收益率时间序列波动的拟合与预测
  9. 该怎样运用EDIUS中的无极变速
  10. ChatGPT prompt整理汇总