centos安装nginx
使用yum 安装 nginx说明阿里云镜像的nginx 的版本为11.20.1-10.el7正常使用也没啥问题,如果想要安装新的,则需要添加nginx源 配置Nginx源rpm -ivh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm 安装12345yum install -y nginxsystemctl enable nginx #设置开机启动systemctl start nginx systemctl stop nginx systemctl restart nginx 引用
spring-session解决session创建销毁事件失效的问题
背景项目中使用了spring-session作为分布式session,session存储采用了sprign-session-jdbc。 同时使用了spring-security作为安全框架 配置如下: 1234567891011121314151617181920212223242526272829303132333435363738394041/** * * @author kewen * @since 2024-08-26 */@Configurationpublic class SessionConfig { private static final Logger log = LoggerFactory.getLogger(SessionConfig.class); /** * 使用 Header方式获取sessionID * * @return */ @Bean HttpSessionIdResolver sessionIdResolver() { return new...
vmvare安装fnos
安装下载就从官网上下载就行了 创建虚拟机 选择稍后安装 选择debian 12 x64 自定义名字和位置 大小飞牛建议20G以上,虚拟磁盘格式随意 点击自定义硬件 CD这里选择下载好的镜像文件 然后完成,就可以开机配置了 配置选硬盘 swap我没要,内存大,不需要内存交换 点击确定,安装 引用
css随笔
选择器12345678910111213141516171819/*id选择器*/#idChose { text-align: center; color: red;}/*class选择器*/.classChose { text-align-last: center; color: #0a58ca;}/*标签选择器*/a { text-align: center; color: deepskyblue; background: #efede8;} 优先级 #(ID选择器) > .(class选择器) > a/p/div/...(元素选择器) 背景 属性 说明 示例 background 简写属性,作用是将背景属性设置在一个声明中。 background: red url(…) no-reapet left top background-color 设置元素的背景颜色。 red / rgba(10, 88, 202, 0.66) /...
pve修改IP地址
修改IP地址进入shell可以通过页面进入shell控制台,也可以远程shell工具连接 执行修改命令 执行vi /etc/network/interfaces 123456789101112131415auto loiface lo inet loopbackiface enp6s0 inet manualauto vmbr0iface vmbr0 inet static address 192.168.5.100/24 gateway 192.168.5.1 bridge-ports enp6s0 bridge-stp off bridge-fd 0source /etc/network/interfaces.d/* 编辑address地址 执行vi /etc/issue 123456789------------------------------------------------------------------------------Welcome to the Proxmox...
PVE安装fnos
简要说明基本上都是默认就行了。cpu至少2核心,类型建议选择host,对性能影响最小 详细安装详细安装参见官网 初始化初始化创建磁盘的时候系统提示至少8G,建议64G。这个根据自己的硬盘情况来选择,但是要注意这里分配的空间用于系统,之后都不可见了,因此需要考虑之后创建存储硬盘的空间。然后SWAP是交换空间,内存大的可以不开启,毕竟有交换空间就会降低内存的效率。 其余正常选择,之后重启 初始密码需要自己设置,配置好了才可以正常使用,否则SSH也是没法使用的
群晖系统优化
硬盘休眠设置https://razeen.me/posts/nas-05-hdd-hibernation/
ubuntu安装mariadb
安装12sudo apt updatesudo apt install mariadb-server 配置1sudo mysql_secure_installation 按照提示执行 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152You already have your root account protected, so you can safely answer 'n'.Switch to unix_socket authentication [Y/n] n ... skipping.You already have your root account protected, so you can safely answer 'n'.Change the root password? [Y/n] y 创建密码New password: Re-enter new password:...
springmvc 多个ControllerAdvice执行的优先级问题分析
1. 背景在一个工程中,基础框架已经定义了一个全局的异常拦截器了,然后在自己的工程中又定义了一个拦截器,省略了部分之后如下: 1234567891011121314151617181920212223@RestControllerAdvicepublic class GlobalExceptionAdvice { private static final Logger log = LoggerFactory.getLogger(GlobalExceptionAdvice.class); /** * 业务异常处理,定义用户可见的异常信息,暂定返回code为1000 * @param exception * @return */ @ExceptionHandler(BaseException.class) public BaseResponse<Void> baseException(BaseException exception){ ...
申请letsEncryp泛域名证书及一键部署nginx
说明阿里云的证书有效期是90天,且只能手动续期,Let’s Encrypt虽然也为90天,但是可以一键续期,这样的话就相当于永久有效了,不用再去手动操作 要从Let’s Encrypt获得证书,您需要选择一个要使用的 ACME 客户端软件。 例如官方推荐的客户端 Certbot 、或者使用得最多的 acme.sh 这里使用acme.sh来实现 安装acme.sh安装参见acmesh-official/acme.sh 中文文档 一键安装命令curl https://get.acme.sh | sh -s email=my@example.com安装完成后会在用户目录下生成acme.sh文件夹,就是程序位置了 由于国内有时候并不能访问github,因此,国内就不能用acme.sh的一键安装了。 需要配置IP vim /etc/hosts 12185.199.108.133 https://raw.githubusercontent.com192.30.255.112 https://github.com 或者国内的gitee,通过git clone的方式git...