apache+php+jsp+mysql整合 系统软件: Linux 2.6.9-89.ELsmp httpd-2.2.6 mysql-5.0.20a php-5.2.5 mysql-connector-java-5.0.8.tar.tar jdk-1_5_0_11 resin-3.1.6 ---下载地址 强烈建议停掉系统默认自带的mysql [root@localhost ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/vg00-lvroot 3.9G 3.2G 527M 86% / /dev/sda1 99M 14M 81M 15% /boot none 147M 0 147M 0% /dev/shm /dev/mapper/vg00-lvapp 4.8G 42M 4.5G 1% /webapp 注意:在第一次做的时候,一定要注意版本的匹配问题,否则会很难成功的,当然,若按这个文档肯定成功,已经经过我的亲自测试 一 、安装步骤 1、安装mysql-5.0.20a [root@jieli software]# pwd /webapp/software [root@jieli software]# tar -zxvf mysql5.0.tar.gz ./mysql-5.0.20a/cmd-line-utils/libedit/hist.h ./mysql-5.0.20a/cmd-line-utils/libedit/refresh.c ./mysql-5.0.20a/cmd-line-utils/libedit/tokenizer.c [root@jieli software]# cd mysql-5.0.20a/ [root@jieli mysql-5.0.20a]# ./configure --prefix=/webapp/db/mysql --sysconfdir=/etc --localstatedir=/var/lib/mysql Remember to check the platform specific part of the reference manual for hints about installing MySQL on your platform. Also have a look at the files in the Docs directory.
Thank you for choosing MySQL!
[root@jieli mysql-5.0.20a]# make make[3]: Leaving directory `/webapp/software/mysql-5.0.20a/server-tools' make[2]: Leaving directory `/webapp/software/mysql-5.0.20a/server-tools' make[1]: Leaving directory `/webapp/software/mysql-5.0.20a' [root@jieli mysql-5.0.20a]# make install make[4]: Leaving directory `/webapp/software/mysql-5.0.20a/server-tools' make[3]: Leaving directory `/webapp/software/mysql-5.0.20a/server-tools' make[2]: Leaving directory `/webapp/software/mysql-5.0.20a/server-tools' make[1]: Leaving directory `/webapp/software/mysql-5.0.20a' [root@jieli mysql]# cd /webapp/db/mysql/bin/ [root@jieli bin]# ./mysql_install_db ------必须执行这个来生成基本数据库 Installing all prepared tables Fill help tables
To start mysqld at boot time you have to copy support-files/mysql.server to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER ! To do so, start the server, then issue the following commands: /webapp/db/mysql/bin/mysqladmin -u root password 'new-password' /webapp/db/mysql/bin/mysqladmin -u root -h jieli password 'new-password' See the manual for more instructions.
You can start the MySQL daemon with: cd /webapp/db/mysql ; /webapp/db/mysql/bin/mysqld_safe &
You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory: cd sql-bench ; perl run-all-tests
Please report any problems with the /webapp/db/mysql/bin/mysqlbug script!
The latest information about MySQL is available on the web at
Support MySQL by buying support/licenses at [root@jieli bin]# ./mysqld_safe --user=root & [1] 29019 [root@jieli bin]# Starting mysqld daemon with databases from /var/lib/mysql
2、安装jdk-1_5_0_11 [root@jieli software]# chmod +x jdk-1_5_0_11-linux-i586-rpm.bin 。。。。。。。。 [root@jieli software]# ./jdk-1_5_0_11-linux-i586-rpm.bin Do you agree to the above license terms? [yes or no] yes 。。。。。。。。 UnZipSFX 5.42 of 14 January 2001, by Info-ZIP (). inflating: jdk-1_5_0_11-linux-i586.rpm Preparing... ########################################### [100%] 1:jdk ########################################### [100%]
5、安装php-5.2.5 [root@jieli software]# tar -xvf php-5.2.5.tar php-5.2.5/README.UPDATE_5_2 php-5.2.5/README.UNIX-BUILD-SYSTEM php-5.2.5/buildconf.bat [root@jieli php-5.2.5]# ./configure --prefix=/webapp/www/php --with-apxs2=/webapp/www/apache/bin/apxs --with-config-file-path=/webapp/www/php --enable-sockets --with-mysql=/webapp/db/mysql/ +--------------------------------------------------------------------+ | License: | | This software is subject to the PHP License, available in this | | distribution in the file LICENSE. By continuing this installation | | process, you are bound by the terms of this license agreement. | | If you do not agree with the terms of this license, you must abort | | the installation process at this point. | +--------------------------------------------------------------------+
===================================================================== FAILED TEST SUMMARY
[root@jieli php-5.2.5]# make install pear/PEAR can optionally use package "pear/XML_RPC" (version >= 1.4.0) [PEAR] PEAR - installed: 1.6.1 Wrote PEAR system config file at: /webapp/www/php/etc/pear.conf You may want to add: /webapp/www/php/lib/php to your php.ini include_path Installing PDO headers: /webapp/www/php/include/php/ext/pdo/ [root@jieli php-5.2.5]# cp php.ini-dist /webapp/www/php/php.ini [root@jieli php]# cp php.ini php.ini-bak [root@jieli php]# vi php.ini ; Default socket name for local MySQL connects. If empty, uses the built-in ; MySQL defaults. mysql.default_socket =/tmp/mysql.sock mysql.sock =/tmp/mysql.sock 。。。。 ; to possible security problems, if the code is not very well thought of. register_globals = On ---修改成On,默认是off,否则会出现php不能直接读到post或get的数据的现象
[root@jieli php]# cd /webapp/www/apache/conf/ [root@jieli conf]# cp httpd.conf httpd.conf-bak [root@jieli conf]# vi httpd.conf DirectoryIndex index.php index.html