下载所需软件
wget -c http://mirror.bjtu.edu.cn/apache/httpd/httpd-2.2.22.tar.gz
    wget -c http://stderr.net/apache/rpaf/download/mod_rpaf-0.6.tar.gz
                    安装apache
                tar zxvf httpd-2.2.22.tar.gz
                cd httpd-2.2.22/
                ./configure –prefix=/usr/local/apache –enable-headers –enable-mime-magic –enable-proxy –enable-so –enable-rewrite –enable-ssl –enable-deflate –enable-suexec –disable-userdir –with-included-apr –with-mpm=prefork –with-ssl=/usr –disable-userdir –disable-cgid –disable-cgi
                make && make install
                cd ..
                centos64出现错误

                    make[2]: *** [htpasswd] Error 1
                    make[1]: *** [all-recursive] Error 1
                    解决办法
                    mv /usr/lib/libm.a /usr/lib/libm.a.bak
                    mv /usr/lib/libm.so /usr/lib/libm.so.bak
                    mv /usr/lib/libexpat.so /usr/lib/libexpat.so.bak
                    ln -s /usr/lib64/libm.a /usr/lib/libm.a
                    ln -s /usr/lib64/libm.so /usr/lib/libm.so
                    ln -s /usr/lib64/libexpat.so /usr/lib/libexpat.so
                     
                    apache的配置文件采用了lnmp.org 上的配置方法,到lnmp.org下载lnmp0.9获取。
                    mv /usr/local/apache/conf/httpd.conf /usr/local/apache/conf/httpd.conf.bak
                    cp /root/lnmp0.9/conf/httpd.conf /usr/local/apache/conf/httpd.conf
                    cp /root/lnmp0.9/conf/httpd-default.conf /usr/local/apache/conf/extra/httpd-default.conf
                    cp /root/lnmp0.9/conf/httpd-vhosts.conf /usr/local/apache/conf/extra/httpd-vhosts.conf
                    cp /root/lnmp0.9/conf/httpd-mpm.conf /usr/local/apache/conf/extra/httpd-mpm.conf
                    cp /root/lnmp0.9/conf/rpaf.conf /usr/local/apache/conf/extra/rpaf.conf
                     
                    sed -i ‘s/#ServerName www.example.com:80/ServerName ‘web1.iamle.com’:88/g’ /usr/local/apache/conf/httpd.conf
                    sed -i ‘s/ServerAdmin you@example.com/ServerAdmin ‘i##iamle.com’/g’ /usr/local/apache/conf/httpd.conf
                    sed -i ‘s/www.lnmp.org/’web1.iamle.com’/g’ /usr/local/apache/conf/extra/httpd-vhosts.conf
                    sed -i ‘s/webmaster@example.com/’i##iamle.com’/g’ /usr/local/apache/conf/extra/httpd-vhosts.conf
                    mkdir -p /usr/local/apache/conf/vhost
                    cat >>/usr/local/apache/conf/httpd.conf<<EOF
                    Include conf/vhost/*.conf
                    EOF
                     
                    echo “Download new Apache init.d file……”
                    wget -c http://soft.vpser.net/lnmp/ext/init.d.httpd
                    cp init.d.httpd /etc/init.d/httpd
                    chmod +x /etc/init.d/httpd
                    chkconfig –level 345 php-fpm off
                    chkconfig –level 345 httpd on
                     
                        安装apache mod_ rpaf支持显示客户真实ip
                    tar -zxvf mod_rpaf-0.6.tar.gz
                    cd mod_rpaf-0.6/
                    /usr/local/apache/bin/apxs -i -c -n mod_rpaf-2.0.so mod_rpaf-2.0.c
                    cd ..
                    ln -s /usr/local/lib/libltdl.so.3 /usr/lib/libltdl.so.3
                        安装apache2.2.22支持php5.3.15
                    tar zxvf php-5.3.15.tar.gz
                    cd php-5.3.15
                    ./configure –prefix=/usr/local/php –with-config-file-path=/usr/local/php/etc –with-apxs2=/usr/local/apache/bin/apxs with-libevent-dir –with-mysql=mysqlnd –with-mysqli=mysqlnd –with-pdo-mysql=mysqlnd –with-iconv-dir –with-freetype-dir –with-jpeg-dir –with-png-dir –with-zlib –with-libxml-dir=/usr –enable-xml –disable-rpath –enable-magic-quotes –enable-safe-mode –enable-bcmath –enable-shmop –enable-sysvsem –enable-inline-optimization –with-curl –with-curlwrappers –enable-mbregex –enable-mbstring –with-mcrypt –enable-ftp –with-gd –enable-gd-native-ttf –with-openssl –with-mhash –enable-pcntl –enable-sockets –with-xmlrpc –enable-zip –enable-soap –without-pear –with-gettext –disable-fileinfo
                     
                    rm -f libtool
                    cp /usr/local/apache/build/libtool .
                     
                    make ZEND_EXTRA_LIBS=’-liconv’
                    make install
                     
                    mkdir -p /usr/local/php/etc/
                    rm -f /usr/local/php/etc/php.ini
                    cp php.ini-production /usr/local/php/etc/php.ini
                     
                    # php extensions
                    echo “Modify php.ini……”
                    sed -i ‘s#extension_dir = “./”#extension_dir = “/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/”\nextension = “memcache.so”\#’ /usr/local/php/etc/php.ini
                    sed -i ‘s/post_max_size = 8M/post_max_size = 50M/g’ /usr/local/php/etc/php.ini
                    sed -i ‘s/upload_max_filesize = 2M/upload_max_filesize = 50M/g’ /usr/local/php/etc/php.ini
                    sed -i ‘s/;date.timezone =/date.timezone = PRC/g’ /usr/local/php/etc/php.ini
                    sed -i ‘s/short_open_tag = Off/short_open_tag = On/g’ /usr/local/php/etc/php.ini
                    sed -i ‘s/; cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/g’ /usr/local/php/etc/php.ini
                    sed -i ‘s/max_execution_time = 30/max_execution_time = 300/g’ /usr/local/php/etc/php.ini
                    sed -i ‘s/register_long_arrays = On/;register_long_arrays = On/g’ /usr/local/php/etc/php.ini
                    sed -i ‘s/magic_quotes_gpc = On/;magic_quotes_gpc = On/g’ /usr/local/php/etc/php.ini
                    sed -i ‘s/disable_functions =.*/disable_functions = passthru,exec,system,chroot,scandir,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_alter,ini_restore,dl,pfsockopen,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server,fsocket,fsockopen/g’ /usr/local/php/etc/php.ini
                        

                         安装php zend支持~直接用lnmp0.9的shell
                    echo “Install ZendGuardLoader for PHP 5.3”
                    if [ `getconf WORD_BIT` = ’32’ ] && [ `getconf LONG_BIT` = ’64’ ] ; then
                            wget -c http://downloads.zend.com/guard/5.5.0/ZendGuardLoader-php-5.3-linux-glibc23-x86_64.tar.gz
                            tar zxvf ZendGuardLoader-php-5.3-linux-glibc23-x86_64.tar.gz
                        mkdir -p /usr/local/zend/
                        cp ZendGuardLoader-php-5.3-linux-glibc23-x86_64/php-5.3.x/ZendGuardLoader.so /usr/local/zend/
                    else
                            wget -c http://downloads.zend.com/guard/5.5.0/ZendGuardLoader-php-5.3-linux-glibc23-i386.tar.gz
                        tar zxvf ZendGuardLoader-php-5.3-linux-glibc23-i386.tar.gz
                        mkdir -p /usr/local/zend/
                        cp ZendGuardLoader-php-5.3-linux-glibc23-i386/php-5.3.x/ZendGuardLoader.so /usr/local/zend/
                    fi
                     
                    echo “Write ZendGuardLoader to php.ini……”
                    cat >>/usr/local/php/etc/php.ini<<EOF
                    ;eaccelerator
                     
                    ;ionCube
                     
                    [Zend Optimizer]
                    zend_extension=/usr/local/zend/ZendGuardLoader.so
                    EOF
                     
                           安装php memcache支持~直接用lnmp0.9的shell
                    echo “Checking php extensions files……”
                    if [ -s memcache-2.2.5.tgz ]; then
                      echo “memcache-2.2.5.tgz [found]”
                      else
                      echo “Error: memcache-2.2.5.tgz not found!!!download now……”
                      wget -c http://soft.vpser.net/web/memcache/memcache-2.2.5.tgz
                    fi
                     
                    echo “Install php extensions……”
                    tar zxvf memcache-2.2.5.tgz
                    cd memcache-2.2.5/
                    /usr/local/php/bin/phpize
                    ./configure –with-php-config=/usr/local/php/bin/php-config
                    make && make install
                    cd ../
                     
                     
                     

                  #Set timezone 设置+8中国时区并同步时间
                  rm -rf /etc/localtime
                  ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
                  yum install -y ntp
                  ntpdate -u pool.ntp.org
                  date

                  #注意!!!请看清楚你需要卸载的软件,这里我全卸载,做纯mysql数据库服务器。
                  rpm -qa|grep httpd
                  rpm -e httpd
                  rpm -qa|grep mysql
                  rpm -e mysql
                  rpm -qa|grep php
                  rpm -e php
                  yum -y remove httpd*
                  yum -y remove php*
                  yum -y remove mysql-server mysql
                  yum -y remove php-mysql
                  yum -y install yum-fastestmirror
                  yum -y remove httpd

                  #Disable SeLinux 关闭selinux
                  if [ -s /etc/selinux/config ]; then
                  sed -i ‘s/SELINUX=enforcing/SELINUX=disabled/g’ /etc/selinux/config
                  fi

                  #更新系统、更新系统组件包
                  cp /etc/yum.conf /etc/yum.conf.back
                  sed -i ‘s:exclude=.*:exclude=:g’ /etc/yum.conf
                  for packages in patch make gcc gcc-c++ gcc-g77 flex bison file libtool libtool-libs autoconf kernel-devel libjpeg libjpeg-devel libpng libpng-devel libpng10 libpng10-devel gd gd-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glib2 glib2-devel bzip2 bzip2-devel libevent libevent-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel vim-minimal nano fonts-chinese gettext gettext-devel ncurses-devel gmp-devel pspell-devel unzip libcap;
                  do yum -y install $packages; done
                  mv -f /etc/yum.conf.back /etc/yum.
                  yum -y update

                  #建立软件源码包存放文件夹
                  mkdir /data0/software
                  cd /data0/software
                  #下载cmake(MySQL5.5x系列编译工具”必须”)
                  wget -c http://www.cmake.org/files/v2.8/cmake-2.8.8.tar.gz
                  #下载MySQL5.5.25a(2012年7月9日为止最新稳定版)
                  wget -c http://mysql.mirror.kangaroot.net/Downloads/MySQL-5.5/mysql-5.5.25a.tar.gz

                  tar zxvf cmake-2.8.8.tar.gz
                  cd cmake-2.8.8
                  ./configure
                  make
                  make install
                  cd..

                  groupadd mysql
                  useradd -s /sbin/nologin -M -g mysql mysql
                  mkdir -p /data0/mysql
                  chown -R mysql:mysql /data0/mysql
                  tar zxvf mysql-5.5.25a.tar.gz
                  cd mysql-5.5.25a
                  cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/data0/mysql
                  make
                  make install
                  cd ..

                  chmod +w /usr/local/mysql
                  chown -R mysql:mysql /usr/local/mysql

                  cd /usr/local/mysql
                  ./scripts/mysql_install_db –datadir=/data0/mysql –user=mysql
                  cp ./support-files/my-huge.cnf /etc/my.cnf
                  #拷贝配置文件(注意:如果/etc目录下面默认有一个my.cnf,直接覆盖即可)
                  vi /etc/my.cnf
                  #编辑配置文件,在 [mysqld] 部分增加下面一行
                  datadir = /data0/mysql
                  #添加MySQL数据库路径
                  :wq!
                  #保存退出
                  cp ./support-files/mysql.server /etc/rc.d/init.d/mysqld
                  #把Mysql加入系统启动
                  chmod 755 /etc/init.d/mysqld
                  #增加执行权限
                  chkconfig mysqld on
                  #设置开机启动
                  vi /etc/rc.d/init.d/mysqld
                  #编辑
                  basedir = /usr/local/mysql
                  #MySQL程序安装路径
                  datadir = /data0/mysql
                  #MySQl数据库存放目录
                  service mysqld start
                  #启动
                  vi /etc/profile
                  #把mysql服务加入系统环境变量:在最后添加下面这一行
                  export PATH=$PATH:/usr/local/mysql/bin
                  :wq! #保存退出

                  #设置root密码为root,并删除其他不安全账户。
                  mysqlrootpwd=”root”
                  /usr/local/mysql/bin/mysqladmin -u root password $mysqlrootpwd
                  cat > /tmp/mysql_sec_script<<EOF
                  use mysql;
                  update user set password=password(‘$mysqlrootpwd’) where user=’root’;
                  delete from user where not (user=’root’) ;
                  delete from user where user=’root’ and password=”;
                  drop database test;
                  DROP USER ”@’%’;
                  flush privileges;
                  EOF
                  /usr/local/mysql/bin/mysql -u root -p$mysqlrootpwd -h localhost < /tmp/mysql_sec_script
                  rm -f /tmp/mysql_sec_script

                  #设置libmysqlclient的软链,防止编译其它依赖Mysql软件时出现libmysqlclient.so.18: cannot open shared object file 的错误
                  #32位系统下的MYSQL客户端软链接
                  ln -s /usr/local/mysql/lib/libmysqlclient.so.18 /usr/lib/libmysqlclient.so.18

                  #64位系统下的MYSQL客户端软链接
                  ln -s /usr/local/mysql/lib/libmysqlclient.so.18 /usr/lib64/libmysqlclient.so.18

                  参考文献:
                  http://www.osyunwei.com/archives/4199.html
                  http://2526575.blog.51cto.com/2516575/565506
                  http://lnmp.org

                      安装linux下xfce轻量级桌面环境
                  为什么不选kde或者gnome呢混蛋?xfce占用内存最小啊,用在vps上很合适啊蠢货!
                  为什么不用vnc远程管理桌面呢混蛋?NoMachine NX更先进啊,速度更快啊,比较流行啊蠢货!
                  执行下面的命令吧,至于你信不信,我反正是信了。

                  yum -y install yum-fastestmirror
                  yum update 
                  yum groupinstall xfce
                  yum -y  install nc expect freenx
                  yum -y install fonts-chinese
                  yum -y  groupinstall chinese-support
                  yum -y install firefox
                      然后启动桌面吧~~
                  startxfce4
                     
                      再然后~
                  去FreeNX网站下载一个Windows客户端,在配置连接参数后,设置一下详细参数,选Desktop为Unix,
                  右边选Custom。然后点击Settings,选择Run the following command,下方输入:
                   /usr/bin/xfce4-session  
                  单选 New virtual desktop

                  翻滚吧gui windows centos linux~  512内存毫无鸭梨~