LAMP源代码安装

Linux+Apache+Mysql+Perl/PHP/Python一组常用来搭建动态网站或者服务器的开源软件,本身都是各自独立的程序,但是因为常被放在一起使用,拥有了越来越高的兼容度,共同组成了一个强大的Web应用程序平台。随着开源潮流的蓬勃发展,开放源代码的LAMP已经与J2EE和.Net商业软件形成三足鼎立之势,并且该软件开发的项目在软件方面的投资成本较低,因此受到整个IT界的关注。从网站的流量上来说,70%以上的访问流量是LAMP来提供的,LAMP是最强大的网站解决方案

LAMP环境搭建软件

centos-5.5

httpd-2.2.19.tar.gz

mysql-5.0.56.tar.gz

php-5.2.17.tar.gz

zlib-1.2.3.tar.gz

gd-2.0.33.tar.gz

libpng-1.2.10.tar.gz

libxml2-2.7.3.tar.gz

jpegsrc.v8b.tar.gz


软件安装

tar zxvf httpd-2.2.11.tar.gz

cd httpd-2.2.11

/configure --prefix=/usr/local/apache --enable-so --enable-rewrite

make

make install

编译过后做一下修改

vi /usr/local/apache/conf/httpd.conf

找到 #ServerName www.example.com:80

修改为 ServerName www.example.com:80

http://服务器ip  验证apache工作是否正常


It works!



tar zxvf mysql-5.0.56.tar.gz

cd mysql-5.0.56

./configure --prefix=/usr/local/mysql --with-charset=gbk --with-extra-charset=all

make

make install

cp support-files/my-medium.cnf /etc/my.cnf

cd /usr/local/mysql/

groupadd mysql

useradd -g mysql mysql      

.bin/mysql_install_db --user=mysql

chown -R mysql .

chgrp -R mysql .        

./bin/mysqld_safe --user=mysql &  


ps -e | grep mysql

6668 ? 00:00:00 mysqld_safe

6694 ? 00:00:00 mysqld


netstat -tuplna | grep mysqld

tcp 0 0 0.0.0.0:3306 0.0.0.0:*  LISTEN 6694/mysqld



zlib-1.2.3.tar.gz安装

tar zxvf zlib-1.2.3.tar.gz

cd zlib-1.2.3

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

make

make install


libpng-1.2.10.tar.gz

tar zxvf libpng-1.2.10.tar.gz

cd libpng-1.2.10

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

make

make install


libxml2-2.7.3.tar.gz

tar zxvf libxml2-2.7.3.tar.gz

cd libxml2-2.7.3

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

make

make install


jpegsrc.v8b.tar.gz

tar zxvf jpegsrc.v8b.tar.gz

cd jpeg-8b

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

make

make install


tar zxvf gd-2.0.33.tar.gz

cd gd-2.0.35

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

--with-libpng=/usr/local/libpng --with-libxml=/usr/local/libxml2

--with-jpeg=/usr/local/jpeg

make

make install


tar zxvf php-5.3.6.tar.gz

cd php-5.3.6

./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs

--with-mysql=/usr/local/mysql --with-zlib=/usr/local/zlib

--with-libxml=/usr/local/libxml2 --with-libpng=/usr/local/libpng

--with-jpeg=/usr/local/jpeg --with-gd=/usr/local/gd

make

make install

cp php.ini-development /usr/local/php/lib/php.ini

vi /usr/local/apache/conf/httpd.conf

找到 #AddType application/x-gzip .tgz

添加 AddType application/x-httpd-php .php

并且 去掉这两行的#

/usr/local/apache/bin/apachectl restart


cd /usr/local/apache/htdocs/

touch test.php 建立php测试页

vi test.php

<?php

phpinfo();

?>


http://服务器ip/test.php

135329731.png

本文出自 “mailfile” 博客,谢绝转载!

你可能感兴趣的:(Linux实现LAMP)