Spring-Boot2.X 中 HTTPS 配置

网上资料的错误

在Spring Boot2.0以上配置嵌入式Servlet容器时EmbeddedServletContainerCustomizer类不存在,经查询发现被WebServerFactoryCustomizer替代.
使用WebServerFactoryCustomizer接口替换EmbeddedServletContainerCustomizer组件完成对嵌入式Servlet容器的配置

准备工作

  1. 阿里云ECS
  2. 域名
  3. SSL证书 (用于支持https)
  4. springboot项目 (本文采用jar方式打包)
阅读全文 »

nohup /dev/null 2>&1 含义详解

nohup命令:如果你正在运行一个进程,而且你觉得在退出帐户时该进程还不会结束,那么可以使用nohup命令。该命令可以在你退出帐户/关闭终端之后继续运行相应的进程。nohup就是不挂起的意思(no hang up)。

阅读全文 »

阿里云服务器部署Logstash

下载安装包

1
wget https://artifacts.elastic.co/downloads/logstash/logstash-6.5.3.tar.gz

解压

1
tar -zxvf logstash-6.5.3.tar.gz

快速启动(需要java8 jre,目前不支持java9)

阅读全文 »

springboot跨域配置

1
2
3
4
5
6
7
8
9
@Configuration
public class MvcConfig implements WebMvcConfigurer {
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**")
.allowedMethods("POST", "GET", "PUT", "OPTIONS", "DELETE")
.allowCredentials(true).maxAge(3600);
}
}
阅读全文 »

进入Redis安装目录

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
root@Ubuntu:/usr/local/software/redis-4.0.9# ll
total 316
drwxrwxr-x 6 root root 4096 Dec 4 15:47 ./
drwxr-xr-x 6 root root 4096 Dec 4 14:55 ../
-rw-rw-r-- 1 root root 157632 Mar 27 2018 00-RELEASENOTES
-rw-rw-r-- 1 root root 53 Mar 27 2018 BUGS
-rw-rw-r-- 1 root root 1815 Mar 27 2018 CONTRIBUTING
-rw-rw-r-- 1 root root 1487 Mar 27 2018 COPYING
drwxrwxr-x 6 root root 4096 Dec 4 11:49 deps/
-rw-rw-r-- 1 root root 376 Mar 27 2018 .gitignore
-rw-rw-r-- 1 root root 11 Mar 27 2018 INSTALL
-rw-rw-r-- 1 root root 151 Mar 27 2018 Makefile
-rw-rw-r-- 1 root root 4223 Mar 27 2018 MANIFESTO
-rw-rw-r-- 1 root root 20543 Mar 27 2018 README.md
-rw-rw-r-- 1 root root 58824 Dec 4 15:47 redis.conf (Redis配置文件)
-rwxrwxr-x 1 root root 271 Mar 27 2018 runtest*
-rwxrwxr-x 1 root root 280 Mar 27 2018 runtest-cluster*
-rwxrwxr-x 1 root root 281 Mar 27 2018 runtest-sentinel*
-rw-rw-r-- 1 root root 7606 Mar 27 2018 sentinel.conf
drwxrwxr-x 3 root root 4096 Dec 4 15:53 src/ (执行脚本)
drwxrwxr-x 10 root root 4096 Mar 27 2018 tests/
drwxrwxr-x 8 root root 4096 Mar 27 2018 utils/
阅读全文 »