July 19, 2011
CentOS下安装lighttpd
"在向大家详细介绍CentOS lighttpd安装之前,首先让大家了解下CentOS系统作用,然后全面介绍CentOS lighttpd安装,CentOS社区不断与其他的同类社区合并,使CentOS Linux逐渐成为使用最广泛的RHEL兼容版本。CentOS Linux的稳定性不比RHEL差,唯一不足的就是缺乏技术支持,因为它是由社区发布的免费版。希望对大家有用。\nCentOS lighttpd安装\nwget http://www.lighttpd.net/download/lighttpd-1.4.19.tar.gz tar zxvf lighttpd* cd lightt* ./configure –prefix=/usr/local/lighttpd –with-pcre\nCentOS lighttpd安装这时候说缺少pcre-devel\nyum install pcre-devel ./configure –with-pcre make make install\n在ubuntu下用apt-get install lighttpd来安装,方便了很多,CentOS …"
July 15, 2011
Please provide a path to MagickWand-config or Wand-config program的解决办法
"今天在安装lnmp的时候,发现在安装imagick-3.0.1.tgz时,执行\n./configure --with-php-config=/usr/local/php/bin/php-config 的时候,提示以下错误: checking for PHP includes… -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext checking for PHP extension directory… /usr/lib64/php/modules checking for PHP installed headers prefix… /usr/include/php checking for re2c… no configure: WARNING: You will need re2c 0.9.11 or later if you want to regenerate PHP parsers. checking …"
July 14, 2011
很有用的mysqladmin命令
"[root@localhost ~]$ uname -r 2.6.9-22.ELsmp\n[root@localhost ~]$ /usr/local/mysql/bin/mysqladmin version -uroot -p Enter password: /usr/local/mysql/bin/mysqladmin Ver 8.42 Distrib 5.1.22-rc, for redhat-linux-gnu on x86_64 Copyright (C) 2000-2006 MySQL AB This software comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to modify and redistribute it under the GPL license\nServer version 5.1.22-rc-log Protocol version 10 Connection Localhost via UNIX socket UNIX socket …"
July 13, 2011
nginx [emerg]: getpwnam(“www”) failed
"在配置nginx提示如下错误时:\n[emerg]: getpwnam(“www”) failed\n解决方案: 在nginx.conf中 把#user nobdy改为user www www既可.\n如果还提示同样的错误,请检查www组和www用户是否存在,不存在的话,直接创建即可\n/usr/sbin/groupadd www /usr/sbin/useradd -g www www"
July 12, 2011
[教程]为PHP安装phpRedis扩展模块
"一.安装phpredis\n# wget https://download.github.com/owlient-phpredis-2.1.1-1-g90ecd17.tar.gz # tar -zxvf owlient-phpredis-2.1.1-1-g90ecd17.tar.gz # cd owlient-phpredis-2.1.1-1-g90ecd17 # /usr/local/php/bin/phpize # ./configure –with-php-config=/usr/local/php/bin/php-config # make \u0026amp;\u0026amp; make install\n修改php.ini文件,应用扩展\n# /usr/local/php/etc/php.ini 加入: extension=redis.so\n重启httpd\n# service httpd -k restart\n我这里使用的是php-fpm模块运行的Nginx\n/usr/local/php/sbin/php-fpm restart\n通过phpinfo()函数查看,可以看到redis扩展\n如果想 …"
July 12, 2011
phpize简介
"phpize 是属于 php-devel 中的东西,主要是设定 php 外挂模块的一些设定\n所以安装 php-devel 相关套件就会有 phpize 可以使用 (档案预设存放于 /usr/bin/phpize )\nphpize 命令是用来准备 PHP 外挂模块的编译环境的。下面例子中,外挂模块的源程序位于 extname 目录中:\n$ cd extname $ phpize $ ./configure (注一) $ make $ make install\n成功的安装将建立 extname.so 并放置于 PHP 的外挂模块目录中 (预设存放于 /usr/lib/php/modules/ 内) 。\n需要调整 php.ini,加入 extension=extname.so 这一行之后才能使用此外挂模块。\n注一:\n如在执行 ./configure 时出现 not find –with-php-config 时,\n可重下以下指令,因 –with-php-config 预设在 /usr/bin/php-config 可找到\n./configure …"
July 11, 2011
统计apache日志中每日访问IP中访问量最多的100个IP
"统计apache日志中每日访问IP中访问量最大的100个IP地址\ncat access.log |awk ‘{print $1}’|sort|uniq -c|sort -nr|head -100 \u0026gt; 37res.txt\n来源:"
July 9, 2011
升级centos内核
"因要测试一些软件,需要2.6.30以上的内核,安装好CentOS 5.5,内核是2.6.18-194.el5.这次的升级还算比较顺利,具体的过程如下:\n[root@localhost ~]# uname -r 2.6.18-194.el5\n1.下载linux-2.6.30内核包到/usr/src目录\ncd /usr/src wget ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.30.tar.gz tar -xzvf linux-2.6.30.tar.bz2 -C /usr/src cd linux-2.6.30 make mrproper 清除环境变量,即清除配置文件 make menuconfig 在菜单模式下选择需要编译的内核模块:\nnetworking support—\u0026gt;networking options—\u0026gt;network packet filtering framework(netfilter)\n(1).core netfilter configuration A 勾中”Netfilter …"
July 8, 2011
linux下 lvm 磁盘扩容
"打算给系统装一个oracle,发现磁盘空间不足。在安装系统的时候我选择的是自动分区,系统就会自动以LVM的方式分区。为了保证系统后期的可用性,建议所有新系统安装都采用LVM,之后生产上的设备我也打算这样做。\n参于LVM基本介绍与常用命令请参考:\nLVM结构图\n扩容之前的磁盘状况\n[root@localhost ~]# df -h\n文件系统 容量 已用 可用已用%%挂载点\n/dev/mapper/VolGroup-lv_root 5.3G 2.5G 2.6G 50% /\ntmpfs 538M 0 538M 0% /dev/shm\n/dev/sda1 485M 30M 430M 7% /boot\n[root@localhost ~]# fdisk -l\nDisk /dev/sda: 8589 MB, 8589934592 bytes\n……………\nDevice Boot Start End Blocks Id System\n/dev/sda1 * 1 64 512000 83 Linux\nPartition 1 does not end on cylinder boundary. …"
July 8, 2011
centos下安装新硬盘
"下面的操作是在vmware下进行的.使用的是scsi硬盘.\n一.新添加一个硬盘后,用fdisk -l查看的时候,没有发现新硬盘,后台重启了下linux.再次使用fdisk -l命令即可看发现新添加的硬盘.新使用大小为5G.\n由于我们安装系统的时候用的一块scsi硬盘,SCSI接口设备是用sd命名的.所以第一块硬盘显示的是/dev/sda.当添加第二块scsi硬盘的时候,就成了/dev/sdb了.依次类推.如果使用的是 IDE 硬盘的话,则是 hda ,hdb,hdc…,同样依次类推.\n二.使用fdisk进行分区\n#fdisk /dev/sdb\nDevice contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel Building a new DOS disklabel. Changes will remain in memory only, until you decide to write them. After that, of course, the previous content …"