<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>http://www.jackxiang.com/index.php</link> 
<description><![CDATA[赢在IT，Playin' with IT,Focus on Killer Application,Marketing Meets Technology.]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></copyright>
<item>
<link>http://www.jackxiang.com/post//</link>
<title><![CDATA[RHEL AS4U3+httpd2.2+tomcat5.5+mysql5.0+php5.1详细安装文档]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[WEB2.0]]></category>
<pubDate>Thu, 02 Aug 2007 02:24:35 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	在论坛里看了许多相关帖子，自己也实验了多次，终于在前几天测试成功，感谢cu里的前辈们为我们新人铺路，因为我实际工作中要用到这些，以前是兄弟公司的哥们帮我们配置。现在我也配置成功，和大家分享一下成果吧。一直从cu里吸取精华，希望我的文档能给一些新人有帮助。<br/> &nbsp; 说明：实现WEB服务器能运行html、php、jsp等格式文件<br/><br/>一、 所用软件及版本<br/>1、 操作系统：RHEL as4u3<br/>2、 Apache：httpd-2.2.2.tar.gz<br/>apr-util-1.2.7.tar.gz<br/>apr-1.2.7.tar.gz<br/>3、 Tomcat：apache-tomcat-5.5.15.tar.gz<br/>4、 Mysql：mysql-5.0.22.tar.gz<br/>5、 Jdk：jdk-1_5_0_07-linux-i586.bin<br/>6、 Apache和Tomcat连接：tomcat-connectors-1.2.18-src.tar.gz<br/>7、 Php: php-5.1.4.tar.gz<br/>二、 安装步骤：<br/>1、 安装操作系统：这里就不介绍了，主要将相关的开发包装上。我将所有开发包都安装了。<br/>2、 Apache安装：将以上所需要的所有软件上传到/usr/local下。<br/>先解压：<br/>tar xvfz httpd-2.2.2.tar.gz<br/>cd httpd-2.2.2<br/><br/>首先可以看看里面的安装说明INSTALL和README。<br/>在安装apache之前先安装apr-util-1.2.7.tar.gz和apr-1.2.7.tar.gz<br/>首先安装apr。<br/><br/>tar xvfz apr-1.2.7.tar.gz<br/>cd apr-1.2.7<br/>./configure --prefix=/usr/local/apr-httpd<br/>make<br/>make install<br/>cd ..<br/><br/>再安装apr-util-1.2.7.tar.gz<br/><br/>tar xvfz apr-util-1.2.7.tar.gz<br/>cd apr-util-1.2.7<br/>./configure --prefix=/usr/local/apr-util-httpd --with-apr=/usr/local/apr-httpd<br/>make<br/>make install<br/><br/>3、 接下来继续安装apache<br/><br/>cd ../httpd-2.2.2<br/>./configure --prefix=/usr/local/apache --enable-mods-shared=all --enable-module=most --with-apr=/usr/local/apr-httpd --with-apr-util=/usr/local/apr-util-httpd --enable-so<br/>make<br/>make install<br/><br/>如果没有报错，apache基本安装完毕。<br/>4、 安装JDK<br/>回到local目录下：<br/><br/>cd ..<br/>./jdk-1_5_0_07-linux-i586.bin<br/>ln –s jdk1.5.0_07 jdk<br/><br/>设置JDK环境变量<br/><br/>vi /etc/profile<br/><br/>再文件尾部增加以下几句：<br/><br/>JAVA_HOME=/usr/local/jdk<br/>JRE=$JAVA_HOME/jre<br/>LC_ALL=zh_CN.GBK<br/>PATH=$JAVA_HOME/bin:$JRE/bin:$PATH<br/>CLASSPATH=.:$JAVA_HOME/bin/tools.jar:$JAVA_HOME/lib/dt.jar<br/>export JAVA_HOME JRE LC_ALL CLASSPATH PATH<br/><br/><br/>5、 安装MYSQL<br/><br/>tar xvfz mysql-5.0.22.tar.gz<br/>cd mysql-5.0.22<br/>./configure --prefix=/usr/local/mysql/ --with-unix-socket-path=/usr/local/mysql/tmp/mysql.sock --with-client-ldflags=-all-static --with-mysqld-ldflags=-all-static --enable-assembler<br/>make<br/>make install<br/>groupadd mysql<br/>useradd -g mysql mysql<br/>cp support-files/my-medium.cnf /etc/my.cnf<br/>cd /usr/local/mysql<br/>bin/mysql_install_db --user=mysql<br/>chown -R root &nbsp;.<br/>chown -R mysql var<br/>chgrp -R mysql .<br/>bin/mysqld_safe --user=mysql &<br/>mysqladmin –uroot password new-password<br/><br/>6、 安装php<br/><br/>tar xvfz php-5.1.4.tar.gz<br/>cd php-5.1.4<br/>./configure --prefix=/usr/local/php --with-mysql=/usr/local/mysql --with-apxs2=/usr/local/apache/bin/apxs<br/>make && make install<br/>cp php.ini-dist /usr/local/lib/php.ini<br/><br/>7、 安装tomcat<br/><br/>tar xvfz apache-tomcat-5.5.15.tar.gz<br/>mv apache-tomcat-5.5.15 tomcat<br/><br/>8、 安装Apache和Tomcat连接<br/><br/>tar zxvf tomcat-connectors-1.2.18-src.tar.gz<br/>cd tomcat-connectors-1.2.18-src/ native/<br/>./configure --with-apxs=/usr/local/apache/bin/apxs<br/>make && make install<br/><br/>三、 配置httpd.conf<br/><br/>cd /usr/local/conf/<br/>vi httpd.conf<br/><br/>1、 注释掉一下几行<br/><br/>#ServerAdmin you@example.com<br/>#ServerName www.example.com:80<br/>#DocumentRoot "/usr/local/apache/htdocs"<br/><br/>2、 修改里面相关内容<br/>A、<br/><Directory /><br/> &nbsp; &nbsp;Options FollowSymLinks<br/># &nbsp; &nbsp;AllowOverride None<br/> &nbsp; &nbsp; AllowOverride all<br/> &nbsp; &nbsp; Order deny,allow<br/># &nbsp; &nbsp;Deny from all<br/> &nbsp; &nbsp; Allow from all<br/></Directory><br/><br/>B、<br/>#<Directory "/usr/local/apache/htdocs"><br/><Directory "/usr/local/tomcat/webapps"><br/> &nbsp; &nbsp;#<br/> &nbsp; &nbsp;# Possible values for the Options directive are "None", "All",<br/> &nbsp; &nbsp;# or any combination of:<br/> &nbsp; &nbsp;# &nbsp; Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews<br/> &nbsp; &nbsp;#<br/> &nbsp; &nbsp;# Note that "MultiViews" must be named *explicitly* --- "Options All"<br/> &nbsp; &nbsp;# doesn't give it to you.<br/> &nbsp; &nbsp;#<br/> &nbsp; &nbsp;# The Options directive is both complicated and important. &nbsp;Please see<br/> &nbsp; &nbsp;# http://httpd.apache.org/docs/2.2/mod/core.html#options<br/> &nbsp; &nbsp;# for more information.<br/> &nbsp; &nbsp;#<br/># &nbsp; &nbsp;Options Indexes FollowSymLinks<br/> &nbsp; &nbsp;#<br/> &nbsp; &nbsp;# AllowOverride controls what directives may be placed in .htaccess files.<br/> &nbsp; &nbsp;# It can be "All", "None", or any combination of the keywords:<br/> &nbsp; &nbsp;# &nbsp; Options FileInfo AuthConfig Limit<br/> &nbsp; &nbsp;#<br/> &nbsp; &nbsp;AllowOverride None<br/><br/> &nbsp; &nbsp;#<br/> &nbsp; &nbsp;# Controls who can get stuff from this server.<br/> &nbsp; &nbsp;#<br/> &nbsp; &nbsp;Order allow,deny<br/> &nbsp; &nbsp;Allow from all<br/><br/></Directory><br/><br/>因为我这里将网站放在/usr/local/tomcat/webapps下<br/><br/>C、将<br/>#Include conf/extra/httpd-vhosts.conf<br/>这行#除掉<br/><br/>3、 增加以下内容：<br/>A、在AddType application/x-gzip .gz .tgz下增加以下两行<br/><br/>AddType application/x-httpd-php .php .phtml<br/> &nbsp; AddType application/x-httpd-php-source .phps<br/><br/>B、结尾增加<br/><br/>#add mod_jk module<br/>LoadModule jk_module modules/mod_jk.so<br/># Update this path to match your modules location<br/># Where to find workers.properties<br/># Update this path to match your conf directory location (put workers.properties next to #httpd.conf)<br/> &nbsp;JkWorkersFile /usr/local/apache/conf/workers.properties<br/># Where to put jk logs<br/># Update this path to match your logs directory location (put mod_jk.log next to access_log)<br/> &nbsp;JkLogFile &nbsp; &nbsp; /usr/local/apache/logs/mod_jk.log<br/># Set the jk log level [debug/error/info]<br/> &nbsp;JkLogLevel &nbsp; &nbsp;info<br/># Select the log format<br/> &nbsp;JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "<br/># JkOptions indicate to send SSL KEY SIZE,<br/> &nbsp;JkOptions &nbsp; &nbsp; +ForwardKeySize +ForwardURICompat -ForwardDirectories<br/># JkRequestLogFormat set the request format<br/> &nbsp;JkRequestLogFormat &nbsp; &nbsp; "%w %V %T"<br/># Send everything for context /examples to worker named worker1 (ajp13)<br/> &nbsp;JkMount &nbsp;/*.jsp worker1<br/><br/><br/>C、在/usr/local/apache/conf下增加一个workers.properties文件，内容如下：<br/><br/># Define 1 real worker using ajp13<br/> &nbsp;worker.list=worker1<br/># Set properties for worker1 (ajp13)<br/> &nbsp;worker.worker1.type=ajp13<br/> &nbsp;worker.worker1.host=localhost<br/> &nbsp;worker.worker1.port=8009<br/> &nbsp;worker.worker1.lbfactor=50<br/> &nbsp;worker.worker1.cachesize=10<br/> &nbsp;worker.worker1.cache_timeout=600<br/> &nbsp;worker.worker1.socket_keepalive=1<br/> &nbsp;worker.worker1.reclycle_timeout=300<br/><br/>D、再编辑/usr/local/apache/conf/extra/下httpd-vhosts.conf文件<br/><br/>vi httpd-vhosts.conf<br/><br/>将里面例子修改一下<br/><br/><VirtualHost 192.168.0.170:80><br/><Directory "/usr/local/tomcat/webapps/ROOT" ><br/>DirectoryIndex index.htm index.html index.jsp index.php<br/></Directory><br/> &nbsp; &nbsp;ServerAdmin xxx@126.com<br/> &nbsp; &nbsp;DocumentRoot /usr/local/tomcat/webapps/ROOT<br/> &nbsp; &nbsp;ServerName 192.168.0.170<br/> &nbsp; &nbsp;ErrorLog logs/170-error_log<br/> &nbsp; &nbsp;CustomLog logs/170-access_log common<br/></VirtualHost><br/><br/>因为没有做域名解析，我这里在ServerName下直接用的是IP地址。<br/>四、 测试<br/>先启动tomcat，再启动apache。启动apache之前可以到apache/bin下测试一下虚拟域是否配置正确。./httpd –S 如果配置有错误会提示你。<br/>没有问题后，在IE地址栏输入http://192.168.0.170 此时将显示的是tomcat的默认界面，证明可以正常访问jsp文件了。再将/usr/local/tomcat/webapps/ROOT下index.jsp换一个index.php文件，只要在index.php里输入以下内容即可测试：<br/><br/><? echo phpinfo() ?><br/>重启apache，再在IE地址栏输入http://192.168.0.170 将能看到php的相关信息。<br/>主要参考文章有：<br/>http://www.chinaunix.net/jh/13/669895.html<br/>http://www.chinaunix.net/jh/13/770898.html<br/>http://httpd.apache.org/docs/2.2/
]]>
</description>
</item><item>
<link>http://www.jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] RHEL AS4U3+httpd2.2+tomcat5.5+mysql5.0+php5.1详细安装文档]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>