Submitted by admin on 2009, February 14, 11:07 AM
./configure --prefix=/www/servers/php --with-apxs2=/www/servers/httpd20/bin/apxs --with-mcrypt=/usr --with-gd=/usr --enable-gd-native-ttf --with-jpeg-dir=/usr --with-png-dir=/usr --with-ttf --with-zlib --with-freetype-dir=/usr --with-mysql=/www/servers/mysql --with-iconv --enable-mbstring --enable-ftp
configure: error: libjpeg.(a|so) not found
ln -sf libjpeg.so.62.0.0 libjpeg.so
configure: error: libpng.(a|so) not found.
yum install libpng-devel
linux | 评论:0
| Trackbacks:0
| 阅读:2078
Submitted by admin on 2009, February 5, 5:34 PM
一
mkdir -p /storage/kickstart_build/isolinux/CentOS
mkdir -p /storage/kickstart_build/isolinux/ks
mkdir -p /storage/kickstart_build/isolinux/image
mkdir -p /storage/kickstart_build/isolinux/repodata
mkdir /storage/kickstart_build/all_rpms
cp -rp /media/isolinux/* /storage/kickstart_build/isolinux
cp /media/.discinfo /storage/kickstart_build/isolinux
cp -rp /media/repodata/comps.xml /storage/kickstart_build
cp -rp /media/CentOS/* /storage/kickstart_build/all_rpms
cd /storage/kickstart_build
chmod +x pare.pl
cd /storage/kickstart_build/isolinux/CentOS
/storage/kickstart_build/pare.pl /storage/kickstart_build/all_rpms i386
cd /storage/kickstart_build/isolinux/CentOS
mkdir /tmp/testdb
rpm --initdb --dbpath /tmp/testdb
rpm --test --dbpath /tmp/testdb -Uvh *.rpm
cd /storage/kickstart_build/isolinux
declare -x discinfo=`head -1 .discinfo`
createrepo -u "media://$discinfo" -g /storage/kickstart_build/comps.xml .
cd /storage/kickstart_build
mkisofs -o MYOS.iso -b isolinux.bin -c boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -R -J -v -T isolinux/
二
1 安装一个简洁的系统
2 安装 anaconda,anaconda-runtime
3 mount,mkdir /centos,cp光盘内所有到/centos
4 剪裁软件包,可根据install.log,放到 /centos/centos,也可直接替换CentOS
5 cd /centos,createrepo -g repodata/coms.xml . 执行两次
6 cp anaconda-ks.cfg ks.cfg
vi isolinux.cfg
default linux > default linux ks=cdrom:/ks.cfg
7 make iso
mkisofs -o MYOS.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -R -J -v -T centos/
linux | 评论:0
| Trackbacks:0
| 阅读:2268
Submitted by admin on 2009, February 4, 2:46 PM
运行perl程序时出现: bad interpreter: No such file or directory 这样的错误提示.
原因:这是在windows下通过写字板或其他编辑工具编写的perl程序,windows环境下每行的结束符是CRLF(Carriage-Return, Line-Feed). 在linux下结束符却是LF,所以每行多了一个CR串.
处理:通过以下脚本对每行结束符进行替换
#!/usr/bin/perl
die "Usage: $0 < files >\n" unless @ARGV;
for $file (@ARGV)
{
open IN, $file or die "$0: Cannot open $file for input!\n";
my @lines = <IN>;
close IN;
open OUT, "> $file" or die "$0: Cannot open $file for output!\n";
s/\r$// for @lines;
print OUT for @lines;
}
linux | 评论:0
| Trackbacks:0
| 阅读:2149
Submitted by admin on 2008, December 13, 3:31 PM
启动sshd提示:
Privilege separation user sshd does not exist
google了一下,找到了解决方法。
方法一(推荐):
修改/etc/passwd文件,在其中加入
sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin
或者
sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin
我加入的是:
sshd:x:109:65534::/var/run/sshd:/usr/sbin/nologin
参考
http://www.unixguide.net/comments/sun/ssh_installation.shtml/37.shtml
http://www.gipsky.com/modules/newbb/viewtopic.php?topic_id=966
方法二(不推荐):
修改/etc/ssh/sshd_config文件
将其中
UsePrivilegeSeparation yes
修改为
UsePrivilegeSeparation no
虽然能解决问题,但是降低了ssh的安全级别。
linux | 评论:0
| Trackbacks:0
| 阅读:1807
Submitted by admin on 2008, December 1, 5:39 PM
rpm2cpio a.rpm | cpio --extract --make-directories
2009.07.03
rpm -ivh kchmviewer-3.1-1.el5.5.x86_64.rpm --prefix=/home/chc/rpms/tmp
因为rpm实际上使用cpio格式打包的,因此可以先转成cpio然后解压,如下所示:
rpm2cpio kchmviewer-3.1-1.el5.5.x86_64.rpm | cpio -div
linux | 评论:0
| Trackbacks:0
| 阅读:1454
Submitted by admin on 2008, November 15, 2:26 PM
Installing PEAR environment: /www/servers/php/lib/php/
/home/r00t/php-5.2.6/sapi/cli/php: error while loading shared libraries: /usr/local/gd/lib/libgd.so.2: cannot rest
ore segment prot after reloc: Permission denied
make[1]: *** [install-pear-installer] Error 127
make: *** [install-pear] Error 2
Nov 14 16:54:45 localhost setroubleshoot: SELinux is preventing /home/r00t/php-5.2.6/conftest from loading /u
sr/local/gd/lib/libgd.so.2.0.0 which requires text relocation. For complete SELinux messages. run sealert -l7f26cea9-91e8-4b3a-93e0-6298e6c4e265
failed to connect to server
chcon -t textrel_shlib_t /usr/local/gd/lib/libgd.so.2
###
checking for MySQL UNIX socket location... /tmp/mysql.sock
checking for mysql_close in -lmysqlclient_r... no
checking for mysql_error in -lmysqlclient_r... no
configure: error: mysql configure failed. Please check config.log for more information.
没找到解决办法,把PHP换为4的就可以了
linux | 评论:0
| Trackbacks:0
| 阅读:1500
Submitted by admin on 2008, November 6, 5:45 PM
linux下硬盘检测工具: smartmontools
工具主页: http://smartmontools.sourceforge.net/
Smartmontools for SCSI硬盘: http://smartmontools.sourceforge.net/smartmontools_scsi.html
smartctl命令参数列表:
The following options are currently available for SCSI disks and tape drives unless otherwise noted:
-
-a | --all : equivalent to the combination -i -H -A -l error -l selftest options invoked in that order.
-
-A | --attributes : outputs the current device temperature, trip temperature, the number of elements in the grown defect list (GLIST) and data from the start-stop log page. Outputs some vendor specific information if available.
-
-C | --captive : used in conjunction with -t short or -t long options to do short or long self tests in the foreground. [Has no effect on tape drives.]
-
-d TYPE | --device=TYPE where TYPE is "ata", "scsi", "sat", "marvell", "3ware,N", "hpt,L/N[,M]" or "cciss,N". Overrides utility's guess about the class of the device which is based on the form of the nominated device's name.
-
-h | --help : outputs lengthy usage message and exits without any other action.
-
-H | --health : outputs single device health metric determined by the device manufacturer. This will be "OK" or a failure message.
-
-i | --info : outputs device identification information (derived from a SCSI INQUIRY command) and whether the device supports SMART (and temperature warnings) and if those facilities are currently enabled. The type of transport (e.g. FC or SAS) is also reported, if available. Some users have reported disks that report the wrong transport.
-
-l TYPE | --log=TYPE where TYPE is either "background", "selftest" or "error". Decodes are outputs the requested log. Note that --all does not include --log=background .
-
-q TYPE | --quietmode=TYPE where TYPE is either "silent" or "errorsonly". When the type is silent then nothing is output to the console but the exit status is set (so it is suitable for scripts). For "errorsonly" only errors are output to the console. The exit status is always set. [See the smartctl man page.]
-
-r TYPE | --report=TYPE where TYPE is either "ioctl[,<n>]" or "scsiioctl[,<n>]". Turns on low level debugging of issued commands and responses. These commands are issued through a system command called an "ioctl" in Unix. The debug can be for all issued commands (i.e. "ioctl") or only SCSI commands ("scsiioctl"). Optionally the TYPE can have a comma and a number post pended to increase the volume of debug. See this section for more details.
-
-s VALUE | --smart=VALUE where VALUE is either "on" or "off". Enables or disables SMART monitoring (and temperature warnings).
-
-S VALUE | --saveauto=VALUE where VALUE is either "on" or "off". Controls whether the error log values are preserved across device power cycles.
-
-t TEST | --test=TEST where TEST is either "offline", "short" or "long". Despite its name "offline" is a short foreground test that all SCSI devices should support. A "short" self test is typically 2 minutes or less. A "long" self test will be considerably longer than 2 minutes, depending on the size of the media. The estimated time that a "long" self test will take is printed after the "selftest" log (i.e. with '-l selftest' or '-a')
-
-V | --version : outputs the smartctl version number (including the cvs version of all its source files) and build information then exits without any other action.
-
-X | --abort : will terminate a background short or long self test. Usually the self test log notes that a self test has been aborted. [Has no effect on tape drives.]
简单用法:
1、smartctl -a <device> 检查该设备是否已经打开SMART技术。
2、smartctl -s on <device> 如果没有打开SMART技术,使用该命令打开SMART技术。
3、smartctl -t short <device> 后台检测硬盘,消耗时间短;
smartctl -t long <device> 后台检测硬盘,消耗时间长;
smartctl -C -t short <device> 前台检测硬盘,消耗时间短;
smartctl -C -t long <device> 前台检测硬盘,消耗时间长。
其实就是利用硬盘SMART的自检程序。
4、smartctl -X <device> 中断后台检测硬盘。
5、smartctl -l selftest <device> 显示硬盘检测日志。
6、smartctl -l error <device> 显示硬盘错误汇总。
或用 badblocks 工具
linux | 评论:0
| Trackbacks:0
| 阅读:1309
Submitted by admin on 2008, November 6, 3:41 PM
一 系统设置
1 查看系统版本 cat /etc/redhat-release
查看内核版本 unmae -r or uname -a
下载centos内核,升级内核 http://mirror.centos.org/ rpm -ivh
2 增加用户,删除用户
3 停掉相关的服务,ntsysv/chkconfig
4 bin md5
5 相关命令程序的s权限
6 相关的内核参数 sysctl
7 检查网卡的传输参数 mii-tool
8 设置运行的tty
9 iptables
二 软件安装(脚本略)
*** glibc detected *** double free or corruption //glibc版本有关
[Fri Oct 24 11:35:58 2008] [alert] (12)Cannot allocate memory: apr_thread_create: unable to create worker thread
Error in my_thread_global_end(): 1 threads didn't exit
[Fri Oct 24 11:54:56 2008] [alert] (12)Cannot allocate memory: apr_thread_create: unable to create worker thread
[Fri Oct 24 11:54:56 2008] [alert] (12)Cannot allocate memory: apr_thread_create: unable to create worker thread
[Fri Oct 24 11:54:56 2008] [notice] seg fault or similar nasty error detected in the parent process
[Fri Oct 24 11:54:56 2008] [notice] seg fault or similar nasty error detected in the parent process
[Fri Oct 24 11:54:57 2008] [notice] child pid 28311 exit signal Segmentation fault (11)
[Fri Oct 24 11:54:57 2008] [notice] child pid 28314 exit signal Segmentation fault (11)
//调整apache参数
linux | 评论:0
| Trackbacks:0
| 阅读:1506