1.配置APACHE2
a). tar zxvf httpd-2.0.52.tar.gz
b). ./configure --prefix=/usr/local/apache --enable-so
c). make
d). make install
e). cp /usr/local/apache/bin/apachectl /etc/init.d/httpd
2.配置mysql
说明:在此我下载的是MYSQL5.0二进制包,不用编译直接配置,下面是从MYSQL中安装说明取出来的资料:
Installing a MySQL Binary Distribution
--------------------------------------
This chapter covers the installation of MySQL binary distributions
(`.tar.gz' Archives) for various platforms (see *Note MySQL binaries::
for a detailed list).
In addition to these generic packages, we also offer binaries in
platform-specific package formats for selected platforms. See *Note
Quick Standard Installation:: for more information on how to install
these.
The generic MySQL binary distributions are packaged as gzip-compressed
GNU tar archives (`.tar.gz'). You need the following tools to install a
MySQL binary distribution:
* GNU `gunzip' to uncompress the distribution.
* A reasonable `tar' to unpack the distribution. GNU `tar' is known
to work. Some `tar' implementations that come pre-installed with
the operating system (e.g. Sun `tar') are known to have problems
(with long file names, for example). In that case, you should
install GNU `tar' first.
If you run into problems, *please always use `mysqlbug'* when posting
questions to a MySQL mailing list. Even if the problem isn't a bug,
`mysqlbug' gathers system information that will help others solve your
problem. By not using `mysqlbug', you lessen the likelihood of getting
a solution to your problem. You will find `mysqlbug' in the `bin'
directory after you unpack the distribution. *Note Bug reports::.
The basic commands you must execute to install and use a MySQL binary
distribution are:
shell> groupadd mysql
shell> useradd -g mysql mysql
shell> cd /usr/local
shell> gunzip < /path/to/mysql-VERSION-OS.tar.gz | tar xvf -
shell> ln -s full-path-to-mysql-VERSION-OS mysql
shell> cd mysql
shell> scripts/mysql_install_db
shell> chown -R root .
shell> chown -R mysql data
shell> chgrp -R mysql .
shell> bin/mysqld_safe --user=mysql &
If your version of MySQL is older than 4.0, substitute `bin/safe_mysqld'
for `bin/mysqld_safe' in the final command.
You can add new users using the `bin/mysql_setpermission' script if you
install the `DBI' and `DBD::mysql' Perl modules.
A more detailed description follows.
To install a binary distribution, follow these steps, then proceed to
*Note Post-installation::, for post-installation setup and testing:
1. Pick the directory under which you want to unpack the
distribution, and move into it. In the following example, we
unpack the distribution under `/usr/local' (The following
instructions, therefore, assume you have permission to create
files and directories in `/usr/local'. If that directory is
protected, you will need to perform the installation as `root'.)
2. Obtain a distribution file from one of the sites listed in *Note
Getting MySQL: Getting MySQL.
MySQL binary distributions are provided as compressed `tar'
archives and have names like `mysql-VERSION-OS.tar.gz', where
`VERSION' is a number (for example, `3.21.15'), and `OS' indicates
the type of operating system for which the distribution is intended
(for example, `pc-linux-gnu-i586'). Note that all binaries are
built from the same MySQL source distribution.
3. Add a user and group for `mysqld' to run as:
shell> /usr/sbin/groupadd mysql
shell> /usr/sbin/useradd -g mysql mysql
These commands add the `mysql' group and the `mysql' user. The
syntax for `useradd' and `groupadd' may differ slightly on
different versions of Unix. They may also be called `adduser' and
`addgroup'. You may wish to call the user and group something
else instead of `mysql'.
4. Change into the intended installation directory:
shell> cd /usr/local
5. Unpack the distribution, which will create the installation
directory. Then create a symbolic link to that directory:
shell> gunzip < /path/to/mysql-VERSION-OS.tar.gz | tar xvf -
shell> ln -s full-path-to-mysql-VERSION-OS mysql
Using GNU tar, you can also replace the first line with the
following alternative command to decompress and extract the
distribution in one go:
shell> tar zxvf /path/to/mysql-VERSION-OS.tar.gz
The first command creates a directory named `mysql-VERSION-OS'.
The second command makes a symbolic link to that directory. This
lets you refer more easily to the installation directory as
`/usr/local/mysql'.
6. Change into the installation directory:
shell> cd mysql
You will find several files and subdirectories in the `mysql'
directory. The most important for installation purposes are the
`bin' and `scripts' subdirectories.
`bin'
This directory contains client programs and the server You
should add the full pathname of this directory to your `PATH'
environment variable so that your shell finds the MySQL
programs properly. *Note Environment variables::.
`scripts'
This directory contains the `mysql_install_db' script used to
initialize the `mysql' database containing the grant tables
that store the server access permissions.
7. If you would like to use `mysqlaccess' and have the MySQL
distribution in some non-standard place, you must change the
location where `mysqlaccess' expects to find the `mysql' client.
Edit the `bin/mysqlaccess' script at approximately line 18.
Search for a line that looks like this:
$MYSQL = '/usr/local/bin/mysql'; # path to mysql executable
Change the path to reflect the location where `mysql' actually is
stored on your system. If you do not do this, you will get a
`Broken pipe' error when you run `mysqlaccess'.
8. Create the MySQL grant tables (necessary only if you haven't
installed MySQL before):
shell> scripts/mysql_install_db
Note that MySQL versions older than Version 3.22.10 started the
MySQL server when you run `mysql_install_db'. This is no longer
true.
9. Change ownership of binaries to `root' and ownership of the data
directory to the user that you will run `mysqld' as:
shell> chown -R root /usr/local/mysql/.
shell> chown -R mysql /usr/local/mysql/data
shell> chgrp -R mysql /usr/local/mysql/.
The first command changes the `owner' attribute of the files to the
`root' user, the second one changes the `owner' attribute of the
data directory to the `mysql' user, and the third one changes the
`group' attribute to the `mysql' group.
10. If you want to install support for the Perl `DBI'/`DBD' interface,
see *Note Perl support::.
11. If you would like MySQL to start automatically when you boot your
machine, you can copy `support-files/mysql.server' to the location
where your system has its startup files. More information can be
found in the `support-files/mysql.server' script itself and in
*Note Automatic start::.
After everything has been unpacked and installed, you should initialize
and test your distribution.
You can start the MySQL server with the following command:
shell> bin/mysqld_safe --user=mysql &
If your version of MySQL is older than 4.0, substitute `bin/safe_mysqld'
for `bin/mysqld_safe' in the command.
Now proceed to *Note `mysqld_safe': mysqld_safe, and *Note
Post-installation::.
进到/usr/local/mysql下
cp support-files/mysql.server /etc/init.d/mysql
cp support-files/my-medium.cnf /etc/my.cnf
chmod 755 /etc/init.d/mysql
/etc/init.d/mysql start/stop/restart
进到/usr/local/mysql/bin
./mysql -u root -p
进入msyql数据库
3.PHP配置
我这里装的是PHP4.3.9
1). tar zxvf php-4.3.9.tar.gz
2) ./configure --prefix=/usr/local/php --with-mysql=/usr/local/mysql --with-apxs2=/usr/local/apache/bin/apxs --enable-track- vars
3). make
4). make install
5). cp php.ini-dist /usr/local/lib/php.ini
6).编辑 httpd.conf 文件以调用 PHP 模块。LoadMolude 表达式右边的路径必须指向您
系统中的 PHP。以上的 make install 命令可能已经帮您完成了这些,但务必要检查。
对于 PHP 4:
LoadModule php4_module modules/libphp4.so
对于 PHP 5:
LoadModule php5_module modules/libphp5.so
7).告知 Apache 将特定的扩展名解析成 PHP,例如,我们让 Apache 将扩展名 .php
解析成 PHP。您可以将任何扩展名指定为 PHP,只需添加它们,每一个用空格分隔。
例如,我们要添加 .phtml:
AddType application/x-httpd-php .php .phtml
通常,我们还将 .phps 扩展名设置成显示高亮的 PHP 源文件,可以这样来完成:
AddType application/x-httpd-php-source .phps
参考材料:
1. gzip -d httpd-2_0_NN.tar.gz 2. tar xvf httpd-2_0_NN.tar 3. gunzip php-NN.tar.gz 4. tar -xvf php-NN.tar 5. cd httpd-2_0_NN 6. ./configure --enable-so 7. make 8. make install 现在您已经将 Apache 2.0.NN 安装在 /usr/local/apache。本安装支持可装载模块 和标准的 MPM prefork。之后,可以使用如下命令启动 Apache 服务器: /usr/local/apache2/bin/apachectl start 如果成功,您可以停止 Apache 服务器并继续安装 PHP: /usr/local/apache2/bin/apachectl stop. 9. cd ../php4-NN 10. 现在我们需要配置 PHP。在这里您可以用各种各样的参数来自定义PHP,例如启动哪 些扩展功能包的支持等。用 ./configure --help 命令可以列出当前可用的所有参 数。在我们的例子中,我们将给出一个在有 MySQL 支持的 Apache 2 上进行配置的 范例。您本地的 apxs 的路径可能会不同,事实上,在您的系统中,它可能被命名为 apxs2。 ./configure --with-apxs2=/usr/local/apache2/bin/apxs 11. make 12. make install 如果您决定在安装后改变配置选项,您只需重复最后的三步,然后需要重新启动 Apache 使新模块生效。无需重新编译。 请注意,除非明确有提示,否则 'make install' 命令将安装 PEAR、各种 PHP 工具 诸如 phpize,安装 PHP CLI 等等。 13. 配置 php.ini cp php.ini-dist /usr/local/lib/php.ini 您可以编辑 php.ini 文件以修改 PHP 的选项。如果您想要把此文件放到另外的位置, 您需要在步骤 10 添加 --with-config-file-path=/path 选项。 如果您选择 php.ini -recommended,请务必阅读其中的变更的列表,它们将影响 PHP 的执行。 14. 编辑 httpd.conf 文件以调用 PHP 模块。LoadMolude 表达式右边的路径必须指向您 系统中的 PHP。以上的 make install 命令可能已经帮您完成了这些,但务必要检查。 对于 PHP 4: LoadModule php4_module modules/libphp4.so 对于 PHP 5: LoadModule php5_module modules/libphp5.so 15. 告知 Apache 将特定的扩展名解析成 PHP,例如,我们让 Apache 将扩展名 .php 解析成 PHP。您可以将任何扩展名指定为 PHP,只需添加它们,每一个用空格分隔。 例如,我们要添加 .phtml: AddType application/x-httpd-php .php .phtml 通常,我们还将 .phps 扩展名设置成显示高亮的 PHP 源文件,可以这样来完成: AddType application/x-httpd-php-source .phps 16. 启动您的 Apache 服务器: /usr/local/apache2/bin/apachectl start