使用本地ISO文件做为yum的源 Step # 1: Mount an ISO file # yum install createrepo # mkdir -p /mnt/iso/{1,2,3} # mount -o loop /path/to/centos1.iso /mnt/iso/1 Step # 2: Create a repository # cd /mnt/iso # createrepo . Clean repo, enter: # yum clean all Step # 3: Create config file # vi /etc/yum.repos.d/iso.repo 写入以下内容: [MyISORepository] name=ISO baseurl=file:///mnt/iso enabled=1 Save and close the changes. # yum install package-name 环境准备 # yum install -y gcc gcc-c++ make zlib-devel cmake ncurses-devel libxml2-devel curl-devel libjpeg-devel libpng-devel freetype-devel vim vsftpd sudo Apache # tar xzvf httpd-2.2.21.tar.gz # cd httpd-2.2.21 # ./configure --prefix=/usr/local/apache --enable-modules=so --enable-rewrite --enable-headers --enable-expires --enable-mime-magic --enable-deflate # make # make install # cp /usr/local/apache/bin/apachectl /etc/rc.d/init.d/httpd # vi /etc/rc.d/init.d/httpd 在文件首部#!/bin/bash行下,加入以下几行 # chkconfig: 2345 50 40 # description: This is a Internet www Server # chkconfig --add httpd cronolog # tar xzvf cronolog-1.6.2.tar.gz # cd cronolog-1.6.2 # ./configure # make # make install MySQL # tar xzvf mysql-5.5.18.tar.gz # cd mysql-5.5.18.tar.gz # cmake . \ -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \ -DMYSQL_DATADIR=/mydata/mysql \ -DWITH_INNOBASE_STORAGE_ENGINE=1 \ -DWITH_MYISAM_STORAGE_ENGINE=1 \ -DWITH_MEMORY_STORAGE_ENGINE=1 \ -DENABLED_LOCAL_INFILE=1 \ -DMYSQL_TCP_PORT=3306 \ -DMYSQL_UNIX_ADDR=/tmp/mysql.sock \ -DMYSQL_USER=mysql \ -DSYSCONFDIR=/etc \ -DEXTRA_CHARSETS=all \ -DDEFAULT_CHARSET=utf8 \ -DDEFAULT_COLLATION=utf8_general_ci \ -DWITH_DEBUG=0 # make # make install # cp support-files/my-medium.cnf /etc/my.cnf # cp support-files/mysql.server /etc/init.d/mysqld # /usr/local/mysql/scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql/ --datadir=/mydata/mysql/ # chmod +x /etc/init.d/mysqld # chkconfig --add mysqld # chown mysql:mysql /mydata/mysql -R # chown mysql:mysql /usr/local/mysql -R #PHP # ./configure --prefix=/usr/local/php --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-apxs2=/usr/local/apache/bin/apxs --with-gd --with-zlib --with-freetype-dir --with-config-file-path=/usr/local/php/etc --enable-gd-native-ttf --enable-zend-multibyte --disable-ipv6 --with-iconv --disable-debug --enable-mbregex --with-curl --enable-mbstring=all --enable-zip --enable-exif --with-jpeg-dir --with-png-dir --enable-ftp # make # make install #配置apache # vi /usr/local/apache/conf/httpd.conf AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps 安装memcache* # yum install -y memcached # chkconfig --add memcached # service memcached start # /usr/local/php/bin/pecl install memcache