1、安装准备:
1)httpd-2.0.52.tar.gz
2)mysql-4.1.12.tar.gz
3)libxml2-2.6.27.tar
4)freetype-2.1.10.tar
5)gd-2.0.33.tar
6)jpegsrc.v6b.tar
7)libpng-1.2.16.tar
8)zlib-1.2.3.tar
9)freetds-0.64.tar.gz
10)php-4.3.9.tar.gz
11)phpMyAdmin292.tar.gz
12)ZendOptimizer-3.2.6-linux-glibc21-i386.tar
在系统中建立user:soft
  # groupadd soft
  # useradd -g soft soft
# passwd soft
将安装所需文件拷贝到/home/soft中

/////////////////////////////////////////////////////////////////////
2、安装apache
在系统中建立user:apache
  # groupadd apache
  # useradd -g apache -d /usr/local/apache apache
# passwd apache
安装:
# cd /home/soft
  # tar zxvf httpd-2.0.52.tar.gz
  # cd httpd-2.0.52
  # ./configure --prefix=/usr/local/apache --datadir=/www --enable-mods=shared=all --enable-module=so --disable-info --enable-shared=max --enable-rule=SHARED_CORE
  # make
  # make install
配置:
  # vi /usr/local/apache/conf/httpd.conf
   更改一下两行:
User nobody
Group #-1
为:
User apache
Group apache
保存退出

更改APACHE目录的所属
  # chown -R apache.apache /usr/local/apache

  # vi /usr/local/apache/bin/apachectl
在第四行后添加
# chkconfig: 2345 10 90
# description: Activates/Deactivates Apache Web Server
保存退出

接下来设置apache的自启动及运行等级
  # cd /etc/rc.d/init.d
  # cp /usr/local/apache/bin/apachectl httpd
  # chmod 755 httpd

  # chkconfig --add httpd
# chkconfig --level 345 httpd on
# chkconfig --level 0126 httpd off
启动与关闭httpd服务
  # service httpd start/stop/restart

//////////////////////////////////////////////////////////////////////////////////////////
3、安装MySQL
在系统中建立user:mysql
  # groupadd mysql
  # useradd -g mysql -d /mysql mysql
# passwd mysql
在系统中建立mysql,data目录
# cd /mysql
  # mkdir tmp
  # chown -R mysql.mysql /mysql
# chown -R mysql.mysql /data
# chmod -R 777 /mysql
# chmod -R 777 /data

安装:
# cd /home/soft
  # tar zxvf mysql-5.0.22.tar.gz
  # cd mysql-5.0.22
  # ./configure --prefix=/mysql --localstatedir=/data --with-client-ldflags=-all-static --with-mysqld-ldflags=-all-static --with-mysqld-user=mysql --enable-assembler --with-extra-charsets=all --with-unix-socket-path=/mysql/tmp/mysql.sock
  # make
  # make install
若为普通服务器则采用如下的配置
  # cp support-files/my-huge.cnf /etc/my.cnf
若为大型的服务器,则采用
# cp support-files/my-innodb-heavy-4G.cnf /etc/my.cnf
初始化数据库:
  # scripts/mysql_install_db --user=mysql
  文件权限修改
# chown -R mysql.mysql /mysql
# chown -R mysql.mysql /data
# chmod -R 777 /mysql
# chmod -R 777 /data

启动数据库
# cd /mysql 
  # share/mysql/mysql.server start &

修改数据库ROOT用户密码为ABCabc123
  # bin/mysqladmin -u root password "ABCabc123;"

  接下来设置mysql的自启动及运行等级
  # cd /etc/rc.d/init.d
  # cp /home/soft/mysql-5.0.22/support-files/mysql.server mysqld
  # chmod 755 mysqld
  # chkconfig --add mysqld
# chkconfig --level 345 mysqld on
# chkconfig --level 0126 mysqld off
  启动与关闭MYSQLD服务
  # service mysqld start/stop/restart

/////////////////////////////////////////////////////////////////////////////////////////////
4、安装GD库

1).libxml2安装(支持xml)
# cd /home/soft
# tar -zxvf libxml2-2.6.27.tar.gz
# cd libxml2-2.6.27
# ./configure --prefix=/usr/local/libxml2
# make
# make install

2).zlib安装
# cd /home/soft
# tar -zxvf zlib-1.2.3.tar.gz
# cd zlib-1.2.3
# ./configure --prefix=/usr/local/zlib
# make
# make install

3).安装 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/man/man1
# cd /home/soft
# tar -zvxf jpegsrc.v6b.tar.gz
# cd jpeg-6b
# ./configure --prefix=/usr/local/jpeg6/ --enable-shared --enable-static
# make
# make install
///////////////////////////////////////////////////////////////////////////////

4).安装libpng
# cd /home/soft
# tar -zvxf libpng-1.2.16.tar.gz
# cd libpng-1.2.16
# ./configure
# make
# make install

5).安装 freetype
# cd /home/soft
# tar -zvxf freetype-2.1.10.tar.gz
# cd freetype-2.1.10
# mkdir -p /usr/local/freetype
# ./configure --prefix=/usr/local/freetype
# make
# make install

6)安装GD库
# cd /home/soft
# tar -zvxf gd-2.0.33.tar.gz
# mkdir -p /usr/local/gd
# cd gd-2.0.33
# ./configure --prefix=/usr/local/gd --with-jpeg=/usr/local/jpeg6/ --with-png --with-zlib --with-freetype=/usr/local/freetype/
# make
# make install

5.安装的freetds
安装:
# cd /home/soft
# tar zxvf freetds-0.64.tar.gz
# cd freetds-0.64
# ./configure --prefix=/usr/local/freetds --with-tdsver=8.0 --enable-msdblib --enable-dbmfix --with-gnu-ld
# make
# make install

/////////////////////////////////////////////////////////////////////////////////////////////
5、安装PHP
  # cd /home/soft
# tar zxvf php-4.3.9.tar.gz
  # cd php-4.3.9
# ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --enable-sockets --with-mysql=/mysql --with-mssql=/usr/local/freetds --with-gd=/usr/local/gd --with-jpeg-dir=/usr/local/jpeg6 --with-freetype-dir=/usr/local/freetype --with-zlib --with-png --enable-gd-native-ttf --enable-magic-quotes --with-iconv --with-mbstring --enable-track-vars --enable-force-cgi-redirect --enable-calendar --with-gettext --with-gdbm --with-ttf --with-extra-charsets_complex --with-msdblib --enable-module=dso --with-versioning --enable-libxml --enable-so

# make
  # make install
  # cp php.ini-dist /usr/local/php/lib/php.ini

6、整合配置
更新链接库及添加PHP识别
  # vi /etc/ld.so.conf
  在最后添加 /mysql/lib /usr/local/php/modules/freetds/lib
保存退出
  # ldconfig

  APACHE支持PHP
# vi /usr/local/apache/conf/httpd.conf

AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
下添加:
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

AddDefaultCharset UTF-8
改为:
AddDefaultCharset gb2312

修改
<Files ~ "^\.ht">
Order allow,deny
deny from all
</Files>

<Files ~ "^\.ht">
Order allow,deny
allow from all
</Files>


DirectoryIndex index.html index.html.var
后加上
index.php

DirectoryIndex index.html index.html.var index.php
保存退出

修改PHP配置参数
  # vi /usr/local/php/lib/php.ini
修改 register_globals = On;
magic_quotes_gpc = Off;
进行php.ini文件的配置工作
(1)查找safe_mode = Off,更改为safe_mode=On
(2)查找max_execution_time = 30,更改为max_execution_time = 600
(3)查找max_input_time = 60,更改为max_input_time = 600
(4)查找memory_limit = 8M ,更改为memory_limit = 20M
(5)查找display_errors = On,更改为display_errors = Off
(6)查找post_max_size = 8M,更改为post_max_size = 20M
(7)查找upload_max_filesize = 2M,更改为upload_max_filesize = 20M
(8)查找session.auto_start = 0,更改为session.auto_start = 1
保存后退出,从而完成了php.ini文件的配置工作。

7、安装ZendOptimizer
  # cd /home/soft
# tar xvf ZendOptimizer-3.2.6-linux-glibc21-i386.tar
  # cd ZendOptimizer-3.2.6-linux-glibc21-i386
# ./install.sh
(请注意apachectl 和 php.ini文件的目录)

lqqqqqqqqq Zend Optimizer 3.2.6 qqqqqqqqqqk
x x
x Enter the location of your php.ini file x
x x
x lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk x
x x/usr/local/php/lib x x
x mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj x
tqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu
x < OK > <Cancel> x
mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj

8、安装phpmyadmin
# cd /home/soft
# tar -zxvf phpMyAdmin-2.9.2.tar.gz
# cp -R phpMyAdmin-2.9.2/ /www
修改配置文件phpMyAdmin-2.8.1/libraries/config.default.php。将:
$cfg['Servers'][$i]['auth_type'] = 'config'; (71行)
cfg['DefaultConnectionCollation'] = 'utf8_unicode_ci'; (395行)
// $cfg['Lang'] = 'en-iso-8859-1'; (399行)
改为:
$cfg['Servers'][$i]['auth_type'] = 'http';
//cfg['DefaultConnectionCollation'] = 'utf8_unicode_ci';
$cfg['Lang'] = 'zh-gb2312';
修改配置文件phpMyAdmin-2.8.1/ libraries/select_lang.lib.php。将:
$mysql_charset_map = array( (362行)
'big5' => 'big5',
'cp-866' => 'cp866',
'euc-jp' => 'ujis',vi
'euc-kr' => 'euckr',
'gb2312' => 'gb2312'
改为:
$mysql_charset_map = array(
'big5' => 'big5',
'cp-866' => 'cp866',
'euc-jp' => 'ujis',
'euc-kr' => 'euckr',
'gb2312' => 'latin1'

Linux lamp环境编译安装的更多相关文章

  1. lamp环境编译安装curl扩展

    Linux编译安装php扩展包curl 1.curl,主要用于发送http请求,是php的一个扩展包. 2.安装过程: (1)curl下载:http://curl.haxx.se/download.h ...

  2. linux下搭建lamp环境以及安装swoole扩展

    linux下搭建lamp环境以及安装swoole扩展   一.CentOS 6.5使用yum快速搭建LAMP环境 准备工作:先更新一下yum源  我安装的环境是:apache2.2.15+mysql5 ...

  3. Linux课程---14、linux下lamp环境如何安装

    Linux课程---14.linux下lamp环境如何安装 一.总结 一句话总结: 要按顺序安装,比如apache需要在php之前安装, 一.安装 gcc 编译器 二.卸载 rpm 安装的 http ...

  4. Centos 7(Linux)环境下安装PHP(编译添加)相应动态扩展模块so(以openssl.so为例)

    https://blog.csdn.net/shinesun001/article/details/54312402 在centos 7环境下搭建好Lnmp环境之后,发现安装的php有好多扩展都没有安 ...

  5. Linux centos7环境下安装Nginx

    Linux centos7环境下安装Nginx的步骤详解 1.    首先到Nginx官网下载Nginx安装包 http://nginx.org/download/nginx-1.5.9.tar.gz ...

  6. Linux下nginx编译安装教程和编译参数详解

    这篇文章主要介绍了Linux下nginx编译安装教程和编译参数详解,需要的朋友可以参考下 一.必要软件准备1.安装pcre 为了支持rewrite功能,我们需要安装pcre 复制代码代码如下: # y ...

  7. centos / Linux 服务环境下安装 Redis 5.0.3

    原文:centos / Linux 服务环境下安装 Redis 5.0.3 1.首先进入你要安装的目录 cd /usr/local 2.下载目前最新稳定版本 Redis 5.0.3 wget http ...

  8. linux centos7环境下安装apache2.4+php5.6+mysql5.6 安装及踩坑集锦(三)

    linux centos7环境下安装apache2.4+php5.6+mysql5.6 安装及踩坑集锦(三) 安装PHP 1.yum方式安装PHP方法同安装apache一样传送门:linux cent ...

  9. linux centos7环境下安装apache2.4+php5.6+mysql5.6 安装及踩坑集锦(二)

    linux centos7环境下安装apache2.4+php5.6+mysql5.6 安装及踩坑集锦(二) 安装apache web容器 . yum方式安装apache 注意apache在linux ...

随机推荐

  1. wift - 使用UIScreen类获取屏幕大小尺寸

    UISreen类代表了屏幕,开发中一般用来获取屏幕相关的属性,例如获取屏幕的大小. 1 2 3 4 5 6 7 //获取屏幕大小 var screenBounds:CGRect = UIScreen. ...

  2. Swift - 跳跃吃苹果游戏开发(SpriteKit游戏开发)

    下面通过一个样例演示如何实现飞行道具的生成,以及道具碰撞拾取. 样例说明: 1,屏幕从右到左不断地生成苹果飞过来(苹果高度随机) 2,点击屏幕可以让熊猫跳跃 3,熊猫碰到苹果,苹果消失 运行效果: 样 ...

  3. Linear Regression(线性回归)(一)—LMS algorithm

    (整理自AndrewNG的课件,转载请注明.整理者:华科小涛@http://www.cnblogs.com/hust-ghtao/) 1.问题的引出 先从一个简单的例子说起吧,房地产公司有一些关于Po ...

  4. 后台调用外部程序的完美实现(使用CreateDesktop建立隐藏桌面)

    最近在做的一个软件,其中有一部分功能需要调用其它的软件来完成,而那个软件只有可执行文件,根本没有源代码,幸好,我要做的事不难,只需要在我的程序启动后,将那个软件打开,在需要的时候,对其中的一个文本矿设 ...

  5. 2014Esri全球用户大会——亮点系列之精彩应用案例

    在2014 Esri UC上,Esri邀请不少用户到场分享了自己企业的案例,在这里与大家进行分享. 一.City of Mineapolis 1.案例背景 Mineapolis市使用GIS已经数十年, ...

  6. asp于Server.MapPath用法

    总是忘记Server.MapPath的用法,以下记录了,以后使用: 总注:Server.MapPath获得的路径都是server上的物理路径,也就是常说的绝对路径 1.Server.MapPath(& ...

  7. Java线程并发中常见的锁--自旋锁 偏向锁

    随着互联网的蓬勃发展,越来越多的互联网企业面临着用户量膨胀而带来的并发安全问题.本文着重介绍了在java并发中常见的几种锁机制. 1.偏向锁 偏向锁是JDK1.6提出来的一种锁优化的机制.其核心的思想 ...

  8. Greenplum同步到Oracle

    开发提出须要从Greenplum同步到Oracle的解决方式,写了个脚本用于定时调度处理. #!/bin/sh #copy_gp_2_ora.sh if [ $# -ne 1 ]; then     ...

  9. 微微信.NET:开源的ASP.NET微信公众号应用平台

    题记: 平时喜欢使用 C# 编程.近半年玩微信公众平台,看到一些微信的应用系统大多是PHP.Python的,于是就有想法做一套开放的 C# ASP.NET的微信应用系统. 微微信.NET  基于ASP ...

  10. (三)----使用HttpClient发送HTTP请求(分别通过GET和POST方法发送数据)

    文章来源:http://www.cnblogs.com/smyhvae/p/4006009.html 一.GET和POST的对比: 在漫长的时间当中,其他的方法逐渐的退出了历史舞台,最常用的只剩下GE ...