25 2011

解决Rsync ERROR: auth failed on module

Category: Apache/nginxlixiphp @ 2011-10-25 19:42:16

今天在两台服务器同步备份在用户权限上纠结了很多,主要关于这个问题网上的配置方法不一,源自rsync版本不一致。

rsync同步备份服务器配置

Rsync 版本

[root@mail video]# rsync –version
rsync  version 3.0.6  protocol version 30
Copyright (C) 1996-2009 by Andrew Tridgell, Wayne Davison, and others.
Web site: rsync.samba.org
Capabilities:
    64-bit files, 64-bit inums, 64-bit timestamps, 64-bit long ints,
    socketpairs, hardlinks, symlinks, IPv6, batchfiles, inplace,
    append, ACLs, xattrs, iconv, no symtimes

rsync comes with ABSOLUTELY NO WARRANTY.  This is free software, and you
are welcome to redistribute it under certain conditions.  See the GNU
General Public Licence for details.

服务器同步任务需求

  • 服务器A与服务器B同步备份,这里只说明服务器A同步到服务器B,服务器B还原到服务器A。
  • 考虑安全因素,使用普通用户进行同步。
  • 使用cronjob,定时同步。

错误提示

错误发生在rsync 3.0.6版本,64位 CentOS5.5 系统。

首页这篇文章主要解决的错误是以下:

@ERROR: auth failed on module ***
rsync error: error starting client-server protocol (code 5) at main.c(1503) [receiver=3.0.6]

*** 是你/etc/rsyncd.conf 中配置的模块,我这里用

password file must not be other-accessible
continuing without password file
Password:
@ERROR: auth failed on module ***
rsync error: error starting client-server protocol (code 5) at main.c(1503) [receiver=3.0.6]

Rsync 配置

#vi /etc/rsyncd.conf

uid = nobody
gid = nobody
max connections = 4
read only = true
#hosts allow = 202.207.177.180
hosts allow = *
transfer logging = true
log format = %h %o %f %l %b
log file = /var/log/rsyncd.log
slp refresh = 300
log file = /var/log/rsyncd.log
pid file = /var/run/rsyncd.pid
lock file = /var/run/rsyncd.lock

[web]
path = /home/admin/public_html
comment = Mirror to Hk server
read only = true
list = false
auth users = lixiphp

[test]
path = /home/admin/domains/test
read only = false
auth users = lixiphp
secrets file = /etc/rsyncd.secrets

配置普通用户密码

[root@mail video]# vi /etc/rsyncd.secrets

格式为: username:password

rsync_user:rsyncofpass

设置权限为只读:

chmod 600 /etc/rsyncd.secrets

首次启动rsync

rsync –daemon –config=/etc/rsyncd.conf

如果提示

failed to create pid file /var/run/rsyncd.pid: File exists

使用指令

rm -rf /var/run/rsyncd.pid

重启已经在运行的rsync

[root@mail video]# ps -ef | grep rsync
root     27284     1  0 10:26 ?        00:00:00 rsync –daemon –config=/etc/rsyncd.conf
root     30516 29986  0 18:35 pts/3    00:00:00 grep rsync
[root@mail video]# kill -9 27284
[root@mail video]# rsync –daemon –config=/etc/rsyncd.conf

这样服务器A配置成功!

阅读更多>>

标签: , , , , , , , , ,


24 2011

腾讯签名支持爱心图标“拒绝冷漠 传递温暖”

Category: Wo De Lifelixiphp @ 2011-10-24 09:12:49

关于近期的一个事件,观看下文:

腾讯签名支持爱心图标“拒绝冷漠 传递温暖”

2岁的小悦悦走了,在她还不懂得什么叫人世冷暖的年纪。两次被车碾压,18个路人无人相救,面对一条鲜活的生命,竟是如此的漠视,让人心寒不已。愿天堂上不再有车来车往,也不会再有人性的冷漠与麻木。

面对事件的发生,我们需要的不仅是关爱和同情,更不是谴责,而是一种拒绝冷漠的反思。 让冷漠不再出现,我们每个人都可以从身边小事做起。推倒高筑的心墙,给他人更多关怀,给需要帮助的人伸出援手。只要你传递了温暖,就没有心的沙漠,就没有爱的荒原。

如果你也认同我们的想法,就和我们一起响应这个倡议:拒绝冷漠,传递温暖。让我们拥有一颗乐于助人的心,一双搀扶他人的双手,让这路上再没有摔倒的弱者,没有冷漠奔走的路人。让我们一起呼唤爱的力量,牵起你我的双手,让真情涌动起来。如果你能做到,请登录QQ后,在QQ签名中输入“/wennuan/”,即可生成一个温暖爱心图标,传递这个倡议。火热的红心洋溢着温暖,驱赶无情的冷漠与冰凉,每一颗温暖的红心背后都是你双手的有力支持!

你能做到吗?

腾讯签名支持爱心图标

多的,我不想表达了,QQ传递我的爱心。

标签: , , , ,


22 2011

iPhone iPad等终端HTML CSS设计

Category: CSSlixiphp @ 2011-10-22 17:01:00

在iPhone、Smartphone 上设计网页和设计打印样式表(print stylesheet)非常相似。页面是竖排版的,所有内容均按行显示。

HTML头信息

<meta charset="utf-8" />
<link rel="shortcut icon" href="favicon.ico" type="image/vnd.microsoft.icon" />
<meta name="Generator" content="LIXIPHP (http://lixiphp.com)" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="MobileOptimized" content="width">
<meta name="HandheldFriendly" content="true">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta http-equiv="cleartype" content="on">
<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">

分别定义:

1、编码Unicode UTF-8

2、浏览器图标地址和类型

3、Generator 生产者

4、网页缩放比例为1:1

5、控制手机布局,width默认为屏幕大小,也可以为具体数字如240、480,Windows Mobile推荐设置为240

6、控制手机放大缩小网页显示

7、控制全屏显示(Apple Safar)

8、ClearType主要是针对LCD液晶显示器设计,可提高文字的清晰度。

9、兼容性

导入CSS样式

<link rel=”stylesheet” type=”text/css” href=”style.css” />

和普通网页一样的方式。

CSS样式表

页面的显示和手机屏幕的分辨率息息相关,分别有以下几个标准:

/* iPhone Smartphone portrait one-col-stack */
@media only screen and (max-width:320px) {
CSS content…
}
/* iPhone Smartphone landscape one-col-vert */
@media only screen and (min-width:321px) and (max-width:480px) {
CSS content…
}
/* iPad Tablet portrait one-col-vert */
@media only screen and (min-width:481px) and (max-width:768px) {
CSS content…
}
/* iPad Tablet landscape three-col-right */
@media only screen and (min-width:769px) and (max-width:1024px) {
CSS content…
}

注意:

  • 不要使用绝对宽度如width:960px; 可以用相对宽度代替如width:100%;
  • 不要使用float元素浮动,手机中的内容都是按行显示的;

预览效果:

iPhone preview IMG_0719

标签: , , , , , ,


20 2011

十款开源在线视频播放器

Category: Opensource,Web 2.0lixiphp @ 2011-04-20 23:40:36

10 Free Open Source embeddable Video Players,在现在网络中比较流行在线视频播放器,比如优酷、土豆、酷六、六间房、腾讯等都自带有在线视频播放的功能。

今天我就目前收集到的十个开源视频播放器与大家一起分享。

Vcastr 3.0 – flash video(flv) player (开源 Open Source)

这是一款国内开发的在线视频播放器,值得首先推荐。在财经网中得到应用。

Vcastr 3.0 – flash video(flv) player (开源 Open Source) image

官方地址:http://www.ruochi.com/main/2008/03/19/vcastr-30/

源码下载:http://vcastr.googlecode.com/svn/trunk/vcastr3/release/src.zip

特点:

  • 使用as3.0重新写了播放器
  • 可以设置循环播放,自动播放,是否直接开始下载,控制栏的颜色和模式
  • 控制栏可以适应超小的尺寸
  • 播放器大小缩小,在20+k左右
  • 可以通过xml对播放器设置
  • 可以播放多个影片,并且有影片列表
  • 可以使用插件扩充播放器的功能
  • 可以用插件设置logo及连接
  • 可以用插件来用javascript控制播放器

JW Player The Web’s top video player. Now with HTML5 support.

The JW Player is JW Player for Flash Version 5 and for Flash is the Internet’s most popular and flexible media player. It supports playback of any format the Adobe Flash Player can handle, as well as HTTP and RTMP streaming and various XML playlist formats. A wide range of configuration options can be set, and an extensive JavaScript API is available. The player’s skinning functionality allows you to completely customize its look, and the plugin architecture allows you to easily extend the player with features such as sharing, analytics and ad serving.

The JW Player’s source code is freely available and can be built entirely using free and open-source software.

JW Player The Web's top video player. Now with HTML5 support.image

官方网址:www.longtailvideo.com/players/jw-flv-player/

源码下载:http://developer.longtailvideo.com/trac/browser/

Flowplayer – Flash Video Player for the Web

flowplayer的是一个开源(GPL3)视频播放器的网站。它经常被网站所有者,开发商,爱好者,企业,程序员所使用。

Flowplayer - Flash Video Player for the Web image

官方网址:http://flowplayer.org/

源码下载:http://releases.flowplayer.org/flowplayer/flowplayer-3.2.7-src.zip

f4Player :: Open Source Flash Video Player (FLV, F4V, MP4)

f4Player是一个开源的Flash(AS3)视频播放器和库项目。它是如此之小只有13kb,完全免费的LGPL许可。

f4Player :: Open Source Flash Video Player (FLV, F4V, MP4) image

特点:

  • 免费,小,快,可定制和互联网上最好的FLV播放器!

阅读更多>>

标签: , , , , , , , , , , , , , , ,


19 2011

PHP移除指定HTML标签的方法

Category: Snippetslixiphp @ 2011-04-19 21:03:58

PHP默认的函数有移除指定html标签,名称为strip_tags,在某些场合非常有用。

strip_tags

(PHP 3 >= 3.0.8, PHP 4, PHP 5)

strip_tags — Strip HTML and PHP tags from a string

string strip_tags ( string str [, string allowable_tags] )

弊端 :

  • 这个函数只能保留想要的html标签,就是参数string allowable_tags。

在yizero的评论中我知道了这个函数的参数allowable_tags的其他的用法。

strip_tags($source, ”); 去掉所以的html标签。

strip_tags($source, ‘<div><img><em>’); 保留字符串中的div、img、em标签。

如果想去掉的html的指定标签。那么这个函数就不能满足需求了。于是乎我用到了这个函数。

移除多个指定的html标签

/**
 * Removes specific  tags.
 */
function strip_only_tags($str, $tags, $stripContent = FALSE) {
  $content = '';

  if (!is_array($tags)) {
    $tags = (strpos($str, '>') !== false ? explode('>', str_replace('<', '', $tags)) : array($tags));
    if (end($tags) == '') {
      array_pop($tags);
    }
  }

  foreach($tags as $tag) {
    if ($stripContent) {
      $content = '(.+<!--'.$tag.'(-->|\s[^>]*>)|)';
    }

    $str = preg_replace('#<!--?'.$tag.'(-->|\s[^>]*>)'.$content.'#is', '', $str);
  }

  return $str;
}

参数说明

$str  — 是指需要过滤的一段字符串,比如div、p、em、img等html标签。
$tags — 是指想要移除指定的html标签,比如a、img、p等。
$stripContent = FALSE  — 移除标签内的内容,比如将整个链接删除等,默认为False,即不删除标签内的内容。

使用说明

$target = strip_only_tags($source, array(‘a’,'em’,'b’));

移除$source字符串内的a、em、b标签。
阅读更多>>

标签: , , , , ,


18 2011

Multiple browser and platform testing

Category: Web 2.0lixiphp @ 2011-04-18 00:31:26

This is my evaluation what is the better way to test website on multiple browser and platform. and it can be a consulting for every website developing.

IETester Software(Free, Recommended)

IETester Software(Free, Recommended) image

Website:
http://www.my-debugbar.com/wiki/IETester/HomePage

Feature:
IETester is a free WebBrowser that allows you to have the rendering and javascript engines of IE9 preview, IE8, IE7 IE 6 and IE5.5 on Windows 7, Vista and XP, as well as the installed IE in the same process.

Weakness:
It will be influenced by local machine system.

Advantage:
It can collect all IE browser together.

Browsershots Online Testing (free or $29.95/month)

Browsershots Online Testing (free or $29.95/month) image

Website:
http://browsershots.org/

Feature:
Browsershots makes screenshots of your web design in different operating systems and browsers. It is a free open-source online web application providing developers a convenient way to test their website’s browser compatibility in one place. When you submit your web address, it will be added to the job queue. A number of distributed computers will open your website in their browser. Then they will make screenshots and upload them to our central dedicated servers for your review.

Weakness:
1. It’s online testing; we can only get a screenshot.
2. Free using will wait for a long time.
3. Just can get a fixed resolution ratio screenshot, maybe it is not we wanted.
4. Every time will choose browser first.
5. Testing a web page will handle many times.

Advantage (Paid user):
1. Your screenshot requests will be processed immediately.
2. You will often get 30 to 50 screenshots within 2 to 5 minutes.
3. Get screenshots of any web address, as often as you want.
4. Pay with Paypal, all major credit card accepted, we don’t have your credit card information.
5. Instant activation after payment made.
6. No need to extend requests to avoid expiration.
7. Your screenshots are private (only you will see them, or somebody who already knows your URL).
8. Ad-free web interface.
9. Dedicated email support from priority@browsershots.org.
10. Your payment supports an open-source project.
阅读更多>>

标签: , , , , , , , , , ,


17 2011

WordPress模板中常用的文章循环代码

Category: Snippetslixiphp @ 2011-04-17 20:02:37

WordPress模板用的使用最常见的代码。

<?php //The Query
query_posts(‘cat=8&order=ASC’) ;?>
<?php //The Loop
if ( have_posts() ) : while ( have_posts() ) : the_post();?>
<!– Place Content Here –>
<?php endwhile; else: ?>
<!– Place Content Here –>
<?php endif;?>
<?php //Reset Query
wp_reset_query();?>

注意:每次循环结束后,请使用wp_reset_query();函数重置查询条件。

PS:WordPress辅助的插件是query-posts.0.3.2

WordPress query-posts.0.3.2 image

Query Posts 挂件自定义设置.

标签: , , , , ,


16 2011

DIV+CSS公司网站模板源码免费下载

Category: CSS,Opensourcelixiphp @ 2011-04-16 21:05:59

此模板是国外公司网站的通用框架,主要提供给学习DIV+CSS的童鞋们学习研究使用。请勿用于任何商业应用。

模板首页预览

image

特征如下:

  • Columns: 1,Columns: 2,
  • Compatible Browsers: IE8, IE9, FireFox 2, FireFox 3, Firefox 3.5, Firefox 3.6, Firefox 4, Safari 4, Safari 5, Opera, Chrome 4, Chrome 5
  • Valid HTML: Yes

模板说明及下载

包含文件列表:

  • 首页 index.html
  • 案例 project.html
  • 服务 services.html
  • 联系 contact.html
  • 主样式表 style.css

图片轮播特效文件列表:

  • jQuery JavaScript Library v1.3.2
  • Easy Slider 1.5 – jQuery plugin

阅读更多>>

标签: , , , , ,


16 2011

Opencart二次开发珍珠购物平台

Category: Projectlixiphp @ 2011-04-16 20:04:48

Opencart是一个轻型的MVC面向对象开发的shopping cart框架,还可以应用到普遍的CMS平台。支持多语言,控制器-模型-视图各个相互独立,低耦合性。

Controller-Model-Language-View,适合独自开发新功能,拓展性很高,亦可去掉自己不想用的控制器,非常灵活。

开发珍珠网购平台

从目前市场上的B2C平台而言。国内出名的B2C商城有:京东商城、凡客、梦芭莎、V+、麦考林等。相对卖珍珠的平台,有手链、项链、戒指、吊坠、耳环等,变种属性各有不同。

珍珠购物平台首页image
珍珠购物平台

珍珠产品详细页面image
略显复杂的珍珠详细页面
阅读更多>>

标签: , , , , , ,


16 2011

大学项目案例总结

Category: Portfoliolixiphp @ 2011-04-16 19:12:50

这是我在大学期间完成的一些项目,虽然技术上不是很好,但是这些项目伴随着我一起成长,已经离开大学一年多了,那时候的记忆还很犹新。

注意排名不分先后。早起作品浏览器兼容个别有问题,请包容!

网站建设

image

image 

奥卡米(Aucamus)团队,请访问http://www.aucamus.com,承接网站建设,电子商务网站,交友类网站等。

中北大学服务集团

中北大学服务集团 网站建设image

阅读更多>>

标签: , ,


Page 1 of 1712345678910...Last »