Archive for 三月, 2010

linux设置时区的方法

Posted by 机器人 on 31st 三月 2010 in linux/server

首先确定时区,可用tzselect命令来得到所需要的时区。

[root@hqlong ~]# tzselect
Please identify a location so that time zone rules can be set correctly.
Please select a continent or ocean.
1) Africa
2) Americas
3) Antarctica
4) Arctic Ocean Read the rest of this entry »

Iframe跨域访问Cookie和Session的问题

Posted by 机器人 on 17th 三月 2010 in php/javascript

最近忙的一个项目,主要是做一些登录系统的整合,其中遇到的一个最关键的问题为在一个统一的后台里需要无障碍的访问另外一个系统后台,这个系统是第三方提供的一个加过密的系统,后台自动登录接口是自己分析出来的,没有单独提供,当从统一后台通过自动登录接口登录时,系统直接跳转到系统后台首页,后台登录成功后所跳转的URL这里没法指定,控制不了跳转的页面,如果在统一后台里需要链接到这个系统后台的另外一个页面,而非后台默认首页时,也就是将第三方系统后台的菜单功能放到我们这个统一后台里。

对于这样的一个需要,这里会遇到一个问题,为了能正常访问第三方系统的后台栏目,必需确保已经登录该系统,否则会提示用户登录,所以在点击这些菜单链接时,系统必需已经登录。 Read the rest of this entry »

隐藏响应头中apache、php的版本信息

Posted by 机器人 on 12th 三月 2010 in linux/server

1. 当apache没有设置出错页时,如果访问一个不存在的资源,系统会给出如下一段服务器的签名信息:

Apache/2.2.3 (CentOS) Server at 192.168.2.100 Port 80

可通过配置文件的ServerSignature选项来隐藏它.

ServerSignature Off

2. 请求php资源时,会在响应头中提供php的版本信息,如下:

X-Powered-By PHP/5.1.6

Read the rest of this entry »

linux下tomcat安装和配置

Posted by 机器人 on 4th 三月 2010 in java

第一步 下载JDK和tomcat.
linux下下载后直接解压即可,解压下放到/usr/local目录下.
apache-tomcat-6.0.20
jdk1.6.0_18

为jdk和tomcat建立两个软链接到tomcat和java_default.

ln -s /usr/local/apache-tomcat-6.0.20 /usr/local/tomcat
ln -s /usr/local/jdk1.6.0_18 /usr/local/java_default

Read the rest of this entry »