现在安装php语言。你下载了最新的beta版,但是你可能必须下载非beta版本。记住beta版本需要gnu make。
你仍然假定是root,如果不是,su回到root。
php要求你已经预先配置好的apache,以便它能知道所需的东西在哪儿。在以后你安装apache服务器时,你将会回到这里。改变到你有源代码的目录。
# cd /tmp/download
# gunzip -c apache_1.3.x.tar.gz tar xf -
# cd apache_1.3.x
# ./configure
# cd ..
好的,现在你可以开始php的安装。提取源代码文件并进入其目录。如果你下载了版本3,在数字和命令上有一个改变,不大的改变。
# gunzip -c php-4.0.x.tar.gz tar xf -
# cd php-4.0.x
如果你正在编译代码,configure将永远是你的朋友。:-) 因此,configure有很多选项。使用configure --help确定你想要增加哪些。我只是需要mysql和ldap,并且当然apache。
# ./configure --with-mysql=/usr/local/mysql
--with-xml
--with-apache=../apache_1.3.x
--enable-track-vars
--with-ldap
make并安装二进制代码。
# make
# make install
拷贝ini文件到lib目录。
# cp php.ini-dist /usr/local/lib/php.ini
你可以编辑php文件来设置php选项,如你可以通过在你的php.ini文件中插入下列行,增加php的max_execution_time。
max_execution_time = 60;
注意:php3用户将使用php3.ini,而php4用户将使用php.ini文件。
apache 与 mod_ssl
该配置并安装mod_ssl和apache了。对此,你将需要有rsaref-2.0文件。在http://ftpsearch.lycos.com/上搜索“rsaref20.tar.z”。如果你不喜欢lycos,你可以选择其他搜索引擎来搜索文件。当然只有你在美国才需要这个文件。(管它呢,你也可从别处下载,首先在http://ftpsearch.ntnu.no/查找“rsaref20.tar.z”,好多啊!。)
创建rasref目录,你将在该目录提取文件。注意。这假定你下载了一个临时目录,而你就在此目录。
# mkdir rsaref-2.0
# cd rsaref-2.0
# gzip -d -c ../rsaref20.tar.z tar xvf -
现在配置并构造openssl库。
# cd rsaref-2.0
# cp -rp install/unix local
# cd local
# make
# mv rsaref.a librsaref.a
# cd ../..
安装openssl。记住,你将用它来创建临时证书和csr文件。--prefix选项指定主安装目录。
# cd openssl-0.9.x
# ./config -prefix=/usr/local/ssl
-l`pwd`/../rsaref-2.0/local/ rsaref -fpic
现在make、测试并安装它。
# make
# make test
# make install
# cd ..
我们将配置mod_ssl模块,然后用apache配置指定它为一个可装载的模块。
# cd mod_ssl-2.5.x-1.3.x
# ./configure
--with-apache=../apache_1.3.x
# cd ..
现在我们可以把更多的apache模块加到apache源代码树中。可选的--enable-shared=ssl选项使得mod_ssl构造成为一个dso“libssl.so”。关于在apache支持dso的更多信息,阅读apache源代码树中的install和 htdocs/manual/dso.html文档。我强烈建议isp和软件包装维护者为了最灵活地使用mod_ssl而使用dso工具,但是注意,dso不是在所有平台上的apache都支持。
# cd apache_1.3.x
# ssl_base=../openssl-0.9.x
rsa_base=../rsaref-2.0/local
./configure --enable-module=ssl
--activate-module=src/modules/php4/libphp4.a
--enable-module=php4 --prefix=/usr/local/apache
--enable-shared=ssl
[...你可加入更多的选项...]
生成apache,然后生成证书,并安装...
# make
如果你已正确地完成,你将得到类似于以下的信息:
+-----------------------------------------------------------------------+
before you install the package you now should prepare the ssl
certificate system by running the "make certificate" command.
for different situations the following variants are provided:
% make certificate type=dummy (dummy self-signed snake oil cert)
% make certificate type=test (test cert signed by snake oil ca)
% make certificate type=custom (custom cert signed by own ca)
% make certificate type=existing (existing cert)
crt=/path/to/your.crt [key=/path/to/your.key]
use type=dummy when you’re a vendor package maintainer,
the type=test when you’re an admin but want to do tests only,
the type=custom when you’re an admin willing to run a real server
and type=existing when you’re an admin who upgrades a server.
(the default is type=test)
additionally add algo=rsa (default) or algo=dsa to select
the signature algorithm used for the generated certificate.
use "make certificate view=1" to display the generated data.
thanks for using apache & mod_ssl. ralf s. engelschall
rse@engelschall.com
www.engelschall.com
+-----------------------------------------------------------------------+
现在你可以创建一个定制的证书。该选项将提示输入你的地址、公司、和其他一些东西。关于证书,请参阅本文的结尾。
# make certificate type=custom
现在安装apache...
# make install
如果一切正常,你应该看到类似于以下的信息:
+----------------------------------------------------------------------------------+
you now have successfully built and installed the
apache 1.3 http server. to verify that apache actually
works correctly you now should first check the
(initially created or preserved) configuration files
/usr/local/apache/conf/httpd.conf
and then you should be able to immediately fire up
apache the first time by running:
/usr/local/apache/bin/apachectl start
or when you want to run it with ssl enabled use:
/usr/local/apache/bin/apachectl startssl
thanks for using apache. the apache group
http://www.apache.org /
+----------------------------------------------------------------------------------+
现在验证apache和php是否正在工作。然而,我们需要编辑srm.conf和httpd.conf保证我们把php类型加到了配置中。查看httpd.conf并去掉下列行的注释。如果你精确地遵循了本文的指令,你的httpd.conf文件将位于/usr/local/apache/conf目录。文件有一行针对php4的addtype加了注释,现在就去掉注释。httpd.conf 文件--片断
>
> # and for php 4.x, use:
> #
---> addtype application/x-httpd-php .php
---> addtype application/x-httpd-php-source .phps
>
>
现在我们准备启动apache服务器看它是否在工作。首先我们将启动不支持ssl的服务器看它是否启动了。我们将检查对php的支持,然后我们将停止服务器并且启动启用了ssl支持的服务器并检查我们是否一切正常。configtest 将检查所有配置是否正确设置。
# cd /usr/local/apache/bin
# ./apachectl configtest
syntax ok
# ./apachectl start
./apachectl start: httpd started
测试我们的工作
Java Asp PHP .Net XML C/C++ CGI VB Jsp J2ee J2se J2me EJB Servlet Tomcat Resin Struts Weblogic Eclipse ANT GUI JMS Web servise IDEA Webphere Hibernate Spring Jboss Applet Swing Socket Javamail Perl Ajax P2P 安全 模式 框架 测试 开源 游戏
Windows XP Windows 2000 Windows 2003 Windows Me Windows 9.x Linux UNIX 注册表 操作系统 服务器 应用服务器