欢迎来到天宇星空!
分页: 1/19 第一页 1 2 3 4 5 6 7 8 9 10 下页 最后页 [ 显示模式: 摘要 | 列表 ]

crontab配置

[不指定 2009/07/02 12:16 | by 成刚 ]

cron 是linux的内置服务,可以用以下的方法启动、关闭这个服务:
引用:
/sbin/service crond start //启动服务
/sbin/service crond stop //关闭服务
/sbin/service crond restart //重启服务
/sbin/service crond reload //重新载入配置
/etc/rc.d/init.d/crond start

/etc/rc.d/init.d/crond stop
你也可以将这个服务在系统启动的时候也自动启动:
引用:
在/etc/rc.d/rc.local这个脚本的末尾加上:
/sbin/service crond start

现在cron这个服务已经在进程里面了,我们就可以用这个服务了,cron服务提供以下几种接口供大家使用:

Tags: , ,

查找和对比了n多代码,没有找到特别合适的,只是在结合一些代码之后做些修改,能做到滚动不停歇、不闪烁的滚动。
代码如下:(有更好的请告诉我,学习学习)
JS函数部分
var startmarquee=function(obj,lh,speed,delay){
 var p=false;
 var t=setInterval(scrolling,speed);
 var o=document.getElementById(obj);
 o.innerHTML+=o.innerHTML;
 o.style.marginTop=0;
 
 function start(){
  o.onmouseover=function(){
   p=true;
   clearInterval(t);
   setTimeout(start,delay);
  }
  o.onmouseout=function(){
   p=false;
   setTimeout(start,delay);
  };
  
  if(!p){
   o.style.marginTop=parseInt(o.style.marginTop)-1+"px";
   clearInterval(t);
   t=setInterval(scrolling,speed);
  }
 }

 function scrolling(){
  if(parseInt(o.style.marginTop)%lh!=0)
  {
   o.style.marginTop=parseInt(o.style.marginTop)-1+"px";
   if(Math.abs(parseInt(o.style.marginTop))>=o.scrollHeight/2) o.style.marginTop=0;
  }
  else{
   clearInterval(t);
   setTimeout(start,delay);
  }
 }
 setTimeout(start,delay);
}

调用:
var new1=startmarquee("new1",66,50,2);
参数分别为:滚动div的id,滚动块高度,速度(毫秒),滚动完一个回合暂停时间。

Tags: , , ,

首先,请到http://sourceforge.net/projects/phpmailer下载最新的phpmailer类库,目前最新版是2.3。解压到网站根目录下的include文件夹下(视网站目录而定),去掉版本号,改名为phpmailer

下面是已经发送成功的代码:
<?php
require_once 'include/phpmailer/class.phpmailer.php';
$to = ''; //目的邮件帐号
$tomame = ''; //目的邮件称呼
$fromname = $POST['myname'];
$frommail = $_POST['myemail'];
//邮件主题
$subject = "我在白米饭上发现个好东东,过来看看吧!";
//邮件内容
$body = '
<html><head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=GB2312"></head>
<body>
尊敬的'.$_POST['fname'].'<br />您的朋友'.$_POST['myname'].'
在<a href="
http://www.chenggang.net">http://www.baimifan.cn</a> <br />
发现一个好东西,邀您一起分享!<br />
<a href="
http://www.baimifan.cn/earrings.html">http://www.baimifan.cn/earrings.html</a
>
</body>
</html>
';

$mail = new PHPMailer();
$mail->IsSMTP(); // send via SMTP

Tags: ,

/*********************************
Title:Subversion在linux下的安装与使用(和Apache配套使用)
Author:成刚<chenggang2008@foxmail.com>
Date:2008-7-8
Modify:2008-10-24
**********************************/

安装机器: 192.168.2.180
操作系统: CentOS 5.2

/program/apache/为服务器上的apache安装目录

注意:安装subversion需要autoconf 2.58或以上版本、libtool 1.4或以上版本、gcc、libapr and libapr-util支持。


1、下载软件
httpd-2.2.9.tar.gz (http://www.apache.org)
subversion-1.5.1.tar.gz (http://subversion.tigris.org/)

2、编译安装httpd(如果您已经安装过Apache,并且配置Apache时,有这两个参数"--enable-dav --enable-so",则可省略此步骤,否则需要重新编译)
先停止apache:
/program/apache/bin/apachectl stop
然后再重装编译安装apache:
tar xvfz httpd-2.2.9.tar.gz
cd httpd-2.2.9
./configure --prefix=/program/apache --enable-dav=share --enable-so --enable-rewrite=share --enable-proxy=share --enable-proxy-ajp=share --with-apr=/program/apr --with-apr-util=/program/apr-util
make
make install

注意:以上配置Apache中的前两个参数(--enable-dav --enable-so)是必须要加的,你还可以根据您的需要添加其他的参数。
/program/apache/bin/apachectl start,打开浏览器http://192.168.2.180/,如果有测试页出现则证明已经安装成功。

Tags: , ,

Apache服务器的性能优化

[不指定 2009/02/26 22:47 | by 成刚 ]
参考文档:1.http://www.chinabyte.com/215/2262215.shtml
2.http://blog.csdn.net/phphot/archive/2008/06/13/2544949.aspx

                通过挤出Apache服务器的每一分潜力你可以让你的网站留给别人的印象大大改观,特别是对一些动态网站更是如何。这篇文章主要涉及到对Apache服务器的安装和设置如何进行优化,这也是你最有控制权的部分。

          影响Apache服务器性能的方面很多,Apache所在的机器与操作系统环境是对性能影响最大因素,这里我们主要讲一下提高Apache服务器速度的一些通常做法以及它如何与构成WEB网站的其它组件进行交互。

一、apache普通配置参数

1、静态还是动态
      使用apache的动态载入模块非常方便,因为在需要时模块才会被载入。虽然有些性能开销,但同时有利于减少服务器对内存的需求。
静态载入虽然一次性载入所有需要的模块,增加内存消耗。因此我们全部采用动态载入的方法。

2、优化静态内容
      如果你的WEB服务器使用了大量静态内容或者你分别用两个WEB服务器处理动态和静态内容,那么你现在的主要目标就是缩短服务器发送被请求内容的响应时间,最简单的方法就是使用mod_cache缓存模块。你可以使用mod_disk_cache和mod_mem_cache来分别提供基于磁盘的缓存和基于内存的缓存。

3、配置mod_expires模块(这个非常有用的优化哦)
      mod_expires可以减少20-30%左右的重复请求,让重复的用户对指定的页面请求结果都CACHE在本地,根本不向服务器发出请求。除开用户有发送no-cache才会更新,但要注意更新快的文件不要这么做.
      mod_expires的安装配置:

ExpiresActive On
ExpiresDefault A60
ExpiresByType image/x-icon A2592000
ExpiresByType application/x-javascript A2592000
ExpiresByType text/css A2592000
ExpiresByType image/gif A604800
ExpiresByType image/png A604800
ExpiresByType image/jpeg A604800
ExpiresByType text/plain A604800
ExpiresByType application/x-shockwave-flash A604800
ExpiresByType video/x-flv A604800
ExpiresByType application/pdf A604800
ExpiresByType text/html A60

分页: 1/19 第一页 1 2 3 4 5 6 7 8 9 10 下页 最后页 [ 显示模式: 摘要 | 列表 ]