分类: Linux&Unix

类Linux,类Unix。包括系统及软件。

让Centos 5.x支持4G+的内存

问题解决办法:

yum install kernel-PAE

安装好后 还需要手工修改 引导

vi /boot/grub/grub.conf

如果看到如下代码 代表PAE内核已经安装好了
title CentOS (2.6.18-8.1.4.el5PAE)
root (hd0,0)
kernel /vmlinuz-2.6.18-8.1.4.el5PAE ro root=LABEL=/
initrd /initrd-2.6.18-8.1.4.el5PAE.img
修改设置为默认启动
CODE:default=0

init 6
重启服务器
再执行top 内存已经是4.1G了

以上全部在Centos 5.0系统下执行

尝试用yum安装

CentOS MySQL Apache Php Ngnix 安装配置备忘录

CentOS 5.2
MySQL 5.1.30
Apache 2.2.11
Php 5.2.8
Ngnix 0.6.34

[MySQL]
./configure \
–prefix=/usr/local/mysql \
–localstatedir=/var/lib/mysql \
–with-mysqld-user=mysql \
–enable-assembler \
–with-mysqld-ldflags=-all-static \
#–with-client-ldflags=-all-static \
–with-pthread \
–with-named-thread-libs=-lpthread \
–with-zlib-dir=/usr \
–with-charset=utf8 \
–with-extra-charsets=ascii,binary,gb2312,gbk,big5,utf8,latin1 \
–with-plugins=heap,innobase,myisam,myisammrg \
–with-big-tables \
–without-man \
–with-named-curses-libs=/usr/lib/libncursesw.so.5 \

配置
//增加mysql用户
useradd mysql
scripts/mysql_install_db –user=mysql
//设置权限
chown -R mysql:mysql /usr/local/mysql
chown -R mysql:mysql /var/lib/mysql
chmod -R 750 /usr/local/mysql
chmod -R 750 /var/lib/mysql
//设置配置文件和启动文件
cp support-files/my-small.cnf /etc/my.cnf
cp support-files/mysql.server /etc/init.d/mysqld
chmod 700 /etc/init.d/mysqld
//(慎用)UNIX下执行文件的减肥工具strip
cd /usr/local/mysql/libexec
cp mysqld mysqld.old
strip mysqld
//配置服务
chkconfig –add mysqld
chkconfig –level 345 mysqld on
//启动服务
service mysqld start

[Apache]
./configure \
–prefix=/usr/local/httpd \
–disable-authn-file \
–disable-authn-default \
–disable-authz-host \
–disable-authz-groupfile \
–disable-authz-user \
–disable-authz-default \
–disable-auth-basic \
–disable-include \
–disable-filter \
–disable-charset-lite \
–disable-env \
–disable-setenvif \
–disable-status \
–disable-autoindex \
–disable-asis \
–disable-cgid \
–disable-cgi \
–disable-negotiation \
–disable-actions \
–disable-userdir \
–enable-rewrite \
–enable-deflate \
–with-mpm=worker \
#–enable-so \

配置
//设置配置文件和启动文件
ln -s /usr/local/httpd/bin/apachectl /etc/init.d/httpd
//配置服务
chkconfig –add httpd
chkconfig –level 345 httpd on

[PHP]
gunzip suhosin-patch-5.2.8-0.9.6.3.patch.gz
cd php-5.2.8
patch -p 1 -i ../suhosin-patch-5.2.8-0.9.6.3.patch
rm -fr configure
./buildconf –force
./configure \
–prefix=/usr/local/php \
–with-apxs2=/usr/local/httpd/bin/apxs \
–disable-rpath \
–disable-cli \
–disable-cgi \
–disable-path-info-check \
–disable-short-tags \
–disable-ipv6 \
–disable-all \
–with-pcre-dir \
–with-mysql=/usr/local/mysql \
–with-mysqli=/usr/local/mysql/bin/mysql_config \
–without-pear \
–with-freetype-dir \
–with-png-dir \
–with-jpeg-dir \
–with-xpm-dir \
–with-gd \
–enable-gd-native-ttf \
–with-zlib \
–enable-session \
–enable-spl \
–enable-apc \
–enable-suhosin \
–enable-mbstring \
–enable-xml \
–enable-libxml \
–with-libxml-dir \
–with-libexpat-dir \
–enable-pdo \
–with-pdo-mysql=/usr/local/mysql \
–with-iconv \

#chcon -t texrel_shlib_t /usr/local/httpd/modules/libphp5.so

[Nginx]
./configure \
–prefix=/usr/local/nginx \
–user=www \
–group=www \
–with-http_realip_module \
–without-http_charset_module \
–without-http_gzip_module \
–without-http_ssi_module \
–without-http_userid_module \
–without-http_auth_basic_module \
–without-http_autoindex_module \
–without-http_geo_module \
–without-http_map_module \
–without-http_fastcgi_module \
–without-http_memcached_module \
–without-http_limit_zone_module \
–without-http_empty_gif_module \
–without-http_upstream_ip_hash_module \
–with-zlib=/usr \
–with-pcre=../pcre-7.8 \
–enable-spl \

LINUX服务介绍

为了使用系统运行得更快,更加顺畅,ML 默认打开了一些服务。但是如果你不会使用到这些服务,这些服务将浪费你的宝贵的系统资源,这时,你可以选择关闭或禁用这些服务。
Continue…

The Webalizer安装配置

好久没关注Webalizer,因为n年没更新了,但日前不经意间看到他出2.20-01了,而且还一个月了有。
看看2.20-01新增加的功能,当然你可以看这里 ftp://ftp.mrunix.net/pub/webalizer/CHANGES
Fix就先不说了,我认为比较重要的是下面的2个,其他看说CHANGES。
Added GeoIP support
Added IPv6 support
我对IPv6不是很感冒,估计不是这几年能实行的。
GeoIP ,我本来用的是 Geolizer ,一个patch。应该是同等功效吧。
Continue…

ImageMagick 安装备忘

ImageMagick 默认支持jpeg格式的操作,但默认安装后一直无法使用,报错:no decode delegate for this image format.查看 ImageMagick 支持图片格式:convert -list format 不支持jpeg操作.

原来是未设置jpeg安装的lib和include路径.
./configure CPPFLAGS="-I/usr/local/modules/jpeg6 -I/usr/local/modules/jpeg6/include -I/usr/local/modules/freetype/include -I/usr/local/modules/freetype/include/freetype2" LDFLAGS="-L/usr/local/lib -L/usr/local/modules/jpeg6/lib -L/usr/local/modules/freetype/lib" –prefix=/usr/local/ImageMagick

make && make install

ImageMagick 支持jpeg操作.