此方法可直接在线上部署,很多人在这样使用,apache版本号为:2.2.22,php版本号为:5.3.10,mysql版本号为:5.1.62 本文只讲部署,不讲优化 把软件放置在/usr/local/src目录下 安装apache 下载软件: 当前稳定版:httpd-2.2.22.tar.gz 下载地址: http://httpd.apache.org/download.cgi http://mirrors.tuna.tsinghua.edu.cn/apache//httpd/httpd-2.2.22.tar.gz yum install -y gcc zlib-devel openssl-devel cd /usr/local/src tar xf httpd-2.2.22.tar.gz cd httpd-2.2.22 ./configure --prefix=/usr/local/apache --enable-rewrite --enable-deflate --enable-expires --enable-headers --enable-modules=most --with-mpm=worker --enable-so make make install cd .. 安装mysql 下载软件 版本选择:mysql-5.1.62 下载地址:http://mysql.ntu.edu.tw/Downloads http://mysql.ntu.edu.tw/Downloads/MySQL-5.1/mysql-5.1.62.tar.gz groupadd mysql useradd -s /sbin/nologin -g mysql -M mysql yum install libtermcap-devel curses -y tar xf mysql-5.1.62.tar.gz cd mysql-5.1.62 ./configure --prefix=/var/mysql --with-unix-socket-path=/var/mysql/tmp/mysql.sock --localstatedir=/var/mysql/data --enable-assembler --enable-thread-safe-client --with-mysqld-user=mysql --with-big-tables --without-debug --with-pthread --enable-assembler --with-extra-charsets=complex --with-readline --with-ssl --with-embedded-server --enable-local-infile --with-plugins=partition,innobase --with-plugin-PLUGIN --with-mysqld-ldflags=-all-static --with-client-ldflags=-all-static make make install mkdir -p /var/mysql/data chown -R mysql /var/mysql /bin/cp support-files/my-small.cnf /etc/my.cnf 安装mysql数据库 /var/mysql/bin/mysql_install_db --user=mysql 把mysql命令复制到/usr/bin下面: ln -sf /var/mysql/bin/* /usr/bin/ cp support-files/mysql.server /etc/init.d/mysqld chmod 700 /etc/init.d/mysqld service mysqld start chkconfig mysqld on 安装PHP 软件下载: 版本:php-5.3.10 http://cn.php.net/ http://cn.php.net/get/php-5.3.10.tar.gz/from/a/mirror yum install -y zlib libxml libjpeg freetype libpng gd curl libiconv zlib-devel libxml2-devel libjpeg-devel freetype-devel libpng-devel gd-devel curl-devel 安装libiconv库 wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz tar xf libiconv-1.14.tar.gz cd libiconv-1.14 ./configure --prefix=/usr/local/libiconv &&make && make install cd .. 安装libxslt,(如果系统有就不需要安装) tar xf libxslt-1.1.15.tar.gz cd libxslt-1.1.15 ./configure && make && make install && cd .. tar xf php-5.3.10.tar.gz cd php-5.3.10 ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --with-mysql=/var/mysql --with-xmlrpc --with-openssl --with-zlib --with-freetype-dir --with-gd --with-jpeg-dir --with-png-dir --with-iconv=/usr/local/libiconv --enable-short-tags --enable-sockets --enable-zend-multibyte --enable-soap --enable-mbstring --enable-static --enable-gd-native-ttf --with-curl --with-xsl --enable-ftp --with-libxml-dir make make install cp php.ini-production /usr/local/php/lib/php.ini (责任编辑:admin) |