由 konds 在 12-27-2002 12:40 发表:
Building Apache on FreeBSD and LINUX (EN+CN版)easy~~~~~
由于我英文水平不高.只把主要的译一下,朋友们把主要的做出来就可以了.难免会有错误.发现错误请指出以便修改.谢谢
Apache: Building MySQL, PHP, Mod_Perl and Mod_SSL Support
Comprehensive Guide to Building Apache on FreeBSD and LINUX
1. Getting Started
2. Downloads
3. Building MySQL
4. Building PHP
5. Building SSL
6. Building mod_perl
7. Building Apache
1. Getting Started
Before you begin to build Apache and various third party modules, make sure you have access to a system with gcc and Perl.
Almost all FreeBSD and Linux systems will have these by default.
In this guide, we will look at a typical yet complex Apache build. That is, we are building Apache along with some popular
third party add-ons. In our case, we are building an Apache Web Server with support for MySQL, PHP, SSL, and mod_perl. If
you decide that you dont want all these features, simply omit the respective steps.
One final point. The approach used here is one in which we build everything from scratch. No binaries are used. This
actually tends to make the process more seemless.
2. Downloads
To begin, we need to download the following to the root level of our system:
我们要这些包包~~~
Apache (/apache_1.3.24.tar.gz)
MySQL (/mysql-3.23.49.tar.gz)
PHP (/php-4.2.0.tar.gz)
mod_ssl (/mod_ssl-2.8.8-1.3.24.tar.gz)
OpenSSL (/openssl-0.9.6d.tar.gz)
mod_perl (/mod_perl-1.26.tar.gz)
RSAREF (/rsaref-2.0.tar)
You can find these files at the following respective URLs:
http://www.essenz.com/downloads/
3. Building MySQL
用su命令进root环境
First, get superuser access.
su root
进入你download文件夹
本列把包down到了/目录下
Now, goto the root level of your system where the downloads are.
cd /
解压MySQL
Unpack MySQL
gunzip -f mysql-3.23.49.tar.gz
tar xvf mysql-3.23.49.tar
进解压后的目录
Go into MySQL Directory
cd mysql-3.23.49
编译mysql
Build it
configure --prefix=/usr/local/mysql
make
make install
初步设置
Some preliminary setup
/mysql-3.23.49/scripts/mysql_install_db
cd /usr/local/mysql/bin
./safe_mysqld &
./mysqladmin -u root password 'your-new-password'
这里是安装MySQL到其他平台相关的问题.不用去看他
That is about it for MySQL. If you want, you could simply install a binary version of MySQL, but just make sure you know
the path of where it is installed. There are some platform related issues when installing MySQL. For instance, on FreeBSD
your need to create the following user:
mysql:*:88:88::0:0:MySQL Daemon:/usr/local/mysql/var:/sbin/nologin
If you have trouble with the MySQL installation, just ask around on your favorite MySQL mailing list. I dont want to
elaborate to much on it here since this guide is for Apache, not MySQL.
4. Building PHP
进入php包的文件夹
Goto the root level of your system where the downloads are.
cd /
解压php包
Unpack PHP
gunzip -f php-4.2.0.tar.gz
tar xvf php-4.2.0.tar
编译PHP时,因为要为阿帕奇编译环境准备做。 SO,我们就这样搞~~~
When building PHP, we need to have the Apache build environment ready. So we do the following:
cd /
gunzip -f apache_1.3.24.tar.gz
tar xvf apache_1.3.24.tar
cd apache_1.3.24
./configure --prefix=/usr/local/apache
ok.NOW.我们回来搞定php
Thats it. Now we switch back over to PHP.
cd /php-4.2.0
编译php
Now we build PHP
./configure --with-mysql=/usr/local/mysql --with-xml --with-apache=../apache_1.3.24 --enable-track-vars
make
make install
cp php.ini-dist /usr/local/lib/php.ini
And thats it.
5. Building SSL
为SSL要编译rsaref,openssl,还要准备mod-ssl包包
For SSL we need to build rsaref, openssl, and prepare mod_ssl.
编译 rsaref
他说可以跳过.but.为安全起见还是把他搞了再说
Lets build rsaref (Skip this if you are outside the US)
cd /
mkdir RSA
mv rsaref.tar ./RSA
cd RSA
tar xvf rsaref.tar
cp -rp install/unix local
make
mv rsaref.a librsaref.a
gogogo
先把openssl搞定
Now we move on to OpenSSL
cd /openssl-0.9.6d
./config --prefix=/usr/local/ssl \
-L'pwd'/RSA/local/rsaref -fPIC
make
make test
make install
现在搞定mod_ssl
Now we prepare mod_ssl for Apache
cd /mod_ssl-2.8.8-1.3.24
./configure --with-apache=/apache_1.3.24
注意看.不要放过下列信息哟.
You should see something like this:
Configuring mod_ssl/2.8.8 for Apache/1.3.24
+ Apache location: /apache_1.3.24 (Version 1.3.24)
+ Auxiliary patch tool: ./etc/patch/patch (local)
+ Applying packages to Apache source tree:
o Extended API (EAPI)
o Distribution Documents
o SSL Module Source
o SSL Support
o SSL Configuration Additions
o SSL Module Documentation
o Addons
Done: source extension and patches successfully applied.
在这一节,每件事是为编译阿帕奇干的。 OpenSSL安装和mod-ssl是为apache 准备的
so,PHP被安装并且是准备好建造成为apache 在下一段中,我们会搞出个更流行的apache的特性。
At this point, everything is setup to be built into Apache. OpenSSL is installed and mod_ssl is ready to be built into
Apache. Likewis