问轩博客

展开菜单

nginx禁止通过ip访问和显示版本

nginx禁止通过ip访问和显示版本
直接在http标签里面添加server_tokens off;server {     listen 80 default_server;     server_name _;     return 404;     或者return 500;      或者rewrite ^(.*) http://www.shnne.com...

redis基本操作

redis基本操作
一、适合全体类型的常用命令(1)EXISTS and DELEXISTS key 判断一个key是否存在;存在返回 1;否则返回0;DEL key 删除某个key,或是一系列key;DEL key1 key2 key3 key4。成功返回1,失败返回0(key值不存在)。(2)TYPE and KEYSTYPE key:返回某个key元素的数据类型 ( none:不存在,string:字符,list,set,zset,hash),key不存在返回空。 KEYS ke...

tomcat的server.xml配置文件注释

tomcat的server.xml配置文件注释
<?xml version='1.0' encoding='utf-8'?><!--<Server>元素代表整个容器,是Tomcat实例的顶层元素.由org.apache.catalina.Server接口来定义. 它包含一个<Service>元素.并且它不能做为任何元素的子元素.     port指定Tomcat监听shutdown命令端...

Redis配置文件介绍

Redis配置文件介绍
daemonize yes #是否以后台进程运行 pidfile /var/run/redis/redis-server.pid    #pid文件位置 port 6379#监听端口 bind 127.0.0.1   #绑定地址,如外网需要连接,设置0.0.0.0 空格分隔 timeout 300   ...

Can't save in background: fork: Cannot allocate memory

Can't save in background: fork: Cannot allocate memory
解决方案直接修改内核参数 vm.overcommit_memory = 1, Linux内核会根据参数 vm.overcommit_memory 参数的设置决定是否放行。vm.overcommit_memory = 1,直接放行vm.overcommit_memory = 0:则比较 此次请求分配的虚拟内存大小和系统当前空闲的物理内存加上swap,决定是否放行。vm.overcommit_memory =2:则会比较进程所有已分配的虚拟内存加上此次请求分配的虚拟内存和系统当前...

shell if 浮点数比较

shell if 浮点数比较
可以通过bc方式的结果集来判断,如:if [ $(echo "$DISK_SIZE <= 10"|bc) = 1 ];then         echo -n "当前磁盘:${DISK_SIZE}G,小于预定的值:${DISK_SIZE_ALERT}G"...

Nginx基本配置文件

Nginx基本配置文件
//nginx默认配置语法 worker_processes    //工作进程, 配置和CPU个数保持一致 error_log           //错误日志, 后面接入的是路径 pid         &nb...

linux系统使用命令获取公网IP

linux系统使用命令获取公网IP
命令行查询(详细): UNIX/Linux: #curl cip.cc Windows: >telnet cip.cc >ftp cip.cc   命令行查询(纯ip): UNIX/Linux: #curl ip.cip.cc #curl ifconfig.me #curl  icanhazip.com 几个网址也非常好记忆 ip.cn ipinfo.i...

nginx配置ssl注意的地方

nginx配置ssl注意的地方
server {     listen 443 ssl; //应该是nginx1.10以上的版本使用     server_name www.shnne.com;     root /data/web/kart;     index inde...

tomcat优化配置参数

tomcat优化配置参数
优化内存,主要是在bin/catalina.bat/sh 配置文件中进行。linux上,在catalina.sh中添加:JAVA_OPTS="-server -Xms1G -Xmx2G -Xss256K -Djava.awt.headless=true -Dfile.encoding=utf-8 -XX:MaxPermSize=256m -XX:PermSize=128M -XX:MaxPermSize=256M"其中:• -server:启用jdk的se...