host

Files are not changing when I update them via FTP

隐身守侯 提交于 2019-12-06 04:06:26
I made some changes to a CSS file, uploaded it and saw no change. I cleared my browser's cache, repeated the process and still nothing. I also tried another browser and then experimented with other files - all the same result.I then deleted the CSS file altogether - the website still looks the same and I can still see the files in the browser's console. I can only get results if I actually change the file names altogether (which is really inconvenient). I dont think there is an issue with FTP overwriting the file as there are no errors in FileZillas logs. Is there another way a website can

tomcat配置文件context.xml和server.xml分析

杀马特。学长 韩版系。学妹 提交于 2019-12-06 03:37:02
在tomcat 5.5之前 Context体现在/conf/server.xml中的Host里的<Context>元素,它由Context接口定义。每个<Context元素代表了运行在虚拟主机上的单个Web应用 在tomcat 5.5之后 不推荐在server.xml中进行配置,而是在/conf/context.xml中进行独立的配置。因为server.xml是不可动态重加载的资源,服务器一旦启动了以后,要修改这个文件,就得重启服务器才能重新加载。而context.xml文件则不然,tomcat服务器会定时去扫描这个文件。一旦发现文件被修改(时间戳改变了),就会自动重新加载这个文件,而不需要重启服务器。 context.xml <?xml version='1.0' encoding='utf-8'?> <Context> <!-- 监控资源文件,如果web.xml改变了,则自动重新加载应用 --> <WatchedResource>WEB-INF/web.xml</WatchedResource> <!--本地测试项目--> <!-- name,指定JNDI名称 --> <!-- auth,表示认证方式,一般为Container --> <!-- maxActive,连接池支持的最大连接数 --> <!-- maxIdle,连接池中最多可空闲连接数 --> <!--

asp.netcore 自动挡Docker Nginx Redis(滴滴滴,自动挡)

让人想犯罪 __ 提交于 2019-12-06 03:35:41
原文: asp.netcore 自动挡Docker Nginx Redis(滴滴滴,自动挡) 前言 上一章介绍了Docker通过多条命令创建启动运行Docker容器,由此可见这样一个个去创建单独的容器也是相当麻烦的,比如要在某个复杂项目中用DB、缓存、消息等等,这样我们还要去一个个再创建,为此这时候需要用上我们三剑客中的一员大将自动挡的( DockerCompose ). Compose 是一个用于定义和应用多个容器的工具(镜像、启动命令、端口映射等),一条命令便可配置我们引用中的所有服务. Base Image 指定镜像名称或者镜像Id,如果该镜像不存在,会尝试pull下来。 build 指定Dockerfile文件的路径 build: ./dir 也可以是一个对象。 build: context: ./dir dockerfile: Dockerfile-alternate args: buildno: 1 command 覆盖容器启动后默认执行的命令。 command: bundle exec thin -p 3000 该命令也可以是列表,类似于 dockerfile: command: ["bundle", "exec", "thin", "-p", "3000"] links 链接到其他服务器中的容器,可以指定服务名称和链接的别名使用SERVICE:ALIAS的形式

How to use the optional hostname parameter in Node.js server.listen()

旧时模样 提交于 2019-12-06 03:35:36
问题 From what I've read in tutorials so far, the optional hostname parameter to server.listen(port[, hostname][, backlog][, callback]) has always been either 127.0.0.1 (loopback), 0.0.0.0 (listen on every available network interface, the default option), or one of the actual IP addresses available to the server. Everything else will give an Error: listen EADDRNOTAVAIL . Is that the whole picture? (I believe hostname is technically different from IP...) I wasn't able to find out too much about it

Logstash filter 的使用

雨燕双飞 提交于 2019-12-06 03:31:25
概述 logstash 之所以强大和流行,与其丰富的过滤器插件是分不开的 过滤器提供的并不单单是过滤的功能,还可以对进入过滤器的原始数据进行复杂的逻辑处理,甚至添加独特的新事件到后续流程中 强大的文本解析工具 -- Grok grok 是一个十分强大的 logstash filter 插件,他可以解析任何格式的文本,他是目前 logstash 中解析非结构化日志数据最好的方式 基本用法 Grok 的语法规则是: %{语法 : 语义} “语法”指的就是匹配的模式,例如使用 NUMBER 模式可以匹配出数字,IP 则会匹配出 127.0.0.1 这样的 IP 地址: %{NUMBER:lasttime}%{IP:client} 默认情况下,所有“语义”都被保存成字符串,你也可以添加转换到的数据类型 %{NUMBER:lasttime:int}%{IP:client} 目前转换类型只支持 int 和 float 覆盖 -- overwrite 使用 Grok 的 overwrite 参数也可以覆盖日志中的信息 filter { grok { match => { "message" => "%{SYSLOGBASE} %{DATA:message}" } overwrite => [ "message" ] } } 日志中的 message 字段将会被覆盖 示例 对于下面的log

python 通过ssh跳板机链接redis

可紊 提交于 2019-12-06 03:20:59
from sshtunnel import SSHTunnelForwarderimport redisclass Redislocal(): def redistest(self): server = SSHTunnelForwarder( ssh_address_or_host='', ssh_username='root', ssh_password='', remote_bind_address=('',6379)) server.start() try: r = redis.Redis(host='localhost',port=server.local_bind_port,decode_responses=True,db=2,password="m1i2m3a02") answer =r.get('phone:vcode:reg:base:17621664327') print(answer) return answer except BaseException as e: print('出现异常', e) server.close()if __name__ == '__main__': a = Redislocal() a.redistest() 来源: https://www.cnblogs.com/bibizhou/p/11960089.html

内置方法

亡梦爱人 提交于 2019-12-06 02:48:13
类的内置方法(魔法方法): 凡是在类内部定义,以__开头__结尾的方法,都是类的内置方法,也称之为魔法方法。 类的内置方法,会在某种条件满足下自动触发。 内置方法如下: __new__:在__init__触发前,自动触发。调用该类时,内部会通过__new__产生一个新的对象。 __init__:在调用类时自动触发。通过产生的对象自动调用__init__() 单例模式import settings# 通过classmethodclass MySQL: # 一个默认值,用于判断对象是否存在, 对象不存在证明值是None # __instance是类的属性,可以由类来调用 __instance = None # ---》 执行到代码的57行 ---》 obj # __instance = obj def __init__(self, host, port): self.host = host self.port = port @classmethod def singleton(cls, host, port): # 单例方法 ---》 类方法 # 判断__instance中若没有值,证明没有对象 if not cls.__instance: # 产生一个对象并返回 obj = cls(host, port) # None ---> obj cls.__instance = obj #

Tomcat建立虚拟主机

家住魔仙堡 提交于 2019-12-06 02:32:57
一、 需求和解决思路: 在项目经验中,主机的TCP协议(HTTP协议是基于TCP/IP协议)的80端口是稀缺资源,很多情况下不可能为一个应用而去申请一台主机(不管是物理主机还是虚拟服务器)。这时候很多的Java Web应用会放到一个拥有TCP的80端口的Tomcat下面,由于每个应用都要有自己的域名地址(这里域名后面肯定不能有端口),所以需要我们配置该Tomcat来支持一个IP对应多个域名,甚至一个应用对应多个域名。 二、具体解决方案和步骤: 在开源社区里,一般我们会用linux+tomcat来部署JavaEE应用,这里我们的生产环境也是如此,但是我们可以在Windows的开发环境下完成上述需求。这里我们已经有一个安装好的Tomcat6.0,并且在tomcat目录下自行建立了一个webapps2目录,在webapps和webapps2目录下非别都放置了一个测试项目“6”和“7”。两个项目的web.xml中均配置了: <welcome-file-list> <welcome-file>index.html</welcome-file> </welcome-file-list> 配置虚拟主机和URL重写的具体流程如下: 1. 修改tomcat 6.0的默认访问端口(在conf目录的server.xml中),将8080改为80。 原始: Xml代码 <Connector

IIS 如何设置多个Access-Control-Allow-Origin

六眼飞鱼酱① 提交于 2019-12-06 02:24:31
1,跨域请求ajax,可以增加请求Header,动态添加 System.Collections.Generic.List<string> lHost = new System.Collections.Generic.List<string>(); #region 添加允许跨域请求的域名列表 lHost.Add("www.p2pxinwen.com"); lHost.Add("m.p2pxinwen.com"); #endregion string host = context.Request.UrlReferrer == null ? "" : context.Request.UrlReferrer.Host;//获取从哪个域名发送的ajax请求本页面或者是直接访问 if (lHost.Contains(host)) { //在允许的域名列表里面才添加Access-Control-Allow-Origin响应头 context.Response.AddHeader("Access-Control-Allow-Origin", "http://" + host); }    2,如果跨域请求svg、woff文件,需要在iis中配置响应头,但是只能实现一个域名或者是任意域名,不能是指定的多个域名。    解决办法:1.打开IIS,选择Default Web Site,

python连接sqlserver工具类

一世执手 提交于 2019-12-06 02:24:22
上代码: # -*- coding:utf-8 -*- import pymssql import pandas as pd class MSSQL(object): def __init__(self,host,user,pwd,db): self.host = host self.user = user self.pwd = pwd self.db = db def __GetConnect(self): if not self.db: raise(NameError,"没有设置数据库信息") self.conn = pymssql.connect(host=self.host,user=self.user,password=self.pwd,database=self.db,charset="utf8") cursor = self.conn.cursor() if not cursor: raise(NameError,"连接数据库失败") else: return cursor def ExecQuery(self,sql): cursor = self.__GetConnect() cursor.execute(sql) # 调出数据 resList = cursor.fetchall() #查询完毕后必须关闭连接 self.conn.close() return