<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[虫虫的blog  SINCE2004]]></title> 
<link>http://www.zhenghe.biz/index.php</link> 
<description><![CDATA[人生幻灯片  -   前半生(身)，不要怕；后半生(身)，不要悔！]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[虫虫的blog  SINCE2004]]></copyright>
<item>
<link>http://www.zhenghe.biz/read.php/.htm</link>
<title><![CDATA[Apache+php+mysql+phpmyadmin+j2sdk+tomcat整合方法]]></title> 
<author>网络毛毛虫 &lt;admin@yourname.com&gt;</author>
<category><![CDATA[技术文章]]></category>
<pubDate>Sat, 04 Dec 2004 15:38:42 +0000</pubDate> 
<guid>http://www.zhenghe.biz/read.php/.htm</guid> 
<description>
<![CDATA[ 
	Windows 2003平台下Apache2.0.49+PHP4.3.6+MySQL4.0.18+PhpMyadmin2.5.6+JK2.0.4+J2S<br />DK1.4.2_4+Tomcat5.0.19完全整合方法<br />flyfox <br /><br />首先从internet上下载以上所有软件包<br />以下是下载地址：<br />Apache <a href="http://httpd.apache.org/" target="_blank"><font color="#4f4d7c">http://httpd.apache.org/</font></a><br /><br />PHP：<a href="http://www.php.net/" target="_blank"><font color="#4f4d7c">http://www.php.net/</font></a><br /><br />MySQL：<a href="http://dev.mysql.com/downloads/" target="_blank"><font color="#4f4d7c">http://dev.mysql.com/downloads/</font></a><br /><br />PhpMyadmin：<a href="http://sourceforge.net/projects/phpmyadmin/" target="_blank"><font color="#4f4d7c">http://sourceforge.net/projects/phpmyadmin/</font></a><br /><br />J2SDK：<a href="http://java.sun.com/j2ee/download.html" target="_blank"><font color="#4f4d7c">http://java.sun.com/j2ee/download.html</font></a><br /><br />Tomcat：<a href="http://apache.linuxforum.net/dist/jakarta/tomcat-5/" target="_blank"><font color="#4f4d7c">http://apache.linuxforum.net/dist/jakarta/tomcat-5/</font></a><br /><br />JK2:<a href="http://apache.linuxforum.net/dist/jakarta/tomcat-connectors/jk2/binaries/" target="_blank"><font color="#4f4d7c">http://apache.linuxforum.net/dis ... ctors/jk2/binaries/</font></a><br /><br />注意以上软件包，如果有的选择的应该选用windows平台下的。<br /><br />安装和配置步骤：<br />1. 先装Apache,按缺省安装即可（假设安装到D:\Aache2）,测试方法在浏览器中输入<br />2. 解开PHP zip包至D:\PHP，然后将该目录下的php.ini-dist 拷贝到系统%WINDOWS%（一般是C:\windows）目录，然后改名为php.ini，编辑该文件，搜索&quot;doc_root&quot;，将该行改成： doc_root = &quot;d:\webroot&quot; ; 搜索&quot;extension_dir&quot;将该行改成：<br />   extension_dir = &quot;d:\php&quot; (假设PHP安装目录为D:\PHP,假设web文档放在D:\webroot)<br />   将D:\PHP下的php4ts.dll和D:\php\sapi\下的php4apache2.dll拷贝到系统%SYSTEMROOT%\System32目录下<br />  （一般是C:\windows\system32)，为了保险起见，可以将D:\php\sapi\和D:\php\dlls\<br />目录下的所有文件都拷贝到%SYSTEMROOT%\System32目录下。<br />3. 编辑设置D:\Apache2\conf\httpd.conf文件（编辑前关掉Apache服务），加入以下几行：<br />   ###Add surport to PHP script document <br />   LoadModule php4_module D:/php/sapi/php4apache2.dll<br />   AddType application/x-httpd-php .php .php3<br />  找到AddDefaultCharset ISO-8859-1这行,在前面加个#号注释掉。然后在下边添加<br />  AddDefaultCharset GB2312 <br />  DefaultLanguage GB2312 <br />  AddLanguage zh-cn .cn<br />  这是设置APACHE2对中文支持。<br />4. 安装MySQL，按缺省安装即可，假设安装在D:\MySQL下，运行D:\mysql\bin\winmysqlad<br />min.exe，会在系统 %WINDOWS%目录下生成my.ini，检查C:\windows目录下是否存在该文件，如果不存在创建并编辑成如下样子：<br />   <br />   #This File was made using the WinMySQLAdmin 1.4 Tool<br />   #2003-12-15 17:53:46<br />   #Uncomment or Add only the keys that you know how works.<br />   #Read the MySQL Manual for instructions<br />   [mysqld]<br />   basedir=D:/mysql<br />   #bind-address=10.10.10.10<br />   datadir=D:/mysql/data<br />   #language=D:/mysql/share/your language directory<br />   #slow query log#=<br />   #tmpdir#=<br />   #port=3306<br />   #set-variable=key_buffer=16M<br />   [WinMySQLAdmin]<br />   Server=D:/mysql/bin/mysqld-nt.exe<br />5.  解压缩PhpMyadmin软件包至D:/webroot/phpmyadmin,编辑D:\Apache2\conf\httpd.conf文件（编辑前关掉Apache服务）,<br />    在文件最后加上几行：<br />    NameVirtualHost 127.0.0.1<br />    <br />     DocumentRoot &quot;d:/webroot/phpMyAdmin&quot;<br />   <br />     Options ExecCGI<br />     Order allow,deny<br />     Allow from All<br />    <br />   DirectoryIndex index.php index.php3 index.htm index.html<br />   <br />6. 重新开启Apache服务，现在在浏览器输入<a href="http://127.0.0.1/" target="_blank"><font color="#4f4d7c">http://127.0.0.1</font></a>，此时应该进入了PhpMyadmin管理界面，选择Language为<br />   Chinese Simplified (zh)，点击进入“权限”设置，将用户“任意，％，否，ALL <br />PRIVILEGES ”用户删除，给两个root用户设置密码。<br />7. 然后编辑D:\Webroot\phpMyAdmin\config.inc.php，搜索&quot;$cfg['PmaAbsoluteUri']&quot;，<br />将其修改成： $cfg['PmaAbsoluteUri'] = 'http://127.0.0.1;<br />   搜索“$cfg['Servers'][$i]['auth_type']     = 'config';”，将其修改成：<br />   $cfg['Servers'][$i]['auth_type']     = 'http';<br />8. 重新在浏览器输入<a href="http://127.0.0.1/" target="_blank"><font color="#4f4d7c">http://127.0.0.1</font></a>，此时应该进入了PhpMyadmin登录界面，要求提供用户名和密码，输入root，密码为刚才你修改的。至此Windows 2003平台下Apache2.0.49+PHP4.3.6+MySQL4.0.18+PhpMyadmin2.5.6的整合已经完成了。<br />9. 安装J2SDK1.4.2_04，可以不用安装demo和sourece,假设安装至C:\j2sdk1.4.2_04。然<br />后配置环境变量：在我的电脑上点击鼠标<br />   右键-属性-点选高级-点选环境变量，弹出环境变量对话框，新建以下变量名和值：<br />   变量名：path<br />   变量值：.;C:\j2sdk1.4.2_04\bin; C:\j2sdk1.4.2_04<br />   变量名：JAVA_HOME<br />   变量值：C:\j2sdk1.4.2_04<br />   变量名：CLASSPATH<br />   变量值: .;C:\j2sdk1.4.2_04\lib\tools.jar;C:\j2sdk1.4.2_04\lib\dt.jar;C:\j2sdk1.4.2_04\jre\lib\ext<br />   重新启动计算机使配置的环境变量生效<br />10.安装Tomcat,按缺省值安装，假设安装至D:\Tomcat,安装要求设置用户名和密码，自己设置。<br />   启动TOMCAT服务，在浏览器输入<a href="http://127.0.0.1:8080/" target="_blank"><font color="#4f4d7c">http://127.0.0.1:8080</font></a><br />应该能看到Tomcat的欢迎界面，表示安装成功，<br />   运行各种Examples，检查其对JSP和Servlet等的支持，虽然TOMCAT有内置的HTTP服务，<br />但是它仅仅对JSP程序体现出比较好的执行效率和性能，对于静态页面的处理速度远不如APACHE，所以为了一个完美的WEB系统，我们要将APACHE和TOMCAT集成在一起！<br />  （下面就是集成他们的具体配置步骤，请注意仔细认真，比较繁琐）。<br />11. 将下载的jakarta-tomcat-connectors-jk2.0.4-win32-apache2.0.49.zip解包，将其中modules目录下的mod_jk2.so拷贝至<br />   D:\Apache2\modules\下，然后编辑D:\Apache2\conf\httpd.conf文件（编辑前关掉Apache服务），加入以下几行：<br />  ### Add surport to jsp with the jk2 mod connector to tomcat<br />  LoadModule jk2_module modules/mod_jk2.so<br />12. 现在假设我们要发布的web文件要放在D:\webroot下，不同的虚拟站点用不同的目录，总站点: <a href="http://www.example.com/" target="_blank"><font color="#4f4d7c">http://www.example.com</font></a> 对应IP 10.10.10.10 对应目录D:\webroot\WWW<br />    总站点别名：10.10.10.10 对应IP 10.10.10.10 对应目录D:\webroot\WWW<br />    IT部门: surport.example.com对应IP 10.10.10.10 对应目录D:\webroot\surport<br />    PhpMyadmin:对应IP 127.0.0.1对应目录D:\webroot\phpmyadmin<br />13.设置jk2的tomcat方配置,编辑D:\Tomcat\conf\jk2.properties文件（编辑前关掉Tomcat服务），使其如下：<br />   ## THIS FILE MAY BE OVERRIDEN AT RUNTIME. MAKE SURE TOMCAT IS STOPED<br />   ## WHEN YOU EDIT THE FILE.<br />   ## COMMENTS WILL BE _LOST_<br />   ## DOCUMENTATION OF THE FORMAT IN JkMain javadoc.<br />   # Set the desired handler list<br />   handler.list=apr,request,channelJni<br />   #<br />   # Override the default port for the socketChannel<br />   channelSocket.port=8019<br />   # Default: <br />   channelUnix.file=$&#123;jkHome&#125;/work/jk2.socket<br />   # Just to check if the the config  is working<br />   shm.file=$&#123;jkHome&#125;/work/jk2.shm<br />   # In order to enable jni use any channelJni directive<br />   channelJni.disabled = 0<br />   # And one of the following directives:<br />   apr.jniModeSo=d:/apache2/modules/mod_jk2.so<br />   # If set to inprocess the mod_jk2 will Register natives itself<br />   # This will enable the starting of the Tomcat from mod_jk2<br />   apr.jniModeSo=inprocess<br />14.设置jk2的Apache方配置，在D:\Apache2\conf目录下创建workers2.properties并编辑<br />如下：<br />   [shm] <br />   file=$&#123;serverRoot&#125;/logs/shm.file <br />   size=1048576 <br />   # Example socket channel， override port and host. <br />   [channel.socket:localhost:8009] <br />   port=8009 <br />   host=127.0.0.1 <br />   # define the worker <br />   [ajp13:localhost:8019] <br />   channel=channel.socket:localhost:8009 <br />   # Uri mapping <br />   [uri:www.example.com/*.jsp]<br />   worker=ajp13:localhost:8009<br />   [uri:surport.example.com/*.jsp]<br />   worker=ajp13:localhost:8009<br />   [uri:10.10.10.10/*.jsp]<br />   worker=ajp13:localhost:8009<br />   [uri:127.0.0.1/*.jsp]<br />   worker=ajp13:localhost:8009<br />15.设置Tomcat的虚拟站点，编辑D:\Tomcat\conf\server.xml（编辑前关掉Tomcat服务），<br />   搜索<br />   修改成<br />   搜索&lt;Host name=&quot;localhost&quot; debug=&quot;0&quot; appBase=&quot;webapps&quot;<br />   在这行上面加入以下几行：<br />        <br />        <br />        <br />    <br />        <br />        <br />        <br />    <br />        <br />        <br />        <br />    <br />16.配置Apache的虚拟站点,编辑D:\Apache2\conf\httpd.conf文件（编辑前关掉Apache服务）<br />  在文件最后加上：<br />  NameVirtualHost 10.10.10.10<br />  <br />     DocumentRoot &quot;/webroot/www&quot;<br />     ServerName <a href="http://www.example.com/" target="_blank"><font color="#4f4d7c">http://www.example.com</font></a>  <br />  <br />    Options ExecCGI<br />    Order allow,deny<br />    Allow from All <br />   <br />  DirectoryIndex index.jsp index.php index.php3 index.htm index.html<br />  <br /><br />  <br />     DocumentRoot &quot;/webroot/www&quot;<br />     ServerName 10.10.10.10  <br />  <br />    Options ExecCGI<br />    Order allow,deny<br />    Allow from All <br />   <br />  DirectoryIndex index.jsp index.php index.php3 index.htm index.html<br />  <br /><br />  <br />     DocumentRoot &quot;/webroot/surport&quot;<br />     ServerName surport.example.com  <br />  <br />    Options ExecCGI<br />    Order allow,deny<br />    Allow from All <br />   <br />  DirectoryIndex index.jsp index.php index.php3 index.htm index.html<br />  <br />17.重新启动tomcat和apache服务测试配置。在D:\webroot\www和D:\webroot\surport下放<br />一个test.php和一个test.jsp<br />   其中test.php内容如下：<br />   <br />   test.jsp内容如下：<br />   <br />   测试过程如下：在浏览器中输入<a href="http://127.0.0.1/" target="_blank"><font color="#4f4d7c">http://127.0.0.1</font></a>应该进入phpmyadmin的登录界面<br />输入<a href="http://127.0.0.1:8080/" target="_blank"><font color="#4f4d7c">http://127.0.0.1:8080</font></a>应该进入Tomcat欢迎界面<br /><br />输入<a href="http://www.example.com/test.php" target="_blank"><font color="#4f4d7c">http://www.example.com/test.php</font></a>应该显示php环境信息<br />输入<a href="http://www.example.com/test.jsp" target="_blank"><font color="#4f4d7c">http://www.example.com/test.jsp</font></a>应该显示“4”<br /><br />输入<a href="http://10.10.10.10/test.php" target="_blank"><font color="#4f4d7c">http://10.10.10.10/test.php</font></a>应该显示php环境信息<br /><br />输入<a href="http://10.10.10.10/test.jsp" target="_blank"><font color="#4f4d7c">http://10.10.10.10/test.jsp</font></a>应该显示“4”<br /><br />输入<a href="http://surport.example.com/test.php" target="_blank"><font color="#4f4d7c">http://surport.example.com/test.php</font></a>应该显示php环境信息<br /><br />输入<a href="http://surport.example.com/test.jsp" target="_blank"><font color="#4f4d7c">http://surport.example.com/test.jsp</font></a>应该显示“4”<br /><br /><br />18.如果以上测试均成功的话，现在请删掉test.php和test.jsp，在要发布的目录里放上您要发布的文件。<br />
]]>
</description>
</item><item>
<link>http://www.zhenghe.biz/read.php/.htm#blogcomment</link>
<title><![CDATA[[评论] Apache+php+mysql+phpmyadmin+j2sdk+tomcat整合方法]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://www.zhenghe.biz/read.php/.htm#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>