apache mysql tomcat_Apache+php+mysql+tomcat整合方法 | 学步园

环境:

windows XP sp2

jdk1.5

安装文件:

apache2.0.55

php-4.4.2-Win32(noinstall)

mysql-noinstall-5.0.18

tomcat5.0.25

jakarta-tomcat-connectors-jk2.0.4-win32-apache2.0.49(mod_jk2.so)

步骤(如何配置tomcat和mysql等略):

1.安装apache2.0.55 (c:/apache)

2.解压php-4.4.2-win32.zip (c:/php)

3.解压mysql-noinstall-5.0.18.zip (c:/mysql)

4.解压tomcat (c:/comcat)

5.拷贝mod_jk2.so到 c:/apache/moudle/

6.拷贝c:/php下的php.ini-dist到c:/windows系统目录下,并改名php.ini

7.打开c:/apache/conf/httpd.conf

添加

LoadModule jk2_module modules/mod_jk2.so

ScriptAlias /php/ "c:/php/"

AddType application/x-httpd-php .php3 .php .phtml

Action application/x-httpd-php "/php/php.exe"

修改

DirectoryIndex index.html index.jsp index.php

去掉以下注释,并修改

ServerAdmin webmaster@dummy-host.example.com

DocumentRoot c:/tomcat/webapps/mySite

ServerName localhost

ErrorLog logs/dummy-host.example.com-error_log

CustomLog logs/dummy-host.example.com-access_log common

tomcat/conf/server.xml:

8.在c:/apache/conf下新增一文件 workers2.properties:

# Usually commented out on production environments

[logger.apache2]

file=”c:/apache/logs/error.log”

level=ERROR

# Provide the basic config needed

[config]

file=c:/apache/conf/workers2.properties

debug=1

# Provide the location of shm file on the Apache web server

[shm]

file=c:/apache/conf/jk2.shm

size=1048576

[channel.socket:localhost:8009]

port=8009

host=localhost

#define the worker

[ajp13:localhost:8009]

channel=channel.socket:localhost:8009

# Map the Tomcat examples webapp to the Web server uri space

#[uri:/*]

[uri:/*.jsp]

worker=ajp13:localhost:8009

[uri:/servlet/*]

worker=ajp13:localhost:8009

[uri:/*.do]

worker=ajp13:localhost:8009

9.去掉c:/tomcat/conf/jk2.properties前面的注释(经过试验不改也能通过):

handler.list=apr,request,channelJni

channelSocket.port=8019

shm.file=c:/apache/conf/jk2.shm

channelJni.disabled = 0

apr.jniModeSo=c:/apache/modules/mod_jk2.so

apr.jniModeSo=inprocess

10.建一目录 c:/phpTest ,打开c:/apache/conf/httpd.conf,添加

Alias /luntan "C:/phpTest/"

Options Indexes MultiViews

AllowOverride None

Order allow,deny

Allow from all

11.新建一文件c:/phpTest/test.php,内容为: phpinfo(); ?>

ok!

另:

安装Discuz!论坛时连接mysql数据库如遇到"... Client does not support authentication protocol" 问题,

原因:MySQL 5.0 uses an authentication protocol based on a password hashing algorithm that is incompatible with that used by older (pre-4.1) clients. If you upgrade the server from 4.1, attempts to connect to it with an older client may fail with the following message:

解决方法:

mysql> SET PASSWORD FOR

-> 'some_user'@'some_host' = OLD_PASSWORD('newpwd');

mysql> UPDATE mysql.user SET Password = OLD_PASSWORD('newpwd')

-> WHERE Host = 'some_host' AND User = 'some_user';

mysql> FLUSH PRIVILEGES;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值