| 站点地图 | 联系我
| www.asm32.net | 2006版 | 资料中心 | linux | asm/asm32 | C/C++ | VC++ | java | 书签 | ASP.Net书签 | 上善若水 厚德载物
 现在位置 :: 主页 >> 资料中心 >> ROOT / NETWORK 网络 / SERVER 服务器 /
 

[精华] Apache PHP MySQL Zend GD OpenSSL vsftpd ... 完全编译安装

来源(null)

[精华] Apache PHP MySQL Zend GD OpenSSL vsftpd ... 完全编译安装

系统 Debian Linux v3.1r0 (Sarge) Kernel v2.6.11 i686

安装方式:源码编译
版权:本文章可以任意转载,但请注明作者和出处,谢谢
作者:keelort
微米天空: http://www.micronsky.net
原文链接: http://bbs.micronsky.net/viewtopic.php?t=160


软件:

Apache v2.0.54 官方主页: http://www.apache.org
http://www.apache.org/dist/httpd/httpd-2.0.54.tar.gz [7.16MB]

PHP v4.3.11 官方主页: http://www.php.net
http://cn.php.net/distributions/php-5.0.4.tar.gz [4.64MB]

Zend Optimizer v2.5.10 官方主页: http://www.zend.com
http://downloads.zend.com/optimizer/2.5.10/ZendOptimizer-2.5.10-linux-glibc21-i386.tar.gz [3.36MB]

MySQL v4.0.24 官方主页: http://www.mysql.com
http://ftp.stu.edu.tw/pub/Unix/Database/Mysql/Downloads/MySQL-4.0/mysql-4.0.24.tar.gz [16.1MB]

GD Library v2.0.33 官方主页: http://www.boutell.com/gd/
http://www.boutell.com/gd/http/gd-2.0.33.tar.gz [573KB]

FreeType v2.1.10 官方主页: http://www.freetype.org
http://savannah.nongnu.org/download/freetype/freetype-2.1.10.tar.gz [1.31MB]

Jpeg v6b 官方主页: http://www.ijg.org
ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v6b.tar.gz [598KB]

LibPNG v1.2.8 官方主页: http://www.libpng.org/pub/png/
http://switch.dl.sourceforge.net/sourceforge/libpng/libpng-1.2.8.tar.gz [498KB]

OpenSSL v0.9.7g 官方主页: http://www.openssl.org
http://www.openssl.org/source/openssl-0.9.7g.tar.gz [2.98MB]

vsftpd v2.0.3 官方主页: http://vsftpd.beasts.org
ftp://vsftpd.beasts.org/users/cevans/vsftpd-2.0.3.tar.gz [149KB]

zlib v1.2.2 官方主页: http://www.gzip.org/zlib/
http://www.zlib.net/zlib-1.2.2.tar.gz [420KB]

ClibPDF v2.02-r1-1 官方网站: http://www.fastio.com
http://www.fastio.com/clibpdf202r1.tar.gz [836KB]

mod_limitipconn v0.22 官方网站: http://dominia.org/djao/
http://dominia.org/djao/limit/mod_limitipconn-0.22.tar.gz [6.18KB]

Bandwidth Module v0.6 官方网站: http://www.ivn.cl/apache/
http://www.ivn.cl/apache/bw_mod-0.6.tgz [28.5KB]


开始安装:

1、解压缩,把所有源码压缩包放在一个目录中,解压缩所有 .tar.gz 压缩包
for i in `ls *.gz`;do tar zxvf $i; done;


2、安装

##### zlib #####

cd zlib-1.2.2
./configure
make
make install
cd ..


##### OpenSSL #####

cd openssl-0.9.7g
./config --prefix=/usr/local/ssl \
--openssldir=/usr/local/ssl \
shared \
zlib

make
make install
cd ..


##### MySQL #####

cd mysql-4.0.24


编辑 sql/mysqld.cc :
搜索:&max_connections, 0, GET_ULONG, REQUIRED_ARG, 100, 1, 16384, 0, 1,
修改:&max_connections, 0, GET_ULONG, REQUIRED_ARG, 1000, 1, 16384, 0, 1,

groupadd mysql
useradd -g mysql mysql

./configure \
--prefix=/server/mysql \
--sysconfdir=/server/mysql \
--without-isam \
--without-debug \
--enable-assembler \
--with-unix-socket-path=/tmp/mysql.sock \
--with-mysqld-user=mysql \
--with-extra-charset=all \
--with-client-ldflags=-all-static \
--with-mysqld-ldflags=-all-static \
--localstatedir=/data/mysql/data


如果出现了以下错误:
checking for tgetent in -ltermcap... no
checking for termcap functions library... configure: error: No curses/termcap library found

说明 curses/termcap 库没有安装
apt-cache search curses | grep lib

安装 libncurses5-dev ,然后重新运行配置

mkdir /data
mkdir /data/mysql
mkdir /data/mysql/data

make
make install

/server/mysql/bin/mysql_install_db --user=mysql

chown -R mysql /data/mysql
chgrp -R mysql /data/mysql
chown -R root /server/mysql
chgrp -R mysql /server/mysql
cp /server/mysql/share/mysql/my-medium.cnf /server/mysql/my.cnf

/server/mysql/share/mysql/mysql.server start
/server/mysql/bin/mysqladmin -u root password 123456789
cd ..


##### Apache2 #####

cd httpd-2.0.54

./configure --prefix=/server/httpd \
--enable-so \
--with-mysql=/server/mysqld \
--enable-cgi \
--with-config-file-path=/server/httpd/conf \
--enable-track-vars \
--enable-mods-shared=all \
--enable-cache \
--enable-disk-cache \
--enable-mem-cache \
--enable-rewrite \
--with-mpm=worker \
--with-ssl=/usr/local/ssl \
--enable-ssl

make
make install
cd ..


##### mod_deflate #####

cd httpd-2.0.54/httpdmodules/filters

/server/httpd/bin/apxs -i -c -a mod_deflate.c


修改 Apache 配置文件 /server/httpd/httpd.conf :
添加:
<Location />
# Insert filter
SetOutputFilter DEFLATE

# Netscape 4.x has some problems...
BrowserMatch ^Mozilla/4 gzip-only-text/html

# Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4\.0[678] no-gzip

# MSIE masquerades as Netscape, but it is fine
# BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

# NOTE: Due to a bug in mod_setenvif up to Apache 2.0.48
# the above regex won't work. You can use the following
# workaround to get the desired effect:
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html

# Don't compress images
SetEnvIfNoCase Request_URI \
\.(?:gif|jpe?g|png|ico)$ no-gzip dont-vary

# Make sure proxies don't deliver the wrong content
#Header append Vary User-Agent env=!dont-vary
</Location>

DeflateFilterNote ratio
LogFormat '"%v %h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i"" (%{ratio}n)' deflate

CustomLog logs/deflate_log deflate


然后
cd ..

##### FreeType #####

cd freetype-2.1.10

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

make
make install
cd ..


##### LibPNG #####

cd libpng-1.2.8

cp scripts/makefile.linux makefile

make test
make install
cd ..


##### Jpeg #####

cd jpeg-6b

mkdir /usr/local/jpeg
mkdir /usr/local/jpeg/bin
mkdir /usr/local/jpeg/lib
mkdir /usr/local/jpeg/include
mkdir /usr/local/jpeg/man
mkdir /usr/local/jpeg/man/man1
./configure --prefix=/usr/local/jpeg --enable-shared --enable-static

make
make install
cd ..


##### GD Library #####

cd gd-2.0.33

./configure --prefix=/usr/local/gd \
--with-jpeg=/usr/local/jpeg \
--with-freetype=/usr/local/freetype \
--with-png \
--with-zlib

make
make install
cd ..


##### ClibPDF #####

cd ClibPDF/source
cp Makefile.Linux makefile
make
make install
cd ..


##### PHP #####

cd php-4.3.11

./configure --prefix=/server/php \
--with-apxs2=/server/httpd/bin/apxs \
--with-gd=/usr/local/gd \
--enable-gd \
--enable-gd-native-ttf \
--with-jpeg-dir=/usr/local/jpeg \
--with-png \
--with-ttf \
--with-zlib \
--with-freetype-dir=/usr/local/freetype \
--enable-magic-quotes \
--with-mysql=/server/mysql \
--with-mysql-sock=/tmp/mysql.sock \
--with-iconv \
--with-mbstring \
--enable-mbstring \
--enable-track-vars \
--enable-force-cgi-redirect \
--enable-ftp \
--with-config-file-path=/server/httpd/conf \
--with-openssl=/usr/local/ssl \
--with-openssl-dir=/usr/local/ssl \
--with-cpdflib=/usr/local \
--with-pear=/server/php/pear

make
make install

cp php.ini-dist /server/httpd/conf/php.ini
cd ..


##### Zend Optimizer #####

cd ZendOptimizer-2.5.10-linux-glibc21-i386

./install


操作 [OK] [EXIT] [YES] [/server/zend] [/server/httpd/conf] [YES] [/server/httpd/bin/apachectl] [OK] [OK] [NO]

cd ..


##### mod_limitipconn #####

cd mod_limitipconn-0.22

/server/httpd/bin/apxs -i -c -a mod_limitipconn.c


修改 Apache 配置文件 /server/httpd/conf/httpd.conf:
查找:#ExtendedStatus On ,去掉注释"#"
查找:CustomLog logs/access_log common ,修改成 CustomLog logs/access_log common env=!LIMITIP
添加:
<IfModule mod_limitipconn.c>
    <Location />
        MaxConnPerIP 5
        NoIPLimit image/*
    </Location>

    <Location /mp3>
        MaxConnPerIP 2
        OnlyIPLimit audio/mpeg video
    </Location>
</IfModule>


然后
cd ..


##### Bandwidth Module #####

cd bw_mod-0.6

/server/httpd/bin/apxs -i -c -a bw_mod-0.6.c

cd ..


带宽限制在虚拟主机中设置

现在,WEB 服务已经安装完毕!
测试 WEB 服务:

mkdir /data/vhosts
mkdir /data/vhosts/localhost


启动 Apache2
/server/httpd/bin/apachectl start

如果出错请参考下一贴中的 httpd.conf 和 虚拟主机配置文件示例

MySQL 服务前面已经启动了,密码是:123456789

编辑一个 info.php 放在 /data/vhosts/localhost 下面,内容如下:

<?php
phpinfo();
?>


测试: http://localhost/info.php
OK,看到 PHP 信息了吧

<待续...>
最后编辑 [2005-06-23]
文章比较长,难免有错误,还请高手指教,谢谢
原文链接: http://bbs.micronsky.net/viewtopic.php?t=160



我是新手,请多多指教~~

Link: http://www.asm32.net/article_details.aspx?id=17


浏览次数 333 发布时间 2005/12/14 0:00:00 从属分类 SERVER 服务器 【评论】【 】【打印】【关闭
 
| www.asm32.net | 2006版 | 资料中心 | linux | asm/asm32 | C/C++ | VC++ | java | 书签 | ASP.Net书签 | 京ICP备09029108号-1