Linux lamp环境编译安装
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环境编译安装的更多相关文章
- lamp环境编译安装curl扩展
Linux编译安装php扩展包curl 1.curl,主要用于发送http请求,是php的一个扩展包. 2.安装过程: (1)curl下载:http://curl.haxx.se/download.h ...
- linux下搭建lamp环境以及安装swoole扩展
linux下搭建lamp环境以及安装swoole扩展 一.CentOS 6.5使用yum快速搭建LAMP环境 准备工作:先更新一下yum源 我安装的环境是:apache2.2.15+mysql5 ...
- Linux课程---14、linux下lamp环境如何安装
Linux课程---14.linux下lamp环境如何安装 一.总结 一句话总结: 要按顺序安装,比如apache需要在php之前安装, 一.安装 gcc 编译器 二.卸载 rpm 安装的 http ...
- Centos 7(Linux)环境下安装PHP(编译添加)相应动态扩展模块so(以openssl.so为例)
https://blog.csdn.net/shinesun001/article/details/54312402 在centos 7环境下搭建好Lnmp环境之后,发现安装的php有好多扩展都没有安 ...
- Linux centos7环境下安装Nginx
Linux centos7环境下安装Nginx的步骤详解 1. 首先到Nginx官网下载Nginx安装包 http://nginx.org/download/nginx-1.5.9.tar.gz ...
- Linux下nginx编译安装教程和编译参数详解
这篇文章主要介绍了Linux下nginx编译安装教程和编译参数详解,需要的朋友可以参考下 一.必要软件准备1.安装pcre 为了支持rewrite功能,我们需要安装pcre 复制代码代码如下: # y ...
- centos / Linux 服务环境下安装 Redis 5.0.3
原文:centos / Linux 服务环境下安装 Redis 5.0.3 1.首先进入你要安装的目录 cd /usr/local 2.下载目前最新稳定版本 Redis 5.0.3 wget http ...
- linux centos7环境下安装apache2.4+php5.6+mysql5.6 安装及踩坑集锦(三)
linux centos7环境下安装apache2.4+php5.6+mysql5.6 安装及踩坑集锦(三) 安装PHP 1.yum方式安装PHP方法同安装apache一样传送门:linux cent ...
- linux centos7环境下安装apache2.4+php5.6+mysql5.6 安装及踩坑集锦(二)
linux centos7环境下安装apache2.4+php5.6+mysql5.6 安装及踩坑集锦(二) 安装apache web容器 . yum方式安装apache 注意apache在linux ...
随机推荐
- 如何将内存中的位图数据绘制在DC上
假如你定义了一个位图类,里面包含位图头,位图信息头,调色板,位图数据.然后你按照位图的格式将位图文件读入你的类中,现在你知道了位图的全部信息了.主要信息包含在位图信息头里面,数据则在位图数据缓冲里面. ...
- Windows Azure入门教学系列 (四):使用Blob Storage
本文将会介绍如何使用Blob Storage.Blob Storage可以看做是云端的文件系统.与桌面操作系统上不同,我们是通过REST API来进行对文件的操作.有关REST API的详细信息,请参 ...
- 问题:Excel在“xxx.xlsx”中发现不可读取的内容。是否恢复此工作薄的内容?【原创】
现象: 点"是(Y)" 提示信息中提到的error242440_02.xml文件: 问题重现: package poi; import java.io.FileNotFoundEx ...
- 隐藏AutoCompleteTextView下拉框的滚动条
最近做项目需要用到AutoCompleteTextView这个控件,而其下拉框的滚动条有点难看,于是想去掉.走了些弯路,终于弄通了. 首先先介绍一种不靠谱的方法:反射机制 为什么会有人想到用这个呢? ...
- Android反编译-逆天的反编译
Jar包的反编译: Java的世界是透明的,当编译java程序的时候,是将java源文件转成.class文件,java虚拟机去执行这些字节码从而得到执行java程序的目的.那么从.class文件能不能 ...
- 简化ui文件转换写法
在命令行敲一串长的命令.枯燥麻烦. #coding:utf-8 import sys import os import subprocess if len(sys.argv) == 2: #节省输入, ...
- python中使用ctypes调用MinGW生成的动态链接库(dll)
关于gcc编译dll的我就不说了,网上举例一大堆,下面以g++为例. 假设有一个test.cpp文件如下: extern "C" { __declspec(dllexport) d ...
- 8086 CPU 寻址方式
8086 CPU 寻址方式灵活.有以下几种 idata 表示常量 1. [ idata ] 用一个常量来表示地址,可用于直接定位内存单元,但是在 MASM中要显实在的说明 ds 段寄存器, 比如 ...
- Emotion英语学习
英语学习断断续续也快两年了,以前也蜻蜓点水地写过几篇总结,但是因为思考的少,只能得到一些表面的收获.从今年三月初到现在,口语阶段已经有三个月,感触较多,所以写这篇博客对这段时间英语学习的一个整体总结. ...
- Bootstrap表格的使用
先定义前端table <table class="table table-striped table-bordered table-hover" id="expan ...