荔园在线
荔园之美,在春之萌芽,在夏之绽放,在秋之收获,在冬之沉淀
[回到开始]
[上一篇][下一篇]
发信人: cycker (TryToDoEverythingOnLinux), 信区: Linux
标 题: Howto Build, Install, Secure &Optimize PHP(1)
发信站: 荔园晨风BBS站 (Sun May 18 10:54:35 2003), 站内信件
How to Build, Install, Secure & Optimize PHP(1)
Written by Gerhard Mourani <gmourani@openna.com>
Corrected by Colin Henry <Colin.Henry@ubsw.com>
This document is copyright(c) 2002 for Open Network Architecture Inc. (OpenNA)
and it is a FREE document. You may redistribute it under the terms of the GFDL.
This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. Permission is granted to copy, distribute and/or modify
this document under the terms of the GNU Free Documentation License, Version
1.1 or any later version published by the Free Software Foundation; with no
Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A
copy of the license is available at http://www.gnu.org/copyleft/fdl.html.
Abstract
This document is a tutorial related to the Apache web server, you should read
it only if you have installed Apache on your system and want to provide and
make it run with some additional feature. Here we talk about PHP with Apache.
Everyone using a web server knows about PHP and its possibilities. It seems
that PHP will certainly replace other language like Perl or CGI for web
services in the future. This is due to its simplicity of use and many
developers known about this and has already developed software that run with
PHP on a web server. When you need to add some popular web service to your
web server, you will inevitably find that PHP is required and that you need
to install it with Apache. In this chapter we discuss about the way to
integrate it with Apache as a module because we already have compiled and
installed Apache in the previous chapter with modules support.
In regard to the previous book (Securing & Optimizing Linux: The Ultimate
Solution), I've decided to explain you how to compile and install PHP with
most interesting third party services like MySQL, PostgreSQL, LDAP, IMAP, and
SSL support. This will let us enable or disable which service and feature we
want to provide with PHP for our web server in an easy way without the need
to recompile the software every time we decide to add or remove features.
From the point of view of performance, there is no so big difference if we run
PHP as a module with Apache.
Building PHP as a module support into the Apache web server has some
interesting advantage because we can easily upgrade the software when
required without the need to rebuild the whole Apache web server.
PHP (recursive acronym for "PHP: Hypertext Preprocessor") is a widely-used
open source general-purpose scripting language that is especially suited for
web development and can be embedded into HTML. PHP is mainly focused on
server-side scripting, so you can do anything any other CGI program can do,
such as collect form data, generate dynamic page content, or send and receive
cookies. But PHP can do much more. Just look on the Internet for the myriad of
open source software available in PHP language.
These installation instructions assume
Commands are Unix-compatible.
The source path is /var/tmp (note that other paths are possible, at personal
discretion).
Installations were tested on OpenNA Linux & Red Hat Linux 7.3.
All steps in the installation will happen using the super-user account "root".
Whether kernel recompilation may be required: No
Latest PHP version number is 4.2.3
The procedures given in this chapter are likely to work on all Linux platforms,
but we have only tested it on OpenNA Linux and Red Hat Linux.
Packages
The following is based on information listed by PHP as of 2002/09/06. Please
regularly check http://www.php.net/ for the latest status. We chose to install
the required component from a source file because it provides the facility to
fine tune the installation.
Source code is available from:
PHP Homepage: http://www.php.net/
You must be sure to download: php-4.2.3.tar.gz
Prerequisites
PHP requires that the software below is already installed on your system to be
able to compile successfully. If this is not the case, you must install it.
Please make sure you have this program installed on your machine before you
proceed with this chapter.
* Apache is required to be able to use PHP in your system.
* OpenSSL is required to be able to use PHP with SSL support in your
system.
* imap-devel is required to be able to build PHP in your system.
* mysql is required to be able to use PHP in your system.
* mysql-devel is required to be able to build PHP in your system.
* postgresql package is required to be able to use PHP in your system.
* postgresql-devel package is required to be able to build PHP in your
system.
* openldap package is required to be able to use PHP in your system.
* openldap-devel package is required to be able to build PHP in your
system.
* bzip2-devel package is required to be able to build PHP in your system.
* libpng package is required to be able to use PHP in your system.
* libpng-devel package is required to be able to build PHP in your system.
* libjpeg package is required to be able to use PHP in your system.
* libjpeg-devel package is required to be able to build PHP in your system.
* freetype package is required to be able to use PHP in your system.
* freetype-devel package is required to be able to build PHP in your system.
* gd package is required to be able to use PHP in your system.
* gd-devel package is required to be able to build PHP in your system.
* aspell package is required to be able to use PHP in your system.
* pspell package is required to be able to use PHP in your system.
* pspell-devel package is required to be able to build PHP in your system.
* perl package is required to be able to use PHP in your system.
* file package is required to be able to use PHP in your system.
* gmp package is required to be able to use PHP in your system.
* gmp-devel package is required to be able to use PHP in your system.
* zlib-devel package is required to be able to use PHP in your system.
* pam-devel package is required to be able to use PHP in your system.
Pristine source
If you don't use the RPM package to install this program, it will be difficult
for you to locate all the files installed on the system in the eventuality of
an update in the future. To solve the problem, it is a good idea to make a
list of files on the system before you install PHP, and then one afterwards,
and then compare them using the diff utility to find out what files were
placed where.
* Simply run the following command before installing the software:
[root@deep root]# find /* > PHP1
* And the following one after you install the software:
[root@deep root]# find /* > PHP2
* Then use the following command to get a list of what changed:
[root@deep root]# diff PHP1 PHP2 > PHP-Installed
With this procedure, if any upgrade appears, all you have to do is to read
the generated list of what files were added or changed by the program and
remove them manually from your system before installing the new software.
In the example above, we use the /root directory of the system to store all
generated list files.
--
Welcome to CYCKER'S LINUX_SOFT FTPD ftp://192.168.36.220
※ 来源:·荔园晨风BBS站 bbs.szu.edu.cn·[FROM: 192.168.36.220]
[回到开始]
[上一篇][下一篇]
荔园在线首页 友情链接:深圳大学 深大招生 荔园晨风BBS S-Term软件 网络书店