- 论坛徽章:
- 0
|
一、简介
a) 现在的社会使用php开发网站已经非常普及了!但是人们也很需LAMP环境,但是什么是LAMP呢L=linux ,A=apache,M=Mysql,P=Php,这就是lamp组成,下面我们就来配置一下lamp吧!
二、软件列表
a) openssl-0.9.8g.tar.gz
b) zlib-1.2.3.tar.gz
c) libpng-1.2.24.tar.bz2
d) freetype-2.3.5.tar.gz
e) jpegsrc.v6b.tar.gz
f) fontconfig-2.3.2.tar.gz
g) gd-2.0.33.tar.gz
h) libxml2-2.6.19.tar.gz
i) libxslt-1.1.15.tar.gz
j) mysql-5.0.45-linux-i686.tar.gz
k) httpd-2.2.4.tar.gz
l) php-5.2.3.tar.gz
三、安装需要软件包
a) 首先安装openssl
解压缩:tar zxvf openssl-0.9.8g.tar.gz
cd openssl-0.9.8g
./config --prefix=/usr/local/openssl
make
make install
i. Openssl配置
vi /etc/ld.so.conf 添加一行/usr/local/openssl/lib/
/sbin/ldconfig
b) 安装zlib
解压缩:tar zxvf zlib-1.2.3.tar.gz
cd zlib-1.2.3
./configure --prefix=/usr/local/zlib
make
make install
c) 安装libpng2
解压缩:tar jxvf libpng-1.2.24.tar.bz2
Cd libpng-1.2.24
./configure –prefix=/usr/local/libpng2
make
make install
d) 安装freetype
解压缩:tar zxvf freetype-2.3.5.tar.gz
cd freetype-2-3-5
./configure --prefix=/usr/local/freetype2
make
make install
e) 安装jpeg
mkdir /usr/local/jpeg6
mkdir /usr/local/jpeg6/include
mkdir /usr/local/jpeg6/lib
mkdir /usr/local/jpeg6/bin
mkdir /usr/local/jpeg6/man/
mkdir /usr/local/jpeg6/man/man1/
解压缩:tar zxvf jpegsrc.v6b.tar.gz
cd jpeg-6b
./configure --prefix=/usr/local/jpeg6 --enable-shared --enable-static
make
make test
make install
i. Jpeg6配置
vi /etc/ld.so.conf 加入一行:
/usr/local/jpeg6/lib
/sbin/ldconf
f) 解压fontconfig源代码
解压缩:tar zxvf fontconfig-2.3.2.tar.gz
cd fontconfig-2.3.2
./configure --prefix=/usr/local/fontconfig \
--disable-docs \
--sysconfdir=/etc \
--mandir=/usr/share/man
make
make install
g) 安装gd
解压缩:tar zxvf gd-2.0.33.tar.gz
cd gd-2.0.33
CPPFLAGS="-I/usr/local/freetype2/include \
-I/usr/local/jpeg6/include \
-I/usr/local/libpng2/include \
-I/usr/local/fontconfig/include" ./configure --prefix=/usr/local/gd2/ \
--with-zlib=/usr/local/zlib/ --with-png=/usr/local/libpng2/ \
--with-jpeg=/usr/local/jpeg6/ \
--with-freetype=/usr/local/freetype2/ \
--with-fontconfig=/usr/local/fontconfig \
make
make install
h) 安装libxml2
解压缩:tar zxvf libxml2-2.6.19.tar.gz
cd libxml2-2.6.19
./configure --prefix=/usr/local/libxml2
make && make install
i) 安装libxslt
解压缩:tar zxvf libxslt-1.1.15.tar.gz
cd libxslt-1.1.15
./configure --prefix=/usr/local/libxslt --with-libxml-prefix=/usr/local/libxml2
make && make install
四、Mysql安装
a) 根据mysql——install文档安装方法:
groupadd mysql
useradd -g mysql mysql
cd /usr/local
gunzip mysql-5.0.45-linux-i686.tar.gz | tar xvf -
ln -s mysql-5.0.45-linux-i686 mysql
cd mysql
chown -R mysql .
chgrp -R mysql .
scripts/mysql_install_db --user=mysql
chown -R root .
chown -R mysql data
bin/mysqld_safe --user=mysql &
五、Apache安装
解压缩:tar zxvf httpd-2.2.4.tar.gz
cd httpd-2.2.4
./configure --prefix=/usr/local/apache2 --enable-auth-anon --enable-auth-dbm --enable-cache --enable-disk-cache --enable-expires --enable-file-cache --enable-headers --enable-info --enable-logio --enable-mem-cache --enable-proxy --enable-rewrite --enable-ssl --with-ssl=/usr/local/openssl -enable-unique-id --enable-usertrack --enable-vhost-alias --enable-mods-shared=most
make && make install
六、安装php
解压缩:tar zxvf php-5.2.3.tar.gz
cd php-5.2.3
./configure --prefix=/usr/local/php --with-mysql=/usr/local/mysql/ --with-apxs2=/usr/local/apache2/bin/apxs --with-openssl-dir=/usr/local/openssl --with-expat-dir=/usr/lib --enable-xslt --with-gd=/usr/local/gd2/ --with-jpeg-dir=/usr/local/jpeg6/ --with-zlib-dir=/usr/local/zlib/ --with-png-dir=/usr/local/libpng2/ --with-freetype-dir=/usr/local/freetype2/ --with-mime-magic --with-png --with-xml --with-iconv --enable-gd-native-ttf --enable-ftp --enable-embed --enable-fastcgi --enable-calendar --enable-magic-quotes --enable-track-vars --enable-sockets --enable-soap --enable-pcntl --enable-mbstring=all --enable-mbregex --with-libxml-dir=/usr/local/libxml2 --with-xsl=/usr/local/libxslt/
make
make test
make install
配置 php.ini
cp php.ini-dist /usr/local/lib/php.ini
查看/usr/local/apache2/conf/httpd.conf文件中是否添加php模块如果没有请添加
LoadModule php5_module /usr/local/php/lib/libphp5.so
七、 openssl配置
openssl genrsa -des3 -passout pass:asecretpassword –out www.3baodian.com 1024
openssl req -new -passin pass:asecretpassword -passout pass:asecretpassword -key
www.xxx.com
-out server.csr -days 3650
然后根据提示输入就可以配置完成openssl了!
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/26545/showart_467926.html |
|