centos 64bit 搭建lamp

89231441 2011-03-22

相关软件下载:

httpdhttp://httpd.apache.org/

mysqlhttp://dev.mysql.com/downloads/

phphttp://www.php.net/downloads.php

libxml2ftp://ftp.gnome.org/pub/GNOME/sources/libxml2/2.6/

libmcrypthttp://prdownloads.sourceforge.net/mcrypt/

zlibhttp://www.zlib.net/

gdhttp://www.libgd.org/releases

Autoconfftp://ftp.gnu.org/gnu/autoconf

freetypehttp://download.savannah.gnu.org/releases/freetype/

libpngftp://ftp.simplesystems.org/pub/libpng/png/src

jpegsrchttp://www.ijg.org/files/

yum-yinstallgccgcc-c++ncursesncurses-develbisonopensslopenssl-devel

rpm-emysql--nodepts

rpm-ehttpd--nodepts

cd/usr/local/src

tar-zxvfcmake-2.8.4.tar.gz

cdcmake

./configure&&gmake&&gmakeinstall

cd/usr/local/src

tar-zxvfautoconf-2.68.tar.gz

cdautoconf-2.68

./configure&&make&&makeinstall

cd/usr/local/src

tar-zxvfzlib-1.2.3.tar.gz

cdzlib-1.2.3

vimMakeFile(修改CFLAGS)

CFLAGS=-O3-fPIC-DUSE_MMAP(要看到编译有-fPIC参数)

./configure--prefix=/usr/local/zlib

make

makeinstall

cd/usr/local/src

tar-zxvflibxml2-2.7.7.tar.gz

cdlibxml2-2.7.7

./configure--prefix=/usr/local/libxml2--with-zlib=/usr/local/zlib

make&&makeinstall

cd/usr/local/src

tar-zxvflibpng-1.5.1.tar.gz

cdlibpng-1.5.1

exportLDFLAGS=-L$ROOTFS_DIR/usr/local/zlib/lib

exportCFLAGS=-I$ROOTFS_DIR/usr/local/zlib/include

./configure--prefix=/usr/local/libpng--with-zlib-prefix=/usr/local/zlib/

make&&makeinstall

cd/usr/local/src

tar-zxvffreetype-2.4.1.tar.gz

cdfreetype-2.4.1

./configure--prefix=/usr/local/freetype--with-zlib=/usr/local/zlib

make&&makeinstall

cd/usr/local/src

tar-zxvflibmcrypt-2.5.8.tar.gz

cdlibmcrypt-2.5.8

./configure--prefix=/usr/local/libmcrypt

make&&makeinstall

cd/usr/local/src

tar-zxvfcurl-7.21.4.tar.gz

cdcurl-7.21.4

./configure--prefix=/usr/local/curl--with-zlib=/usr/local/zlib

make&&makeinstall

cd/usr/local/src

tar-zxvfjpegsrc.v8c.tar.gz

cdjpeg-8c/

./configure--prefix=/usr/local/jpeg8/--enable-shared--enable-static

make&&makeinstall

cd/usr/local/src

tar-zxvfgd-2.0.35.tar.gz

cdgd-2.0.35

vimgd_png.c

./configure--prefix=/usr/local/gd2/--with-zlib=/usr/local/zlib/--with-jpeg=/usr/local/jpeg8/--with-png=/usr/local/libpng/--with-freetype=/usr/local/freetype/

修改gd2中的源代码:

#include"png.h"为:

#include"/usr/local/libpng/include/png.h"

make&&makeinstall

/********************************apache*******************************************************/

cd/usr/local/src

tar-zxvfhttpd-2.2.17.tar.gz

cdhttpd-2.2.17

./configure--prefix=/usr/local/apache2--sysconfdir=/etc/httpd--with-z=/usr/local/zlib/--with-included-apr--with-mpm=prefork--enable-so--enable-deflate=shared--enable-expires=shared--enable-rewrite=shared--enable-static-support--enable-cache--enable-disk-cache--enable-mem-cache--enable-file-cache--enable-cgi

make&&makeinstall

echo"/usr/local/apache2/bin/apachectlstart">>/etc/rc.d/rc.local

/*********************************mysql*******************************************************/

cd/usr/local/src

tar-zxvfmysql-5.5.10.tar.gz

cdmysql-5.5.10

cmake.-DCMAKE_INSTALL_PREFIX=/usr/local/mysql-DDEFAULT_CHARSET=utf8-DDEFAULT_COLLATION=utf8_general_ci-DEXTRA_CHARSETS=all-DWITH_SSL=system-DWITH_EMBEDDED_SERVER=1-DENABLED_LOCAL_INFILE=1-DWITH_MYISAM_STORAGE_ENGINE=1

gmake&&gmakeinstall

useradd-M-r--shell/sbin/nologin--home-dir/usr/local/mysqlmysql

chown-Rmysql:mysql/usr/local/mysql

cd/usr/local/mysql/scripts/

./mysql_install_db--basedir=/usr/local/mysql--datadir=/usr/local/mysql/data--user=mysql

/usr/local/mysql/bin/mysqld_safe--user=mysql&

#需修改/usr/local/mysql/support-files/mysql.server中的basedir和datadir

vim/usr/local/mysql/support-files/mysql.server

basedir=/usr/local/mysql

datadir=/usr/local/mysql/data

#需修改/usr/local/mysql/support-files/my-huge.cnf

vim/usr/local/mysql/support-files/my-huge.cnf

增加以下内容

[mysqld]

character-set-server=utf8

collation_server=utf8_unicode_ci

cp/usr/local/mysql/support-files/my-huge.cnf/etc/my.cnf

cp/usr/local/mysql/support-files/mysql.server/etc/init.d/mysqld

chmod755/etc/init.d/mysqld

#添加服务

chkconfig--addmysqld

#指定服务级别

chkconfig--level2345mysqldon

/*********************************php*******************************************************/

cd/usr/local/src

tar-zxvfphp-5.3.5.tar.gz

cdphp-5.3.5

./configure--prefix=/usr/local/php--with-config-file-path=/usr/local/php/etc--with-apxs2=/usr/local/apache2/bin/apxs--with-mysql=/usr/local/mysql/--with-mysqli=mysqlnd--with-pdo-mysql=mysqlnd--with-libxml-dir=/usr/local/libxml2/--with-png-dir=/usr/local/libpng/--with-jpeg-dir=/usr/local/jpeg8/--with-freetype-dir=/usr/local/freetype/--with-gd=/usr/local/gd2/--with-zlib-dir=/usr/local/zlib/--with-mcrypt=/usr/local/libmcrypt/--with-curl=/usr/local/curl/--enable-soap--enable-mbstring=all--enable-sockets

cp/usr/local/src/php-5.3.5/php.ini-development/usr/local/php/etc/php.ini

vi/etc/httpd/httpd.conf//使用vi编辑apache配置文件

Addtypeapplication/x-httpd-php.php.phtml#添加这一条

相关推荐