Home
glider126's Journal
 
[Most Recent Entries] [Calendar View] [Friends]

Below are the 20 most recent journal entries recorded in glider126's LiveJournal:

    [ << Previous 20 ]
    Thursday, February 8th, 2007
    1:53 pm
    openQRM 安装遇到的mysql问题
    <description>
    Additional Notes for 3.1 Instalation:

    This generally applies to servers that have MySQL preinstalled using default RedHat/CentOS distribution, MySQL version 4.1

    If your QRM server won't start / fail during install and your /var/log/qrm/qrm.log file has an error like:
    -------------
    2006-12-10 18:01:46,668 FATAL [ContainerServices] (main:Initial TX) openQRM ser
    ver doesn't suport REPEATABLE-READ transaction isolation level
    Please check your database configuration
    -------------

    You need to modify your TRANSACTION ISOLATION LEVEL to READ COMMITED.
    Log in to your mysql server and run the following command.

    mysql> SET GLOBAL TRANSACTION ISOLATION LEVEL READ COMMITTED;

    Quit MySQL session and restart qrm server in shell:

    # service qrm-server start

    ---------------------------------- - ilya
    </description>
    Friday, April 14th, 2006
    11:14 am
    使用mysqld_multi起做个mysql实例
    cat /etc/mysql/mymulti.cnf
    # This is an example of a my.cnf file for mysqld_multi.
    # Usually this file is located in home dir ~/.my.cnf or /etc/my.cnf
    #
    # SOME IMPORTANT NOTES FOLLOW:
    #
    # 1.COMMON USER
    #
    # Make sure that the MySQL user, who is stopping the mysqld services, has
    # the same password to all MySQL servers being accessed by mysqld_multi.
    # This user needs to have the 'Shutdown_priv' -privilege, but for security
    # reasons should have no other privileges. It is advised that you create a
    # common 'multi_admin' user for all MySQL servers being controlled by
    # mysqld_multi. Here is an example how to do it:
    #
    # GRANT SHUTDOWN ON *.* TO multi_admin@localhost IDENTIFIED BY 'password'
    #
    # You will need to apply the above to all MySQL servers that are being
    # controlled by mysqld_multi. 'multi_admin' will shutdown the servers
    # using 'mysqladmin' -binary, when 'mysqld_multi stop' is being called.
    #
    # 2.PID-FILE
    #
    # If you are using mysqld_safe to start mysqld, make sure that every
    # MySQL server has a separate pid-file. In order to use mysqld_safe
    # via mysqld_multi, you need to use two options:
    #
    # mysqld=/path/to/mysqld_safe
    # ledir=/path/to/mysqld-binary/
    #
    # ledir (library executable directory), is an option that only mysqld_safe
    # accepts, so you will get an error if you try to pass it to mysqld directly.
    # For this reason you might want to use the above options within [mysqld#]
    # group directly.
    #
    # 3.DATA DIRECTORY
    #
    # It is NOT advised to run many MySQL servers within the same data directory.
    # You can do so, but please make sure to understand and deal with the
    # underlying caveats. In short they are:
    # - Speed penalty
    # - Risk of table/data corruption
    # - Data synchronising problems between the running servers
    # - Heavily media (disk) bound
    # - Relies on the system (external) file locking
    # - Is not applicable with all table types. (Such as InnoDB)
    # Trying so will end up with undesirable results.
    #
    # 4.TCP/IP Port
    #
    # Every server requires one and it must be unique.
    #
    # 5.[mysqld#] Groups
    #
    # In the example below the first and the fifth mysqld group was
    # intentionally left out. You may have 'gaps' in the config file. This
    # gives you more flexibility.
    #
    # 6.MySQL Server User
    #
    # You can pass the user=... option inside [mysqld#] groups. This
    # can be very handy in some cases, but then you need to run mysqld_multi
    # as UNIX root.
    #
    # 7.A Start-up Manage Script for mysqld_multi
    #
    # In the recent MySQL distributions you can find a file called
    # mysqld_multi.server.sh. It is a wrapper for mysqld_multi. This can
    # be used to start and stop multiple servers during boot and shutdown.
    #
    # You can place the file in /etc/init.d/mysqld_multi.server.sh and
    # make the needed symbolic links to it from various run levels
    # (as per Linux/Unix standard). You may even replace the
    # /etc/init.d/mysql.server script with it.
    #
    # Before using, you must create a my.cnf file either in /etc/my.cnf
    # or /root/.my.cnf and add the [mysqld_multi] and [mysqld#] groups.
    #
    # The script can be found from support-files/mysqld_multi.server.sh
    # in MySQL distribution. (Verify the script before using)
    #

    [mysqld_multi]
    mysqld = /usr/bin/mysqld_safe
    mysqladmin = /usr/bin/mysqladmin
    user = root
    #password = my_password

    [mysqld1]
    socket = /tmp/mysql.sock1
    port = 3307
    pid-file = /var/lib/mysql1/hostname.pid1
    datadir = /var/lib/mysql1

    [mysqld2]
    socket = /tmp/mysql.sock2
    port = 3308
    pid-file = /var/lib/mysql1/hostname.pid2
    datadir = /var/lib/mysql2

    [mysqld3]
    socket = /tmp/mysql.sock3
    port = 3309
    pid-file = /var/lib/mysql1/hostname.pid3
    datadir = /var/lib/mysql3

    [mysqld4]
    socket = /tmp/mysql.sock4
    port = 3310
    pid-file = /var/lib/mysql1/hostname.pid4
    datadir = /var/lib/mysql4

    [mysqld5]
    socket = /tmp/mysql.sock5
    port = 3311
    pid-file = /var/lib/mysql1/hostname.pid5
    datadir = /var/lib/mysql5



    mysqld_multi --config-file=/etc/mysql/mymulti.cnf stop 1-5
    mysqld_multi --config-file=/etc/mysql/mymulti.cnf start 1-5
    9:17 am
    wsus(Windows Server Update Services)出现 拒绝访问 的解决
    昨晚装好wsus,发现同步的时候内容可以更新,但文件就一个也无法下载,首页上面显
    正在下载 0.0 MB (共 481.22 MB)
    WsusContent里面的文件夹也建立有,但就是没有任何文件。
    查看系统日志
    =================================
    事件类型: 错误
    事件来源: Windows Server Update Services
    事件种类: 同步
    事件 ID: 364
    日期: 2005-6-28
    事件: 23:46:58
    用户: N/A
    计算机: 51Y
    描述:
    内容文件下载失败。原因: 拒绝访问。 源文件: /msdownload/update/v3-19990518/cabpool/js55_eaf71be3367ea937e9a72221a6732b6dcb805848.exe 目标文件: e:\WSUS\WsusContent\86\E6AB1854F736FF97F724392922708434478F8D86.exe。

    有关更多信息,请参阅在 http://go.microsoft.com/fwlink/events.asp 的帮助和支持中心。
    =================================
    网上查找不少资料后终于找到解决方法,就是在服务里面把update services的启动账号改成local system
    Wednesday, April 12th, 2006
    10:17 am
    用tcpdump抓包,ethereal分析包
    tcpdump -s 0 -nn -c 100 -w ~/tcpdump port 16354
    -s 抓取包的长度,0表示抓取整个包
    -nn
    -c 包的个数
    -w 把抓到的包写到文件里面
    port 16354 抓取条件:端口是16354(源端口或者是目的端口)
    Monday, April 10th, 2006
    2:17 pm
    使用脚本批量增加linux 下的用户
    1. 建立Linux用户账号

      使用文本编辑建立一个文本文件,文件名称myusers.list 内容如下:

    user1 123456
    user2 123456
    user3 123456
    user4 123456
    user5 123456
    user6 123456
    user7 123456
    user8 123456
    user9 123456

      注意:第一个字段为使用者名称;第二个字段为预设密码,中间必须用空格隔开。然后使用文本编辑建立另外一个文本文件,文件名称add-users.sh内容如下:

    #!/bin/bash
    for i in `awk '{print $1}' users.list `
    do
    useradd $i
    grep "\<$i\>" users.list | awk '{print $2}' | passwd --stdin $i
    done

      建立Linux用户账号:

      #chmod 775 add-users.sh
      #./add-users.sh
    Tuesday, March 21st, 2006
    4:08 pm
    pptpd的防火墙设置
    # 打开VPN端口1723,还有GRE!!!

    /sbin/iptables -A INPUT -p tcp --dport 1723 -j ACCEPT

    /sbin/iptables -A INPUT -p gre -j ACCEPT

    This article is designed to help troubleshoot the following error and other similar protocol 47(GRE) errors:

    "GRE: read(fd=7,buffer=8056b60,len=8260) from network failed: status = -1 error = Protocol not available"

    Below is a list of the most common causes I came across during my research on these errors.

    #1. Client firewall:

    Make sure your client is not running a software firewall. If it is make sure port 1723 and protocol 47 are allowed.

    Many consumer grade routers have PPTP passthrough disabled by default. On Linksys brand routers there is a section in configuration called 'Filters' that you have to change.

    #2. Server firewall

    Make sure your PPTP server can recieve a connection on port 1723 and that protocol 47 is being allowed or forwarded.

    If your PPTP server has iptables running

    iptables -A INPUT -p tcp --dport 1723 -j ACCEPT
    iptables -A INPUT -p 47 -j ACCEPT

    or if your PPTP server is behind a machine running iptables

    iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 1723 -j DNAT --to SERVER_IP
    iptables -t nat -A PREROUTING -i eth0 -p 47 -j DNAT --to SERVER_IP

    #3. Protocol 47 NOT port 47

    This is a simple but extremely common problem. Do not get port 47 confused with protocol 47. Opening port 47 on your firewall is not the same as allowing protocol 47 or gre.

    #4. Patching kernel and recompiling.

    If you are running ipchains with nat you may find that after trying all the above you still get and error. More than likely you are going to need to patch the kernel source and the iptables source and recompile both. This is a bit more difficult than it sounds due to lack of good documentation. Here are the steps as follows:

    1. Download and install your kernel source.

    2. Download and install the iptables source.

    3. Download the newest patch-o-matic.

    4. Uncompress patch-o-matic. Run './runme pptp-conntrack-nat' making sure the kernel and iptables source directories are correct.

    5. Configure and recompile your kernel, making sure to enable GRE under 'Device Drivers-->Networking Support-->Networking Options-->Network packet filtering (replaces ipchains)-->IP-->GRE Protocol'

    6. After booting the new kernel run 'make' on the iptables source. You should recieve a error similar to the error below. If you don not recieve the error below you are compiling against the wrong kernel headers and need to resolve this by running make with 'KERNEL_DIR=/usr/src/linux'.

    Extensions found: IPv4:recent IPv6:ah IPv6:esp IPv6:frag IPv6:ipv6header
    IPv6:hbh IPv6:dst IPv6:rt
    cc -O2 -Wall -Wunused -I/usr/src/linux/include -Iinclude/
    -DIPTABLES_VERSION=\"1.3.1\" -fPIC -o extensions/libipt_ah_sh.o -c
    extensions/libipt_ah.c
    In file included from /usr/src/linux/include/linux/netfilter_ipv4.h:8,
    from
    /usr/src/linux/include/linux/netfilter_ipv4/ip_tables.h:26,
    from include/libiptc/libiptc.h:6,
    from include/iptables.h:5,
    from extensions/libipt_ah.c:8:
    /usr/src/linux/include/linux/config.h:6:2: #error including kernel
    header in userspace; use the glibc headers instead!
    make: *** [extensions/libipt_ah_sh.o] Error 1

    Look for the line containing something similar to
    '/usr/src/linux/include/linux/config.h:6:2: #error including kernel'
    Edit the file it is pointing to a remove or comment out the following lines:

    #include
    #if !defined (__KERNEL__) && !defined(__KERNGLUE__)
    #error including kernel header in userspace; use the glibc headers instead!
    #endif
    #endif

    Run 'make' again followed by 'make install'. Modprobe 'ip_nat_proto_gre' and 'ip_nat_pptp'. Make sure you have the appropriate rules for iptables setup as per #2. Rerun your firewall script or restart the iptables service.


    Additional Resource:

    http://pptpclient.sourceforge.net/howto-diagnosis.phtml#read_eproto
    http://www.netfilter.org/patch-o-matic/pom-extra.html#pom-extra-pptp-conntrack-nat
    1:54 pm
    MySQL-server-4.0.26-0.i386.rpm不能安装和启动的问题(selinux )
    上午Simon在msn里面说他的一个mysql装上去了启动不起来,于是登上了他的机器看了看。
    是启动不起来,而且.err文件里面就是战场的启动和关闭的信息
    060216 09:25:18 mysqld started
    060216 09:25:18 mysqld ended
    一点都看不出来 ,而且 /var/lib/mysql/mysql下面是空的,没有任何文件。
    http://downloads.mysql.com/archives/mysql-4.0/ 下了一个MySQL-server-4.0.26-0.i386.rpm还是一样~~~
    晕死,不过后来突然想到是不是selinux的问题???
    于是 getsebool -a
    看到 mysqld_disable_trans --> inactive
    不管了,来一个 setsebool mysqld_disable_trans=1
    重新安装MySQL-server-4.0.26-0.i386.rpm,一下子就搞定了~~

    哈哈~~
    setsebool -P mysqld_disable_trans=1 写到配置里面,不然重新启动以后就没效果了




    MySQL-server-4.0.26-0.i386.rpm

    Current Mood: working
    10:52 am
    开启breezy的串口控制台(console)[zt]
    开启breezy的串口控制台(console)
    Filed under: Ubuntu 5.10 (Breezy), Linux, System Admin — jjheng @ 3:57 pm

    串口控制台对于没有显示器(headless)的服务器管理是很重要的,主要从以下几个方面进行设置:

    1、开启grub的串口设置

    * 修改 /boot/grub/menu.lst,在文件头部加入如下行:

    serial - -unit=0 - -speed=9600 - -word=8 - -parity=no - -stop=1
    terminal - -timeout=3 serial console

    2、开启kernel的串口设置

    * 修改 文件/boot/grub/menu.lst中kernel的参数项为如下形式:

    title Ubuntu, kernel 2.6.12-10-686
    root (hd0,6)
    kernel /vmlinuz-2.6.12-10-686 root=/dev/hda8 ro quiet console=tty0 console=ttyS0,9600n8
    initrd /initrd.img-2.6.12-10-686
    savedefault
    boot

    3、开启ttyS0控制台

    * 修改文件/etc/inittab,在文件尾添加如下行:

    co:2345:respawn:/sbin/getty -L ttyS0 9600 vt102

    * 使用telinit命令更新init进程配置:

    $ sudo telinit q
    Wednesday, December 7th, 2005
    1:57 pm
    apache中.map文件的问题

    去除httpd.conf的mod-imap就可以了。



    Apache Module mod_imap

    Available Languages:  en  |  ko 

    Description: Server-side imagemap processing
    Status: Base
    Module Identifier: imap_module
    Source File: mod_imap.c

    Summary

    This module processes .map files, thereby replacing the functionality of the imagemap CGI program. Any directory or document type configured to use the handler imap-file (using either AddHandler or SetHandler) will be processed by this module.

    The following directive will activate files ending with .map as imagemap files:

    AddHandler imap-file map

    Note that the following is still supported:

    AddType application/x-httpd-imap map

    However, we are trying to phase out "magic MIME types" so we are deprecating this method.

    top

    New Features

    The imagemap module adds some new features that were not possible with previously distributed imagemap programs.

    • URL references relative to the Referer: information.
    • Default <base> assignment through a new map directive base.
    • No need for imagemap.conf file.
    • Point references.
    • Configurable generation of imagemap menus.
    top

    Imagemap File

    The lines in the imagemap files can have one of several formats:

    directive value [x,y ...]
    directive value "Menu text" [x,y ...]
    directive value x,y ... "Menu text"

    The directive is one of base, default, poly, circle, rect, or point. The value is an absolute or relative URL, or one of the special values listed below. The coordinates are x,y pairs separated by whitespace. The quoted text is used as the text of the link if a imagemap menu is generated. Lines beginning with '#' are comments.

    Imagemap File Directives

    There are six directives allowed in the imagemap file. The directives can come in any order, but are processed in the order they are found in the imagemap file.

    base Directive

    Has the effect of <base href="value"> . The non-absolute URLs of the map-file are taken relative to this value. The base directive overrides ImapBase as set in a .htaccess file or in the server configuration files. In the absence of an ImapBase configuration directive, base defaults to http://server_name/.

    base_uri is synonymous with base. Note that a trailing slash on the URL is significant.

    default Directive
    The action taken if the coordinates given do not fit any of the poly, circle or rect directives, and there are no point directives. Defaults to nocontent in the absence of an ImapDefault configuration setting, causing a status code of 204 No Content to be returned. The client should keep the same page displayed.
    poly Directive
    Takes three to one-hundred points, and is obeyed if the user selected coordinates fall within the polygon defined by these points.
    circle
    Takes the center coordinates of a circle and a point on the circle. Is obeyed if the user selected point is with the circle.
    rect Directive
    Takes the coordinates of two opposing corners of a rectangle. Obeyed if the point selected is within this rectangle.
    point Directive
    Takes a single point. The point directive closest to the user selected point is obeyed if no other directives are satisfied. Note that default will not be followed if a point directive is present and valid coordinates are given.

    Values

    The values for each of the directives can any of the following:

    a URL

    The URL can be relative or absolute URL. Relative URLs can contain '..' syntax and will be resolved relative to the base value.

    base itself will not resolved according to the current value. A statement base mailto: will work properly, though.

    map
    Equivalent to the URL of the imagemap file itself. No coordinates are sent with this, so a menu will be generated unless ImapMenu is set to none.
    menu
    Synonymous with map.
    referer
    Equivalent to the URL of the referring document. Defaults to http://servername/ if no Referer: header was present.
    nocontent
    Sends a status code of 204 No Content, telling the client to keep the same page displayed. Valid for all but base.
    error
    Fails with a 500 Server Error. Valid for all but base, but sort of silly for anything but default.

    Coordinates

    0,0 200,200
    A coordinate consists of an x and a y value separated by a comma. The coordinates are separated from each other by whitespace. To accommodate the way Lynx handles imagemaps, should a user select the coordinate 0,0, it is as if no coordinate had been selected.

    Quoted Text

    "Menu Text"

    After the value or after the coordinates, the line optionally may contain text within double quotes. This string is used as the text for the link if a menu is generated:

    <a href="http://foo.com/">Menu text</a>

    If no quoted text is present, the name of the link will be used as the text:

    If you want to use double quotes within this text, you have to write them as &quot;.

    top

    Example Mapfile

    #Comments are printed in a 'formatted' or 'semiformatted' menu.
    #And can contain html tags. <hr>
    base referer
    poly map "Could I have a menu, please?" 0,0 0,10 10,10 10,0
    rect .. 0,0 77,27 "the directory of the referer"
    circle http://www.inetnebr.com/lincoln/feedback/ 195,0 305,27
    rect another_file "in same directory as referer" 306,0 419,27
    point http://www.zyzzyva.com/ 100,100
    point http://www.tripod.com/ 200,200
    rect mailto:nate@tripod.com 100,150 200,0 "Bugs?"

    top

    Referencing your mapfile

    HTML example

    <a href="/maps/imagemap1.map">
    <img ismap src="/images/imagemap1.gif">
    </a>

    XHTML example

    <a href="/maps/imagemap1.map">
    <img ismap="ismap" src="/images/imagemap1.gif" />
    </a>

    top

    ImapBase Directive

    Description: Default base for imagemap files
    Syntax: ImapBase map|referer|URL
    Default: ImapBase http://servername/
    Context: server config, virtual host, directory, .htaccess
    Override: Indexes
    Status: Base
    Module: mod_imap

    The ImapBase directive sets the default base used in the imagemap files. Its value is overridden by a base directive within the imagemap file. If not present, the base defaults to http://servername/.

    See also

    top

    ImapDefault Directive

    Description: Default action when an imagemap is called with coordinates that are not explicitly mapped
    Syntax: ImapDefault error|nocontent|map|referer|URL
    Default: ImapDefault nocontent
    Context: server config, virtual host, directory, .htaccess
    Override: Indexes
    Status: Base
    Module: mod_imap

    The ImapDefault directive sets the default default used in the imagemap files. Its value is overridden by a default directive within the imagemap file. If not present, the default action is nocontent, which means that a 204 No Content is sent to the client. In this case, the client should continue to display the original page.

    top

    ImapMenu Directive

    Description: Action if no coordinates are given when calling an imagemap
    Syntax: ImapMenu none|formatted|semiformatted|unformatted
    Context: server config, virtual host, directory, .htaccess
    Override: Indexes
    Status: Base
    Module: mod_imap

    The ImapMenu directive determines the action taken if an imagemap file is called without valid coordinates.

    none
    If ImapMenu is none, no menu is generated, and the default action is performed.
    formatted
    A formatted menu is the simplest menu. Comments in the imagemap file are ignored. A level one header is printed, then an hrule, then the links each on a separate line. The menu has a consistent, plain look close to that of a directory listing.
    semiformatted
    In the semiformatted menu, comments are printed where they occur in the imagemap file. Blank lines are turned into HTML breaks. No header or hrule is printed, but otherwise the menu is the same as a formatted menu.
    unformatted
    Comments are printed, blank lines are ignored. Nothing is printed that does not appear in the imagemap file. All breaks and headers must be included as comments in the imagemap file. This gives you the most flexibility over the appearance of your menus, but requires you to treat your map files as HTML instead of plaintext.
    Tuesday, November 29th, 2005
    6:01 pm
    Remote SSH supported authentication : publickey,gssapi-with-mic,password
    Remote SSH supported authentication : publickey,gssapi-with-mic,password
    Thursday, November 10th, 2005
    11:02 am
    ctorrent FAQ
    How do I check status of my download? 2004-02-01 04:27:56
    Once CTorrent starts to download, all you will see is 1 line of status. It's kind of hard to interpret what all the numbers mean, so here's an example:

    10, [0/334/331], 6070,9845, | 5004,3984 E:3
    10 - Number of connected peers (other people who have the file you are downloading)
    0/334/331 - Downloaded/Total/Available pieces of the file. All pieces may not be availabe at all times since peers go offline.
    6070,9845 - Average downloadspeed (in bytes/s), Average uploadspeed (in bytes/s)
    5004,3984 - Current downloadspeed (in bytes/s), Current uploadspeed (in bytes/s)
    E:3 - The tracker has refused connections 3 times.
    Saturday, October 29th, 2005
    2:44 pm
    php编译参数(gd+mbstring+mysql+freetype)
    './configure' '--prefix=/usr/local/php4.4' '--with-gd=/usr/local/modules/gd' '--with-jpeg-dir=/usr/local/modules/jpeg6' '--with-zlib' '--with-png' '--with-freetype-dir=/usr/local/modules/freetype' '--with-apxs2=/usr/local/httpd/bin/apxs' '--with-java=/usr/java/j2sdk1.4.2_06' '--enable-mbstring' '--with-mysql=/usr/local/mysql'
    Sunday, October 16th, 2005
    9:32 am
    编译内核的步骤
    2.6以前的步骤(进入解压好的kernel代码目录)
    1,make dep
    2,make clean 清除这个目录中以前编译留下的老文件
    3,make zImage (make bzImage)  (/usr/src/linux/arch/i386/boot下)
    4,make modules (编译所选的模块)
    5,make modules_install  (将编译后的模块转移到系统标准位置 /lib/modules/2.x.x.-xx/)
    6,/sbin/mkinitrd /boot/initrd-filename.img modules-directory-name
    7,cp /usr/src/linux/arch/i386/boot/zImage /boot
    8, mv /usr/src/linux/System.map /usr/src/linux/System.map.old
    9,cp /usr/src/linux/System.map /boot/System.map
    10, reboot

    2.6以后(包括2.6)
    1, make (其实等于 make dep; make clean; make bzImage)
    2, make modules
    3, make modules_install
    4, make install
    5, reboot

    如何打补丁
    1,进入内核代码目录
    2,patch -p1 < ../patch-x.y.z
    Saturday, October 15th, 2005
    11:12 am
    怎样查找包含指定字符串的文件
    怎样查找包含指定字符串的文件

    Linux中的find命令很强大,可为什么不支持查找含有某些字符串的文件?

    Linux中的find是不支持这种查找方式。但Linux下可以很方便地用grep配合实现这样的功能。例如,想要查找系统中所有包含“linux”字样的文件,可以使用下面命令:

    find / -name "*" -exec grep -l "linux" {} \
    http://tech.ccidnet.com/art/306/20031110/70701_1.html
    10:55 am
    find /backup/mysqlbak/*.bz2 -mtime +1 -exec file {} \;
    find /backup/mysqlbak/*.bz2  -mtime +1 -exec file  {} \;
    找出一天前修改过的文件(一天前的文件)

    find /backup/mysqlbak/  -mtime +1 -exec rm -f {} \;
    删除一天前修改过的文件(一天前的文件)
    10:30 am
    find /backup/mysqlbak/*.bz2 -mtime +1 -exec file {} \;
    find /backup/mysqlbak/*.bz2  -mtime +1 -exec file  {} \;
    找出一天前修改过的文件(一天前的文件)
    Monday, October 3rd, 2005
    11:19 pm
    值班日记(10-03)
    设置httpd.conf
    Timeout 120
    KeepAlive On
    MaxKeepAliveRequests 100
    KeepAliveTimeout 5
    #超时及保持连接设置
    MinSpareServers 5
    MaxSpareServers 15
    StartServers 8
    #进程启动控制,过多不好,而且导致启动慢
    MaxClients 512
    #最大连接512,根据实际调整
    MaxRequestsPerChild 1024
    #每个进程1024只响应1024次,每响应1024就自动终止本身,并且启用新的进
    #这样可以避免一个进程占用的资源无法回收
    HostnameLookups Off
    #关掉连接进来的主机的名字lookup
    Thursday, September 29th, 2005
    3:01 pm
    xferlog - FTP server logfile
    NAME
           xferlog - FTP server logfile
     
     
    DESCRIPTION
           The xferlog file contains logging information from the FTP
           server daemon, ftpd(8).  This file  usually  is  found  in
           /usr/adm, but can be located anywhere by using a option to
           ftpd(8).  Each server entry is composed of a  single  line
           of  the following form, with all fields being separated by
           spaces.
     
                  current-time   transfer-time   remote-host    file-
                  size    filename    transfer-type   special-action-
                  flag   direction    access-mode    username    ser-
                  vice-name    authentication-method   authenticated-
                  user-id   completion-status
     
     
           current-time        is the current local time in the  form
                               "DDD  MMM dd hh:mm:ss YYYY". Where DDD
                               is the day of the  week,  MMM  is  the
                               month,  dd is the day of the month, hh
                               is the hour, mm is the minutes, ss  is
                               the seconds, and YYYY is the year.
     
           transfer-time       is  the  total time in seconds for the
                               transfer.
     
           remote-host         is the remote host name.
     
           file-size           is the size of the transferred file in
                               bytes.
     
           filename            is the name of the transferred file.
     
           transfer-type       is  a  single character indicating the
                               type of transfer. Can be one of:
                                      a         for an ascii transfer
                                      b         for a binary transfer
     
           special-action-flag is one or more single character  flags
                               indicating  any  special action taken.
                               Can be one or more of:
                                      C         file was compressed
                                      U         file was uncompressed
                                      T         file was tar'ed
                                      _         no action was taken
     
           direction           is  the direction of the transfer. Can
                               be one of:
                                      o         outgoing
                                      i         incoming
     
           access-mode         is the method by  which  the  user  is
                               logged in. Can be one of:
                                      a         (anonymous) is for an
                                                anonymous guest user.
                                      g         (guest)   is  for  an
                                                passworded guest user
                                                (see  the  guestgroup
                                                command   in   ftpac-
                                                cess(5) ).
     
                                      r         (real) is for a local
                                                authenticated user.
     
           username            is the local username,  or  if  guest,
                               the ID string given.
     
           service-name        is  the  name  of  the  service  being
                               invoked, usually FTP.
     
           authentication-method
                               is the method of authentication  used.
                               Can be one of:
                                      0         none
                                      1         RFC931 Authentication
     
           authenticated-user-id
                               is the user id returned by the authen-
                               tication  method.   A  * is used if an
                               authenticated user id  is  not  avail-
                               able.
     
           completion-status   is  a  single character indicating the
                               status of the transfer.   Can  be  one
                               of:
                                      c         complete transfer
                                      i         incomplete transfer
     
    Friday, September 9th, 2005
    11:59 am
    如何让ssh登陆用户chroot
    http://bbs.chinaunix.net/forum/4/050907/607206.html
    看了文章很容易就做出来了
    简要的步骤以及几个要注意的地方
    1,选定一个目录做chroot的根目录
    2,在chroot目录下建立和真实环境一样的目录(不需要全部,只要必须的几个)
    3,把ssh登陆用户需要的程序和 配置文件copy到chroot目录下的相应位置
    (/bin/bash /etc/passwd /etc/shadow /etc/group /etc/gshadown 等等)
    4,把copy到chroot下的程序的运行所需库文件(.o文件)copy到chroot目录的相应位置(ps: ldd /etc/bash 看需要的库文件的名字和位置)
    5. 修改/etc/pam.d/sshd 在末尾加上一句
             session   required    pam_chroot.so
    6.修改/etc/security/chroot.conf
    增加 一行 xxx                    /var/chroot
    说明:     chroot用户名       chroot根目录

    7,重新启动sshd就可以用chroot用户登陆了。

    Thursday, September 8th, 2005
    8:05 pm
    使用snmpwalk查询设备的信息
    snmpwalk 192.168.10.254 -c public -v 2c
[ << Previous 20 ]
About LiveJournal.com

Advertisement