简洁的想法

 找回密码
 注册
搜索
查看: 616|回复: 0

Apache安装指南

[复制链接]
发表于 2003-4-16 20:41:53 | 显示全部楼层 |阅读模式
1。准备工作

下载以下软件包:

软件包名称  说明    相关站点
apache 1.3.12 apache WebServer 基本包 www.apache.org
mysql 3.22.32 mysql DataBase  www.mysql.com
php 4   php4    支持 www.php.net
openssl 0.9.5 mod_ssl需要它已安装 www.openssl.org
mod_ssl 2.6.2-1.3.12 apache 与 openssl的接口 www.modssl.org
mod_perl 1.21 mod_perl   www.apache.org
gd 1.3  gd 图形库1.3->gif | 1.7->png gd.pm www.boutell.com/gd
phpMyAdmin 2.0.5 数据库管理的web工具 www.htmlwizard.net/phpMyAdmin/
webalizer 1.30 流量分析工具   www.mrunix.org



2。开始安装

(1) openssl

To install OpenSSL, you will need:

* Perl 5
* an ANSI C compiler
* a supported Unix operating system

$ ./config //default install to /usr/local/ssl
$ make
$ make test
$ make install

(2) gd 1.3 // copy gd1.3 to /usr/local/gd1.3

* gd1.3可以支持gif,但gd 1.73 不再支持gif,仅支持png

$ make all //this will produce libgd.a , 如果想在webalizer中使用,

把libgd.a copy to /usr/lib and gd*.h to /usr/local/include

(3) mysql

To install mySQL, you will
$ ./configure --prefix=/usr/local/mysql \
> --with-named-thread-libs=-lc_r \ //freebsd 3.x
> --with-charset=CHARSET use specified charset (default is latin1, must be one of: big5 cp1251 cp1257 croat czech danish dec8 dos estonia euc_kr gb2312 gbk german1 greek hebrew hp8 hungarian koi8_ru koi8_ukr latin1 latin2 swe7 usa7 win1250 win1251 win1251_ukr ujis sjis tis620)


$ make
$ make check //Optionally,run any self-tests that come with the package.
$ make install

安装完成后
$ /usr/local/mysql/bin/safe_mysqld &


启动 mysqld 服务器,如需机器重启动后自动运行,将该行命令加入/usr/local/etc/rc.d/mysql-server.sh

#!/bin/sh

# if [ -x /usr/local/mysql/bin/safe_mysqld ]
then
/usr/local/mysql/bin/safe_mysqld > /dev/null & && echo -n ' mysql'
fi

/usr/local/etc/rc.d/mysql-client.sh

#!/bin/sh

# /sbin/ldconfig -m /usr/local/mysql/lib/mysql

(4) apache 1.3.12 + php 4 + mod_perl + mod_ssl

# extract the packages
$ tar xzvf apache_1.3.x.tar.gz
$ tar xzvf mod_ssl-2.5.x-1.3.x.tar.gz
$ tar xzvf mod_perl-1.xx.tar.gz
$ tar xzvf php-4.0.x.tar.gz

# apply mod_ssl to Apache source tree
$ cd /mod_ssl-2.5.x-1.3.x
$ ./configure \
> --with-apache=../apache_1.3.x
$ cd ..

# apply mod_perl to Apache source tree
# and build/install the Perl-side of mod_perl
$ cd mod_perl-1.xx
$ perl Makefile.PL \
> EVERYTHING=1 \
> APACHE_SRC=../apache_1.3.x/src \
> USE_APACI=1 \
> PREP_HTTPD=1 \
> DO_HTTPD=1
$ make
$ make install
$ cd ..

# pre-configure Apache for PHP3's configure step
$ cd apache_1.3.x
$ ./configure \
> --prefix=/path/to/apache
$ cd ..

# configure PHP4 and apply it to the Apache source tree
$ cd ../php-4.0.x
$ CFLAGS='-O2 -I/path/to/openssl/include' \
> ./configure \
> --with-apache=../apache_1.3.x \
> --with-mysql=/path/to/mysql \
> --with-gd=/path/to/gd1.3 \ //with support gd1.3 with gif
> --with-ftp \
> --enable-memory-limit=yes \
> --enable-debug=no
$ gmake
$ gmake install
$ cd ..

# build/install Apache with mod_ssl and mod_perl and PHP3
$ cd apache_1.3.x
$ SSL_BASE=/path/to/openssl ./configure \
> --prefix=/path/to/apache \
> --enable-module=ssl \ //ssl support
> --activate-module=src/modules/perl/libperl.a \ //mod_perl support
> --enable-module=perl \
> --activate-module=src/modules/php4/libphp4.a \ //php4 support
> --enable-module=php4
$ make
$ make certificate
$ make install
$ cd ..

(5) webalizer 1.30

# 首先安装 gd 1.3
$ ./configure [--with-language=lang --with-gdlib=/usr/lib --with-gd=/usr/local/include/gd]
$ make
$ make install //default install webalizer(program) to /usr/local/bin

访问统计需要单独的combined日志 access_log

建立自动运行crontab:
用该用户登录
$ crontab -e


分/小时 小时/天 天/月 周/月 日/周 执行文件的用户身份 待执行命令
10 0 * * * root /usr/local/command


本例为每天00:10执行/usr/local/command命令,一般用户的执行身份可以省略

webalizer 命令行参数
$ webalizer [option] logfile


-h help -c file 指定config file
-d debug -n name 指定hostname
-v 版本 -o dir 指定输出目录
-F FTP log -q[-Q] quiet

(6) phpMyAdmin 2.0.5

$ tar xzvf phpMyAdmin2.0.5

将其解压缩到webserver能访问到的地方即可 ,配置文件为config.inc.php3
$cfgServers[1]['adv_auth'] = false; //if 'true' then will enter password when visit
require("chinese_gb.inc.php3"); //支持中文


作者: 黑猫警长
来源: 小卒万维网
您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|Archiver|简洁的想法

GMT+1, 2021-4-19 01:42

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表