alamise

Website URL:

Html 转易

  • December 4, 2010
  • Published in Debian

如果不用用单引号的话可以用转义字符
<?php echo"<a href=\"www.gznhgm.cn\">这是一个链接</a>"?>

    zip 压缩

    • November 28, 2010
    • Published in Debian

    如何在Debian下创建zip文件?
    zip软件包可创建zip格式的压缩文件。
    使用如下命令安装:

    #aptitude install zip

     


    使用方法zip [-derRF...][zipfile [file1 file2 ...]]
    基本命令格式是 zip options article inpattern inpattern
    article是新的或已存在的zip文件,inpattern是文件夹或文件路径,可包括通配符。
    -d 删除zip文件中的文件,如

     

    zip -d test.zip test/test

    将删除test.zip文件中的test/test
    -e 创建密码保护的zip文件
    -F 修复zip文件
    -r 递归文件夹结构
    -R 在当前文件夹中递归
    例如:
    1.将当前目录下的test1 test2打包为test.zip文件

     

    $zip test.zip test1 test2


    2.将当前目录下的所有文件和文件夹打包为data.zip,不打包子文件夹。

    $zip data *


    3.将当前目录file中的所有文件和文件夹打包进file.zip文件,递归子文件夹。

    $zip -r file.zip file


    4,将当前文件夹中的所有文件打包为data.zip

    $zip -R data *


    后台执行

    nohup zip -r -n wiki.zip wiki &

      mldonkey 乱码

      • November 16, 2010
      • Published in Debian

      首先检查是否装了locales
      apt-get install locales
      然后
      编辑/etc/init.d/mldonkey-server
      在一堆“#”后的第一行加入

      export LANG=zh_CN.UTF-8

        Mysql start virtualmin debian

        • November 14, 2010
        • Published in Debian

        设置MYSQL

        首先拷贝mysql.server到/etc/init.d目录下命名为mysql
        # cp /自己的安装目录/mysql/share/mysql/mysql.server /etc/init.d/mysql
        然后进入/etc/rc2.d目录,这是debian默认的启动级别。建立连接指向/etc/init.d/mysql
        # cd /etc/rc2.d
        # ln -s /etc/init.d/mysql S20mysql
        重新启动系统后,mysql就自动启动了。
         
         
         
        chown mysql:mysql /var/run/mysqld

         

          睡眠 休眠 硬盘 空间

          • November 13, 2010
          • Published in Debian

          查了下c盘根目录下的休眠文件hiberfil.sys有1G大小,真的要删除它。删除方法可不是直接删除 hiberfil.sys,那删除不了,也不是用windows7自带的磁盘清理,虽然清理项目中会显示出休眠文件,不过是清不掉了,只能通过命令  powercfg -h off 来关闭休眠功能(powercfg -h on是开启)。这是网上搜索到的方法,不过实际使用中,不论你是在开始-运行中,还是通过cmd打开的命令提示符窗口中运行该命令,均不会成功,前者直接 闪下就没了,后者会提示没有权限,再去看hiberfil.sys,还在。

          真正关闭休眠的方法是,找到cmd.exe(在c:\windows\system32下),或直接在开始-运行中输入cmd,这时运行框的上 方程序中会出现cmd.exe(前提你没改了开始菜单的样式),然后右击cmd.exe,在弹出菜单中选择“以管理员身份运行”,再在打开命令提示符窗口 中,输入运行命令 powercfg -h off

          这样才能真正关闭windows7中的休眠,运行完上面的命令后,不用再去删除hiberfil.sys文件了,它会自动消失,看看可用空间,已经增加1G了。

            Install Tomcat Debian

            • November 10, 2010
            • Published in Debian

            摘自  http://easwy.com/blog/archives/install-apache-tomcat-on-debian-lenny/

             

            以下主要参考了文章How to setup Apache Tomcat 5.5 on Debian Etch

            首先,需要安装java JDK。可以直接到sun的网站上下载(现在应该叫Oracle了,最近这些天的事,Sigh!),也可以在Debian仓库中下载。本文介绍由Debian仓库下载的方法。

            打开/etc/apt/sources.list文件,在此文件中加入下面的源:

            # for sun-java packages in unstable
            deb http://ftp.debian.org/debian/ unstable non-free
            deb-src http://ftp.debian.org/debian/ unstable non-free

            保存并退出,然后用下面的命令更新一下源:

            aptitude update 

            然后就可以下载java JDK6了:

            aptitude install sun-java6-jdk 

            关于Apache web server的安装方法就不再描述了,可以参考文章在Debian Lenny上安装Apache2,PHP5,MySQL5, WordPress…。接下来我们安装tomcat:

            aptitude install tomcat5.5 tomcat5.5-admin tomcat5.5-webapps 

            安装完后,在浏览器中输入http://localhost:8180/,如果你能看到Apache Tomcat/5.5的页面,说明你的tomcat已经安装好了。我在输入上述地址时,有时会出现访问异常,不过刷新一下又可以访问了,还不清楚是什么原因。

            接下来,我们需要一个用户,使之具有admin和manager权限,在本例中我们把admin和manager权限赋予用户tomcat。

            首先停用tomcat服务:

            /etc/init.d/tomcat5.5 stop 

            接下来编辑文件 /var/lib/tomcat5.5/conf/tomcat-users.xml ,修改文件内容如下:

            <?xml version='1.0' encoding='utf-8'?>
            <tomcat-users>
            <role rolename="admin"/>
            <role rolename="manager"/>
            <role rolename="tomcat"/>
            <user username="tomcat" password=”tomcatpassword” roles="tomcat,admin,manager"/>

            </tomcat-users>

            保存退出后,重新启动tomcat服务:

            /etc/init.d/tomcat5.5 start 

            现在,就可以访问http://localhost:8180/manager/html来管理tomcat了,用户名为tomcat,密码为tomcatpassword。

              virtualmin apache setting

              • November 6, 2010
              • Published in Debian

              mod_cache.c,mod_mem_cache.c,mod_disk_cache.c

               

               

              Servers --- Apache Webserver ---Global configuration --- Configure Apache Modules --- enable

               

               

              etc/apache2/httpd.conf

               

              LoadModule cache_module modules/mod_cache.so
              <IfModule mod_cache.c>
              LoadModule mem_cache_module modules/mod_mem_cache.so
              <IfModule mod_mem_cache.c>
              CacheEnable mem /images
              MCacheSize 4096
              MCacheRemovalAlgorithm LRU
              MCacheMaxObjectCount 100
              MCacheMinObjectSize 1
              MCacheMaxObjectSize 2048
              CacheMaxExpire 864000
              CacheDefaultExpire 86400
              CacheDisable /php
              </IfModule>
              </IfModule> 

                virtualmin mysql 设置

                • November 6, 2010
                • Published in Debian

                althlon 64  2g内存

                 

                /etc/mysql/my.cnf

                 

                MySQL server listening address

                选择 any 允许 远程连接

                 

                --------------------------------------------------------------------------------------------------------------------------

                VERSION 1

                --------------------------------------------------------------------------------------------------------------------------

                #
                # The MySQL database server configuration file.
                #
                # You can copy this to one of:
                # - "/etc/mysql/my.cnf" to set global options,
                # - "~/.my.cnf" to set user-specific options.
                #
                # One can use all long options that the program supports.
                # Run program with --help to get a list of available options and with
                # --print-defaults to see which it would actually understand and use.
                #
                # For explanations see
                # http://dev.mysql.com/doc/mysql/en/server-system-variables.html

                # This will be passed to all mysql clients
                # It has been reported that passwords should be enclosed with ticks/quotes
                # escpecially if they contain "#" chars...
                # Remember to edit /etc/mysql/debian.cnf when changing the socket location.
                [client]
                port        = 3306
                socket        = /var/run/mysqld/mysqld.sock

                # Here is entries for some specific programs
                # The following values assume you have at least 32M ram

                # This was formally known as [safe_mysqld]. Both versions are currently parsed.
                [mysqld_safe]
                socket        = /var/run/mysqld/mysqld.sock
                nice        = 0

                [mysqld]
                #
                # * Basic Settings
                #
                user        = mysql
                pid-file    = /var/run/mysqld/mysqld.pid
                socket        = /var/run/mysqld/mysqld.sock
                port        = 3306
                basedir        = /usr
                datadir        = /var/lib/mysql
                tmpdir        = /tmp
                language    = /usr/share/mysql/english
                skip-external-locking
                #
                # Instead of skip-networking the default is now to listen only on
                # localhost which is more compatible and is not less secure.
                bind-address        = 127.0.0.1
                #
                # * Fine Tuning
                #
                key_buffer = 384M
                max_allowed_packet    = 32M
                thread_stack        = 128K
                thread_cache_size    = 8
                # This replaces the startup script and checks MyISAM tables if needed
                # the first time they are touched
                myisam-recover        = BACKUP
                #max_connections        = 100
                table_cache            = 512
                sort_buffer_size = 2M
                read_buffer_size = 2M
                read_rnd_buffer_size = 8M
                myisam_sort_buffer_size = 64M

                # Try number of CPU's*2 for thread_concurrency
                thread_concurrency     = 8
                #
                # * Query Cache Configuration
                #
                query_cache_limit       = 1M
                query_cache_size        = 32M
                #
                # * Logging and Replication
                #
                # Both location gets rotated by the cronjob.
                # Be aware that this log type is a performance killer.
                #log        = /var/log/mysql/mysql.log
                #
                # Error logging goes to syslog. This is a Debian improvement :)
                #
                # Here you can see queries with especially long duration
                #log_slow_queries    = /var/log/mysql/mysql-slow.log
                #long_query_time = 2
                #log-queries-not-using-indexes
                #
                # The following can be used as easy to replay backup logs or for replication.
                # note: if you are setting up a replication slave, see README.Debian about
                #       other settings you may need to change.
                #server-id        = 1
                #log_bin            = /var/log/mysql/mysql-bin.log
                expire_logs_days    = 10
                max_binlog_size         = 100M
                #binlog_do_db        = include_database_name
                #binlog_ignore_db    = include_database_name
                #
                # * BerkeleyDB
                #
                # Using BerkeleyDB is now discouraged as its support will cease in 5.1.12.
                skip-bdb
                #
                # * InnoDB
                #
                # InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
                # Read the manual for more InnoDB related options. There are many!
                # You might want to disable InnoDB to shrink the mysqld process by circa 100MB.
                #skip-innodb
                #
                # * Security Features
                #
                # Read the manual, too, if you want chroot!
                # chroot = /var/lib/mysql/
                #
                # For generating SSL certificates I recommend the OpenSSL GUI "tinyca".
                #
                # ssl-ca=/etc/mysql/cacert.pem
                # ssl-cert=/etc/mysql/server-cert.pem
                # ssl-key=/etc/mysql/server-key.pem



                [mysqldump]
                quick
                quote-names
                max_allowed_packet    = 16M

                [mysql]
                #no-auto-rehash    # faster start of mysql but no tab completition

                [isamchk]
                key_buffer        = 16M

                #
                # * NDB Cluster
                #
                # See /usr/share/doc/mysql-server-*/README.Debian for more information.
                #
                # The following configuration is read by the NDB Data Nodes (ndbd processes)
                # not from the NDB Management Nodes (ndb_mgmd processes).
                #
                # [MYSQL_CLUSTER]
                # ndb-connectstring=127.0.0.1


                #
                # * IMPORTANT: Additional settings that can override those from this file!
                #   The files must end with '.cnf', otherwise they'll be ignored.
                #
                !includedir /etc/mysql/conf.d/

                 

                 

                 

                 

                 

                ------------------------------------------------------------------------------------------------------------------

                 

                 



















                [client]
                port        = 3306
                socket        = /var/run/mysqld/mysqld.sock





                [mysqld_safe]
                socket        = /var/run/mysqld/mysqld.sock
                nice        = 0

                [mysqld]



                user        = mysql
                pid-file    = /var/run/mysqld/mysqld.pid
                socket = /var/run/mysqld/mysqld.sock
                port = 3306
                basedir        = /usr
                datadir = /var/lib/mysql
                tmpdir        = /tmp
                language    = /usr/share/mysql/english
                skip-external-locking






                key_buffer = 384M
                max_allowed_packet    = 32M
                thread_stack        = 128K
                thread_cache_size    = 8


                myisam-recover        = BACKUP

                table_cache            = 512
                sort_buffer_size = 2M
                read_buffer_size = 2M
                read_rnd_buffer_size = 8M
                myisam_sort_buffer_size = 64M


                thread_concurrency     = 8



                query_cache_limit       = 1M
                query_cache_size        = 32M



















                expire_logs_days    = 10
                max_binlog_size         = 100M






                skip-bdb
                set-variable = max_allowed_packet=32M
                set-variable = key_buffer=400M





















                [mysqldump]
                quick
                quote-names
                max_allowed_packet    = 16M

                [mysql]


                [isamchk]
                key_buffer        = 16M

















                !includedir /etc/mysql/conf.d/

                 

                 

                ----------------------------------------------------------------------------------------------------------------------

                  php max upload files

                  • November 6, 2010
                  • Published in Debian
                  ; Maximum allowed size for uploaded files.
                  upload_max_filesize = 50M

                  ; Maximum size of POST data that PHP will accept.
                  post_max_size = 50M
                    Subscribe to this RSS feed
                    Notice: Undefined offset: 1 in /var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/pagination.php on line 18

                    Notice: Undefined offset: 1 in /var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/pagination.php on line 34

                    Notice: Undefined offset: 2 in /var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/pagination.php on line 34

                    Notice: Undefined offset: 3 in /var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/pagination.php on line 34

                    Warning: count(): Parameter must be an array or an object that implements Countable in /var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/user.php on line 145

                    Notice: Undefined offset: 1 in /var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/pagination.php on line 18

                    Notice: Undefined offset: 1 in /var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/pagination.php on line 34

                    Notice: Undefined offset: 2 in /var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/pagination.php on line 34

                    Notice: Undefined offset: 3 in /var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/pagination.php on line 34