pyzheng
pyzheng · 共 1633 篇文章
跟我学Shiro目录贴
原文教程列表: http://jinnianshilongnian.iteye.com/blog/2018398 SpringMvc + Shiro 配置 ; http://my.oschina.net/wangt10/blog/523015 , 包含一个基础框架. 将 Shiro 作为应用的权限基础 五:密码的 加密/解密 在Spring中的应用 http://my.oschina.net/u/1425545/blog/543501 shiro不跳转successUrl问题 http://my.oschina.net/u/1020238/blog/544612
linux shell 中"2>&1"含义
export date_str=$(date "+%Y-%m-%d_%H%M%S") echo $date_str #pg_dump --host 202.105.182.135 --port 5432 --username "postgres" --role "postgres" --no-password --format custom --blobs --verbose --file "/home/pandy/db_$date_str.bakup" "rhcpm_saas" pg_dump --host 192.168.0.xxx --port 5432 --username "pos…
2015-10-26 15:09 · OS&Docker · 评论(0)
Hibernate envers开发指南
http://www.blogjava.net/xmatthew/archive/2010/08/22/329521.html 介绍: Hibernate Envers目的是根据对实体的设置, 提供记录执行数据变更历史的功能 (数据变更版本)。它实现原理是通过对Hibernate的操作事件监听并根据 基于Annoatation的配置来记录修改数据的内容。 .............. 详细见原文
2015-10-24 00:44 · Hibernate&MyBatis · 评论(0)
tomcat session共享: 同tomcat不同项目之间的session共享
[url]http://my.oschina.net/huangcongcong/blog/521025[/url] 有时我们会遇到一个大点的项目,为了方便实现有些功能,我们会把项目拆成不同的独立web项目。 但我们在管理这些项目时,只有一个登陆口,然后在其他项目取session来实现身份的验证。 查看tomcat 关于 HTTP Connector 中有个emptySessionPath 其解释如下: If set to true, all paths for session cookies will be set to /. This can be useful for portlet …
2015-10-24 00:03 · 开源应用 · 评论(0)
java的double的大数值时 如何才能不显示成科学计数法
Double d = new Double("1234567890.12"); System.out.println("d:="+d); java.text.NumberFormat nf = java.text.NumberFormat.getInstance(); nf.setGroupingUsed(false); System.out.println("d:="+nf.format(d)); 显示结果是: d:=1.23456789012E9 d:=1234567890.12
2015-10-23 16:40 · Java · 评论(0)
apache配置多个域名访问同一个虚拟主机
[url]http://bbs.csdn.net/topics/380248520[/url] apache 2.2 在httpd-vhosts.conf里怎么配置一个域名都访问一个地方。 现在我的做法是配置三个VirtualHost,很正常,就是想把他们都整在一起。 试了一下:ServerName kj.scsyyjxh.org kj.scsyx.com kj.scsyx.org 这样做不行。 哪位知道怎么做。 [code="java"] ServerName kj.scsyyjxh.org ProxyPass / http://localhost:89/ ProxyPassReverse…
2015-10-22 10:35 · 开源应用 · 评论(0)
配置Apache 虚拟主机支持二级域名的两种方法
Apache配置虚拟目录和二级域名[url]http://skyfen.iteye.com/blog/515221[/url] 原文:[url]http://wenku.baidu.com/view/0f292120a5e9856a56126018.html?re=view[/url] [color=red][b]方法一. 利用 Apache 的 mod_vhost_alias[/b][/color] 引用: [code="java"]#LoadModule vhost_alias_module modules/mod_vhost_alias.so 去掉前面的# ServerAdmin hh…
2015-10-22 08:55 · 开源应用 · 评论(0)
apache + tomcat 负载均衡模式下 getLocalAddr() 为null的解决办法
http://www.51lingguang.com/?p=504 在apache + tomcat 负载均衡模式下,通过request.getLocalAddr()无法获取服务器端的ip地址,返回值为null的问题,查找了下,百度里没有有价值的回答,到官方网站上查找了下,说是: The AJP protocol only passes the web server host name and port. It does not pass the IP address. Therefore, getLocalName() will return whatever is passed via …
2015-10-20 22:28 · Java · 评论(0)
管理Redis的Web工具 PyRedisAdmin
http://www.oschina.net/p/pyredisadmin PyRedisAdmin 是一个方便查看和管理Redis数据的web界面工具,使用Python开发。基于开源的轻量级python Web框架Mole 构建而成,不依赖于其他第三方库,部署相当方便,可以轻松浏览和管理千万级以上的海量数据。 使用 下载源码 配置config.py,加入要管理的redis的主机地址和端口 运行: python routes.py
Apache的prefork模式和worker模式
[size=medium][color=red]apache常用的工作模式有prefork和worker模式。运行命令httpd -l 或者apache2 -l ,输出的结果中如果含有prefork.c,那就是prefork模式,如果结果中含有worker.c,那就是worker模式。[/color][/size] 原文:[url]http://www.ccvita.com/339.html[/url] [b]prefork模式[/b] 这个多路处理模块(MPM)实现了一个非线程型的、预派生的web服务器,它的工作方式类似于Apache 1.3。它适合于没有线程安全库,需要避免线程兼容性问题…
2015-10-18 00:25 · 工具软件 · 评论(0)
查看Apache并发请求数及其TCP连接状态
http://zyan.cc/post/269/ 这两天搭建了一组Apache服务器,每台服务器4G内存,采用的是prefork模式,一开始设置的连接数太少了,需要较长的时间去响应用户的请求,后来修改了一下Apache 2.0.59的配置文件httpd.conf: # prefork MPM StartServers: number of server processes to start MinSpareServers: minimum number of server processes which are kept spare MaxSpareServers: maximum numb…
2015-10-18 00:23 · 工具软件 · 评论(0)
tomcat如何使用Gzip对静态文件压缩
tomcat7配置gzip没有效果 [url]http://www.oschina.net/question/142859_70497[/url] tomcat7里面js的mime类型改了,新版的是: web.xml [code="xml"] js application/javascript [/code] Tomcat配置改为: server.xml [code="xml"][/code] Tomcat 采用的是 HTTP/1.1 的 GZIP 压缩协议,它会根据浏览器送过来的请求中的 accept-encoding 值是否包含 gzip 来判断浏览器是否支持 gzip 压缩协议,如果浏…
2015-10-18 00:03 · 工具软件 · 评论(0)
PostgreSQL 允许远程访问设置方法
http://blog.csdn.net/ll136078/article/details/12747403 安 装PostgreSQL数据库之后,默认是只接受本地访问连接。如果想在其他主机上访问PostgreSQL数据库服务器,就需要进行相应的配置。 配置远 程连接PostgreSQL数据库的步骤很简单,只需要修改data目录下的pg_hba.conf和postgresql.conf。 pg_hba.conf:配置对数据库的访问权限, postgresql.conf:配置PostgreSQL数据库服务器的相应的参数。 下面 介绍配置的步骤: ** 1.修改pg_hba.conf文件**,配…
2015-10-16 14:47 · Database · 评论(0)
关于ubuntu 下安装的php和apache2 如何配置多虚拟主个机
[url]http://my.oschina.net/u/1040928/blog/516851[/url] 在ubuntu 下 安装apache2完成后 在/etc/apache2/目录下是看不到httpd.conf的 因为被apache2.conf代替了. 不重要 ,只是名字不一样而已 默认情况下 访问127.0.0.1 是读取sites-available的conf配置的 为了支持 多歌虚拟主机的配置我们需要做以下操作 1.在apache2目录下 手动添加 extra 文件夹 ,并在extra文件加下添加一个 httpd-vhost.conf文件 2.打开apache2.conf 对 …
2015-10-14 09:22 · 工具软件 · 评论(0)
linux 统计文件夹大小
linux 统计文件夹大小 http://www.51testing.com/html/43/2243-197686.html Linux下查看目录大小的命令是du,从man中找到几个常用的参数就可以轻松的统计某个文件夹的容量. 1.统计出目录的总大小,并以比较合适的单位表示 -h, --human-readable print sizes in human readable format (e.g., 1K 234M 2G) -s, --summarize display only a total for each argument $ du -hs /boot 5.7M /boot 2.…
2015-10-13 22:25 · OS&Docker · 评论(0)