主要软件包,

1. httpd-2.2.6.tar.gz

2. mysql-5.0.45-linux-i686-glibc23.tar.gz ( 这个版本是已编译好的压缩包,解压后稍做配置即可使用 )

3. php-5.2.5.tar.gz

安装 php 所需的软件包(其中 libxml2 是安装 php5 必须的 . )

1. libxml2-(version).tar.gz ---> http://ftp.gnome.org/pub/GNOME/sources/libxm2

2. libxslt-(version).tar.gz ---> http://ftp.gnome.org/pub/GNOME/sources/libxslt

3. curl-(version).tar.gz   ---> http://curl.haxx.se/download

GD 库所需要软件包(有人说 PHP 源码包里自带了 GD2.0.28 和 zlib ,只要安装 GD 的三个支持包: jpg,png 和 freetype ,但是我们还是下载)

1. gd-(version).tar.gz     ---> http://www.libgd.org/Main_Page or http://www.libgd.org/releases/

2. freetype-(version).tar.gz ---> http://sourceforge.net/projects/freetype

3. jpegsrc.v6b.tar.gz     ---> http://ijg.org/files/jpegsrc.v6b.tar.gz

4. libpng-(version).tar.gz   ---> http://www.libpng.org/pub/png/libpng.html

5. zlib-1.2.3.tar.gz       ---> http://www.zlib.net

把以上所有软件包下载到: /root/Software/ 目录下 .

二:安装 mysql

# tar -zvxf mysql-5.0.45-linux-i686-glibc23.tar.gz

# mkdir -p /usr/local/mysql

# cp -r mysql-5.0.45 /usr/local/mysql

# cp /usr/local/mysql/support-files/mysql.server /etc/rc.d/init.d/mysql // 开机启动 mysql

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

添加 mysql 用户及用户组

# groupadd mysql

# useradd -g mysql mysql

修改 mysql 目录权限

# chown -R root /usr/local/mysql

# chgrp -R mysql /usr/local/mysql

# chown -R mysql /usr/local/mysql/data

生成 mysql 系统数据库

# /usr/local/mysql/scripts/mysql_install_db --user=mysql& // 启动 mysql 服务

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

如出现 Starting mysqld daemon with databases from /usr/local/mysql/data 代表正常启动 mysql 服务了 .

按 Ctrl + C 跳出修改 mysql 的 root 密码

# /usr/local/mysql/bin/mysqladmin -u root -p password "123456"

三:安装 GD 库 ( 让 PHP 支持 GIF,PNG,JPEG)

a. 安装 jpeg6 建立目录:

# mkdir -p /usr/local/jpeg6

# mkdir -p /usr/local/jpeg6/bin

# mkdir -p /usr/local/jpeg6/lib

# mkdir -p /usr/local/jpeg6/include

# mkdir -p /usr/local/jpeg6/man

# mkdir -p /usr/local/jpeg6/man1

# mkdir -p /usr/local/jpeg6/man/man1

# cd /root/Software/

# tar -zvxf jpegsrc.v6b.tar.gz

# cd jpeg6

# ./configure --prefix=/usr/local/jpeg6/ --enable-shared --enable-static

# make

# make install

b.libpng 包 ( 支持 PNG)

# cd /root/Software/

# tar -zvxf libpng-(version).tar.gz

# cd libpng-(version)

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

# make

#> make install

c. 安装 freetype

# cd /root/Software/

# tar -zvxf freetype-(version).tar.gz

# cd freetype-(version)

# mkdir -p /usr/local/freetype

# ./configure --prefix=/usr/local/freetype

# make

# make install

d. 安装 zlib

# cd /root/Software/

# tar -zxvf zlib-1.2.3.tar.gz

# cd zlib.1.2.3

# mkdir /usr/local/zlib

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

# make

# make install

e. 安装 GD 库

# cd /root/Software/

# tar -zvxf gd-(version).tar.gz

# mkdir -p /usr/local/gd2

# cd gd-(version)

# ./configure --prefix=/usr/local/gd2 --with-jpeg=/usr/local/jpeg6 --with-zlib-dir=/usr/local/zlib --with-png=/usr/local/libpng --with-freetype=/usr/local/freetype

# make

# make install

e. 安装 Curl 库

# cd /root/Software/

# tar -zxf curl-(version).tar.gz

# mkdir -p /usr/local/curl

# ./configure --prefix=/usr/local/curl

# make

# make install

四:安装 apache2

# cd /roo/Software/

# tar -zvxf httpd-2.2.6.tar.gz

# cd httpd-2.2.6

# mkdir -p /usr/local/apache2

# ./configure --prefix=/usr/local/apache --enable-modules=so --enable-rewrite

# make

# make install

# /usr/local/apache2/bin/apachectl -k start // 启动 apahce

用浏览器查看 http://localhost, 得到 it works ,说明 apache 已经配置成功了 .

# /usr/local/apache2/bin/apachectl -k stop // 停止 apache

五:安装 php5 , php5 必须有 libxml2 支持 !

a. 安装 libxml2

# cd /root/Software/

# tar -zvxf libxml2-(version).tar.gz

# cd libxml2-(version)

# mkdir -p /usr/local/libxml2

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

# make

# make install

b. 安装 libxslt ( 可选安装,你可以不安装 )

# cd /root/Software/

# tar -zvxf libxslt-(version).tar.gz

# mkdir -p /usr/local/libxslt

# cd libxslt-(version)

# ./configure --prefix=/usr/local/libxslt --with-libxml-prefix=/usr/local/libxml2

# make

# make install

c. 安装 php5

# cd /root/Software/

# tar -zvxf php-(version).tar.gz

# mkdir -p /usr/local/php5

# cd php-(version)

# ./configure --prefix=/usr/local/php5 --with-apxs2=/usr/local/apache2/bin/apxs \

>--with-gd=/usr/local/gd2 --with-jpeg-dir=/usr/local/jpeg6 \

>--with-zlib-dir=/usr/local/zlib \

>--with-png-dir=/usr/local/libpng \

>--with-freetype-dir=/usr/local/freetype -\

>--enable-trace-vars --with-mysql=/usr/local/mysql \

>--enable-mbstring=all --with-curl=/usr/local/curl --enable-mbregex \

>--with-config-file-path=/usr/local/php5 --enable-ftp \

>--enable-soap --with-xsl=/usr/local/libxslt

# make

# make install

# cp php.ini-dist /usr/local/php5/php.ini (别忘记了呵呵)

六:重新配置 apache2 让他支持 php

# cd /usr/local/apache2/conf

# vim httpd.conf

在 LoadModule php5_module modules/libphp5.so

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

OK, 基本的安装已经完成 .

重新起动 APACHE:

# /usr/local/apache2/bin/apachectl start

如果重新起动 APACHE 出现 :

Syntax error on line 232 of /usr/local/apache2/conf/httpd.conf: Cannot load /usr/local/apache2/modules/libphp5.so into server:

/usr/local/apache2/modules/libphp4.so: cannot restore segment prot after reloc: Permission denied

那就要按照下面的方法解决 :

1.chcon -t texrel_shlib_t /usr/local/apache2/modules/*.so

2. 编辑 /etc/selinux/config ,找到这段:

# This file controls the state of SELinux on the system.

# SELINUX= can take one of these three values:

# enforcing - SELinux security policy is enforced.

# permissive - SELinux prints warnings instead of enforcing.

# disabled - SELinux is fully disabled.

SELINUX=enforcing

把 SELINUX=enforcing 注释掉: #SELINUX=enforcing ,然后新加一行为:

SELINUX=disabled

保存,关闭。

编辑 /etc/sysconfig/selinux ,找到 :

# This file controls the state of SELinux on the system.

# SELINUX= can take one of these three values:

# enforcing - SELinux security policy is enforced.

# permissive - SELinux prints warnings instead of enforcing.

# disabled - SELinux is fully disabled.

SELINUX=enforcing

如果 SELINUX 已经是 SELINUX=disabled ,那么就不用改了,否则就把 SELINUX=enforcing 注释掉,新加一行:

SELINUX=disabled

保存,退出。

lamp安装指南(转)的更多相关文章

  1. LAMP环境搭建之编译安装指南(php-5.3.27.tar.gz)

    测试环境:CentOS release 6.5 (Final) 软件安装:httpd-2.2.27.tar.gz   mysql-5.1.72.tar.gz   php-5.3.27.tar.gz 1 ...

  2. Linux安装LAMP开发环境及配置文件管理

    Linux主要分为两大系发行版,分别是RedHat和Debian,lamp环境的安装和配置也会有所不同,所以分别以CentOS 7.1和Ubuntu 14.04做为主机(L) Linux下安装软件,最 ...

  3. Web应用之LAMP源码环境部署

    一.LAMP环境的介绍 1.LAMP环境的重要性 思索许久,最终还是决定写一篇详细的LAMP的源码编译安装的实验文档,一来是为了给自己一个交代,把技术进行系统的归纳,将技术以极致的形式呈现出来,做为一 ...

  4. 【笔记】LAMP 环境无脑安装配置 Centos 6.3

    p.p1 { margin: 0.0px 0.0px 5.0px 0.0px; font: 12.0px Times; color: #ff2500 } p.p2 { margin: 0.0px 0. ...

  5. LAMP坏境和LNMP环境安装Nagios4.1.1和基本配置

    ----------------------------------------以下内容为笔者生产环境的监控,安装都是经过一步步测试的-------------------------------- ...

  6. 1-web应用之LAMP源码环境搭建

    目录 一.LAMP环境的介绍     1.LAMP环境的重要性     2.LAMP组件介绍 二.Apache源码安装     1.下载Apache以及相关依赖包     2.安装Apache以及相关 ...

  7. CentOS7 配置LAMP

    这两天要带新同事.没办法,只有现学现卖,又回到Linux的怀抱了.今晚想配置一下LAMP环境,但是之前用的6.6,今晚想闷声做大死,用一次7试试.网上找了很多教程,但是好像转载的都不负责任,有些到下一 ...

  8. Ubuntu 16.04 LAMP server 指南 - 配置 Apache2.4,PHP7,和MariaDB(而不是MySQL)

    翻译自:https://www.howtoforge.com/tutorial/install-apache-with-php-and-mysql-on-ubuntu-16-04-lamp/ 昨天在虚 ...

  9. LAMP(1) 在VirtualBox里安装Ubuntu Server

    问题0.虚拟机中安装lamp环境 问题解决: 来自百度经验 问题1. 用putty远程登陆linux系统,显示network error connection refused 问题解决 问题2. my ...

随机推荐

  1. Python sys.path.append

    python sys.path.append 对于模块和自己写的程序不在同一个目录下,可以把模块的路径通过sys.path.append(路径)添加到程序中. 在程序开头加上: import syss ...

  2. flash文件运动节奏的控制

    flash里面,比较难的是控制运动的节奏.参考了几个韩国网站的fla源文件,提出以下几个建议与参考. 1,flash文件里面,每秒的帧数 设置为 120,或者一个比较大的数字(90,60).普通的文件 ...

  3. ODAC的安装以及Entity Framework for Oracle 基本配置

    1.安装ODAC 根据自己操作系统x86,x64来判断下载的ODAC版本 http://www.oracle.com/technetwork/database/windows/downloads/ut ...

  4. Java获取昨天的时间

    Calendar   cal   =   Calendar.getInstance();  cal.add(Calendar.DATE,   -1);  String yesterday = new ...

  5. 关于超链接自动提示的demo

    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/stri ...

  6. 【FLYabroad 】微软内部代码检查工具 (Microsoft Source Analysis for C#)[转]

    SourceAnalysis (StyleCop)的终极目标是让所有人都能写出优雅和一致的代码,因此这些代码具有很高的可读性. 早就听说了微软内部的静态代码检查和代码强制格式美化工具 StyleCop ...

  7. JS中break continue和return的用法?

    在 break,continue和return 三个关键字中, break,continue是一起的,return 是函数返回语句,但是返回的同时也将函数停止 break和continue: 退出循环 ...

  8. matplotlib入门--1(条形图, 直方图, 盒须图, 饼图)

    作图首先要进行数据的输入,matplotlib包只提供作图相关功能,本身并没有数据读入.输出函数,针对各种试验或统计文本数据输入可以使用numpy提供的数据输入函数. # -*- coding: gb ...

  9. Java中关键字super与this的区别

    一.super关键字 在JAVA类中使用super来引用父类的成分,用this来引用当前对象,如果一个类从另外一个类继承,我们new这个子类的实例对象的时候,这个子类对象里面会有一个父类对象.怎么去引 ...

  10. C++访问权限【原创】

    可以访问private的有:1.本类的函数:2.友元函数.   可以访问protected的有:1.本类的函数:2.子类函数:3.友元函数.   可以访问public的有:1.本类的函数和对象:2.子 ...