<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>LiangXu Wang &#187; apache</title>
	<atom:link href="http://wlx.westgis.ac.cn/tag/apache/feed/" rel="self" type="application/rss+xml" />
	<link>http://wlx.westgis.ac.cn</link>
	<description>technology backup/share</description>
	<lastBuildDate>Sat, 14 Jan 2012 03:56:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>另类反向代理DNN4</title>
		<link>http://wlx.westgis.ac.cn/609/</link>
		<comments>http://wlx.westgis.ac.cn/609/#comments</comments>
		<pubDate>Mon, 08 Jun 2009 02:27:53 +0000</pubDate>
		<dc:creator>wlx</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[dnn]]></category>
		<category><![CDATA[proxy]]></category>
		<category><![CDATA[reverse proxy]]></category>

		<guid isPermaLink="false">http://wlx.westgis.ac.cn/?p=609</guid>
		<description><![CDATA[之前在反向代理DNN4时一直有问题（DNN4通过HEADER进行重定向，导致无法使用基于内部域名的反向代理） 在这儿找到一个办法： http://www.r2integrated.com/dnn/Forum/tabid/170/aff/1/aft/9187/afv/topic/afpg/1/Default.aspx 在代理服务器上： /etc/hosts中添加一个解析：192.168.50.238 heihe.westgis.ac.cn 在apahce中配置： ServerName heihe.westgis.ac.cn ProxyPass / http://heihe.westgis.ac.cn/ ProxyPassReverse / http://heihe.westgis.ac.cn/ &#8230; 在虚拟机上配置： \windows\system32\drivers\etc\hosts中添加一行：192.168.50.238 heihe.westgis.ac.cn 重启对应服务，搞定！]]></description>
			<content:encoded><![CDATA[<p>之前在反向代理DNN4时一直有问题（DNN4通过HEADER进行重定向，导致无法使用基于内部域名的反向代理）<br />
在这儿找到一个办法：<br />
<a href="http://www.r2integrated.com/dnn/Forum/tabid/170/aff/1/aft/9187/afv/topic/afpg/1/Default.aspx">http://www.r2integrated.com/dnn/Forum/tabid/170/aff/1/aft/9187/afv/topic/afpg/1/Default.aspx</a><br />
在代理服务器上：<br />
/etc/hosts中添加一个解析：192.168.50.238 heihe.westgis.ac.cn<br />
在apahce中配置：<br />
ServerName heihe.westgis.ac.cn<br />
ProxyPass / http://heihe.westgis.ac.cn/<br />
ProxyPassReverse / http://heihe.westgis.ac.cn/<br />
&#8230;</p>
<p>在虚拟机上配置：<br />
\windows\system32\drivers\etc\hosts中添加一行：192.168.50.238 heihe.westgis.ac.cn</p>
<p>重启对应服务，搞定！</p>
]]></content:encoded>
			<wfw:commentRss>http://wlx.westgis.ac.cn/609/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>升级ubuntu server</title>
		<link>http://wlx.westgis.ac.cn/596/</link>
		<comments>http://wlx.westgis.ac.cn/596/#comments</comments>
		<pubDate>Thu, 30 Apr 2009 14:58:14 +0000</pubDate>
		<dc:creator>wlx</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[hardy]]></category>
		<category><![CDATA[intrepid]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://wlx.westgis.ac.cn/?p=596</guid>
		<description><![CDATA[ubuntu jaunty已经发布了，服务器现在的版本还是hardy，正好遇到了奇怪的问题，所以就想升级了。 sudo aptitude install update-manager-core 然后修改/etc/update-manager/release-upgrades文件内容，把 Prompt=lts 修改为： Prompt=normal 然后开始升级： sudo do-release-upgrade 注意： 1 在升级过程中有个提示，是否要继续操作，其中提示为[yN]，但在中文locale下需要输入”是“，估计这是个翻译的BUG？ 2 apache在升级后会产生问题，导致所有的网站都定向到默认网站了，需要修改/etc/apache2/ports.conf文件，把 NameVirtualHost *:80 给注释掉，然后在修改默认网站/etc/apache2/sites-enable/000-default，在第一行添加： NameVirtualHost *]]></description>
			<content:encoded><![CDATA[<p>ubuntu jaunty已经发布了，服务器现在的版本还是hardy，正好遇到了奇怪的问题，所以就想升级了。</p>
<blockquote><p>sudo aptitude install update-manager-core</p></blockquote>
<p>然后修改/etc/update-manager/release-upgrades文件内容，把</p>
<blockquote><p>Prompt=lts</p></blockquote>
<p>修改为：</p>
<blockquote><p>Prompt=normal </p></blockquote>
<p>然后开始升级：</p>
<blockquote><p>sudo do-release-upgrade</p></blockquote>
<p>注意：<br />
1 在升级过程中有个提示，是否要继续操作，其中提示为[yN]，但在中文locale下需要输入”是“，估计这是个翻译的BUG？<br />
2 apache在升级后会产生问题，导致所有的网站都定向到默认网站了，需要修改/etc/apache2/ports.conf文件，把</p>
<blockquote><p>NameVirtualHost *:80</p></blockquote>
<p>给注释掉，然后在修改默认网站/etc/apache2/sites-enable/000-default，在第一行添加：</p>
<blockquote><p>NameVirtualHost *</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://wlx.westgis.ac.cn/596/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>检测mysql进程并重启服务</title>
		<link>http://wlx.westgis.ac.cn/430/</link>
		<comments>http://wlx.westgis.ac.cn/430/#comments</comments>
		<pubDate>Sat, 22 Sep 2007 05:59:47 +0000</pubDate>
		<dc:creator>wlx</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[restart]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://wlx.westgis.ac.cn/430/</guid>
		<description><![CDATA[服务器上的mysql老是拖累apache，导致WWW服务不正常，前面修改过对应的mysql参数，但还是不行，因此，就决定设定让系统CRON下面这个脚本，注意脚本来自傅翮鹤 ，我仅仅修改了ubuntu下对应的参数而已。 #!/bin/bash #check apache,mysql thread and auto reboot service #Powered by 傅翮鹤 [www.fuhehe.com] #Date 2007-06-15 #config MaxApacheThread=100 MaxMysqlThread=50 HttpService=`ls /etc/init.d&#124;grep apache2` MysqlService=`ls /etc/init.d&#124;grep mysql` ApacheThread=`ps -A&#124;grep apache2&#124;wc -l` MysqlThread=`ps -A&#124;grep mysql&#124;wc -l` NeedReboot=0 if [ $ApacheThread -gt $MaxApacheThread ] &#8230; <a href="http://wlx.westgis.ac.cn/430/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>服务器上的mysql老是拖累apache，导致WWW服务不正常，前面修改过对应的mysql参数，但还是不行，因此，就决定设定让系统CRON下面这个脚本，注意脚本来自<a href="http://www.fuhehe.com">傅翮鹤 </a>，我仅仅修改了ubuntu下对应的参数而已。</p>
<blockquote><p><code>#!/bin/bash<br />
#check apache,mysql thread and auto reboot service<br />
#Powered by 傅翮鹤 [www.fuhehe.com]<br />
#Date 2007-06-15</p>
<p>#config<br />
MaxApacheThread=100<br />
MaxMysqlThread=50<br />
HttpService=`ls /etc/init.d|grep apache2`<br />
MysqlService=`ls /etc/init.d|grep mysql`</p>
<p>ApacheThread=`ps -A|grep apache2|wc -l`<br />
MysqlThread=`ps -A|grep mysql|wc -l`</p>
<p>NeedReboot=0</p>
<p>if [ $ApacheThread -gt $MaxApacheThread ]<br />
then<br />
NeedReboot=1<br />
fi<br />
if [ $ApacheThread -eq 0 ]<br />
then<br />
NeedReboot=2<br />
fi</p>
<p>if [ $MysqlThread -gt $MaxMysqlThread ]<br />
then<br />
NeedReboot=3<br />
fi<br />
if [ $MysqlThread -eq 0 ]<br />
then<br />
NeedReboot=4<br />
fi</p>
<p>if [ $NeedReboot -eq 1 ]<br />
then<br />
echo "-----------------------------"<br />
echo $(date +"%y-%m-%d %H:%M:%S")<br />
echo "-----------------------------"<br />
echo "Apache:$ApacheThread;Mysql:$MysqlThread."<br />
echo "Apache is busy,reboot"<br />
/etc/init.d/$HttpService stop<br />
/etc/init.d/$HttpService start<br />
elif [ $NeedReboot -eq 2 ]<br />
then<br />
echo "-----------------------------"<br />
echo $(date +"%y-%m-%d %H:%M:%S")<br />
echo "-----------------------------"<br />
echo "Apache:$ApacheThread;Mysql:$MysqlThread."<br />
echo "Apache is down,reboot"<br />
/etc/init.d/$HttpService start<br />
elif [ $NeedReboot -eq 3 ]<br />
then<br />
echo "-----------------------------"<br />
echo $(date +"%y-%m-%d %H:%M:%S")<br />
echo "-----------------------------"<br />
echo "Apache:$ApacheThread;Mysql:$MysqlThread."<br />
echo "Mysql is busy,reboot"<br />
/etc/init.d/$MysqlService stop<br />
/etc/init.d/$MysqlService start<br />
elif [ $NeedReboot -eq 4 ]<br />
then<br />
echo "-----------------------------"<br />
echo $(date +"%y-%m-%d %H:%M:%S")<br />
echo "-----------------------------"<br />
echo "Apache:$ApacheThread;Mysql:$MysqlThread."<br />
echo "Mysql is down,reboot"<br />
/etc/init.d/$MysqlService start<br />
else<br />
echo "-----------------------------"<br />
echo $(date +"%y-%m-%d %H:%M:%S")<br />
echo "-----------------------------"<br />
echo "Apache:$ApacheThread;Mysql:$MysqlThread."<br />
echo "System is normal"<br />
fi<br />
</code></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://wlx.westgis.ac.cn/430/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>apache2下的ssl支持</title>
		<link>http://wlx.westgis.ac.cn/407/</link>
		<comments>http://wlx.westgis.ac.cn/407/#comments</comments>
		<pubDate>Sat, 11 Aug 2007 14:14:39 +0000</pubDate>
		<dc:creator>wlx</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[feisty]]></category>
		<category><![CDATA[ssl]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://wlx.westgis.ac.cn/407/</guid>
		<description><![CDATA[在UBUNTU FEISTY下如何添加APACHE2的SSL支持？ 假设你的APACHE2已经可以运行了，现在只是需要添加SSL支持，首先安装： sudo aptitude install openssl ssl-cert libapache-mod-ssl 注意，默认make-ssl-cert产生的ca只有一个月的有效期，因此我们需要延长这个时间，可以通过修改make-ssl-cert命令来实现： sudo nano /usr/sbin/make-ssl-cert 假设需要把期限修改为10年： 就把”-keyout $output”修改为”-keyout $outpu -days 3650&#8243;。 然后来创建我们自己的签名，当然你也可以申请商业认证的签名。 sudo make-ssl-cert /usr/share/ssl-cert/ssleay.cnf /etc/apache2/ssl/apache.pem 注意，在填hostname的时候，要选择你所使用的域名。 接着，启用ssl模块 sudo a2enmod ssl 添加443监听端口 echo “Listen 443&#8243; &#124; sudo tee -a /etc/apache2/ports.conf site文件的第一行修改为： &#60;VirtualHost &#8230; <a href="http://wlx.westgis.ac.cn/407/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>在UBUNTU FEISTY下如何添加APACHE2的SSL支持？</p>
<p>假设你的APACHE2已经可以运行了，现在只是需要添加SSL支持，首先安装：</p>
<blockquote><p>sudo aptitude install openssl ssl-cert libapache-mod-ssl</p></blockquote>
<p>注意，默认make-ssl-cert产生的ca只有一个月的有效期，因此我们需要延长这个时间，可以通过修改make-ssl-cert命令来实现：</p>
<blockquote><p>sudo nano /usr/sbin/make-ssl-cert</p></blockquote>
<p>假设需要把期限修改为10年：<br />
就把”-keyout $output”修改为”-keyout $outpu -days 3650&#8243;。<br />
然后来创建我们自己的签名，当然你也可以申请商业认证的签名。</p>
<blockquote><p>sudo make-ssl-cert /usr/share/ssl-cert/ssleay.cnf /etc/apache2/ssl/apache.pem</p></blockquote>
<p>注意，在填hostname的时候，要选择你所使用的域名。<br />
接着，启用ssl模块</p>
<blockquote><p>sudo a2enmod ssl</p></blockquote>
<p>添加443监听端口</p>
<blockquote><p>echo “Listen 443&#8243; | sudo tee -a /etc/apache2/ports.conf</p></blockquote>
<p>site文件的第一行修改为：</p>
<blockquote><p><code>&lt;VirtualHost *:443&gt;</code></p></blockquote>
<p>在site文件的最后一行前面添加：</p>
<blockquote><p>SSLEngine on<br />
SSLCertificateFile /etc/apache2/ssl/apache.pem<br />
SSLProtocol all<br />
SSLCipherSuite HIGH:MEDIUM</p></blockquote>
<p>重新启动服务：</p>
<blockquote><p>sudo /etc/init.d/apache2 restart</p></blockquote>
<p>若想强制所有的80端口访问都转送到443端口，可以这样设置：</p>
<blockquote><p>sudo a2enmod rewrite</p></blockquote>
<p>然后修改site文件，添加如下内容：</p>
<blockquote><p>RewriteEngine   on<br />
RewriteCond     %{SERVER_PORT} ^80$<br />
RewriteRule     ^(.*)$ https://%{SERVER_NAME}$1 [L,R]</p></blockquote>
<p>reference:</p>
<p>https://help.ubuntu.com/community/forum/server/apache2/SSL</p>
<p>http://www.linode.com/wiki/index.php/Apache2_SSL_in_Ubuntu</p>
]]></content:encoded>
			<wfw:commentRss>http://wlx.westgis.ac.cn/407/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>限制apache某目录只允许某IP访问</title>
		<link>http://wlx.westgis.ac.cn/405/</link>
		<comments>http://wlx.westgis.ac.cn/405/#comments</comments>
		<pubDate>Fri, 03 Aug 2007 07:41:50 +0000</pubDate>
		<dc:creator>wlx</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[access]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[auth]]></category>
		<category><![CDATA[ip]]></category>

		<guid isPermaLink="false">http://wlx.westgis.ac.cn/405/</guid>
		<description><![CDATA[比如安装的phpMyadmin，必须限制只有某些IP可以访问，因此就可以这样设置： 首先要设置网站允许.htaccess， AllowOverride All 然后定义目录下的.htaccess文件： Order Deny,Allow Deny from all Allow from 210.77.68.215]]></description>
			<content:encoded><![CDATA[<p>比如安装的phpMyadmin，必须限制只有某些IP可以访问，因此就可以这样设置：<br />
首先要设置网站允许.htaccess，</p>
<blockquote><p>                AllowOverride All
</p></blockquote>
<p>然后定义目录下的.htaccess文件：</p>
<blockquote><p>
Order Deny,Allow<br />
Deny from all<br />
Allow from 210.77.68.215
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://wlx.westgis.ac.cn/405/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>安装wordpress 1.0 mu到UBUNTU SERVER</title>
		<link>http://wlx.westgis.ac.cn/324/</link>
		<comments>http://wlx.westgis.ac.cn/324/#comments</comments>
		<pubDate>Wed, 27 Dec 2006 07:10:41 +0000</pubDate>
		<dc:creator>wlx</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://wlx.westgis.ac.cn/324/</guid>
		<description><![CDATA[前面我提到如何安装wordpress mu 1.0，这次在ubuntu edgy server版上安装就轻车熟路了。 首先要确保ubuntu server上安装了apache2, php, mysql。 然后要激活rewrite mod。 sudo a2enmod 创建westgis.ac.cn的vhost文件： &#60;VirtualHost *&#62; ServerAdmin wlx@mygis.org ServerName westgis.ac.cn ServerAlias westgis.ac.cn *.westgis.ac.cn DocumentRoot /var/www/westgis.ac.cn &#60;Directory /&#62; Options FollowSymLinks AllowOverride None &#60;/Directory&#62; &#60;Directory /var/www/westgis.ac.cn/&#62; Options Indexes FollowSymLinks MultiViews AllowOverride FileInfo &#8230; <a href="http://wlx.westgis.ac.cn/324/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>前面我提到如何安装wordpress mu 1.0，这次在ubuntu edgy server版上安装就轻车熟路了。<br />
首先要确保ubuntu server上安装了apache2, php, mysql。<br />
然后要激活rewrite mod。</p>
<blockquote><p>sudo a2enmod</p></blockquote>
<p>创建westgis.ac.cn的vhost文件：</p>
<blockquote><p><code>&lt;VirtualHost *&gt;<br />
        ServerAdmin wlx@mygis.org<br />
        ServerName westgis.ac.cn<br />
        ServerAlias westgis.ac.cn *.westgis.ac.cn<br />
        DocumentRoot /var/www/westgis.ac.cn</p>
<p>        &lt;Directory /&gt;<br />
                Options FollowSymLinks<br />
                AllowOverride None<br />
        &lt;/Directory&gt;<br />
        &lt;Directory /var/www/westgis.ac.cn/&gt;<br />
                Options Indexes FollowSymLinks MultiViews<br />
                AllowOverride FileInfo Options<br />
                Order allow,deny<br />
                allow from all<br />
        &lt;/Directory&gt;</p>
<p>        ErrorLog /var/log/apache2/westgis.ac.cn-error.log</p>
<p>        # Possible values include: debug, info, notice, warn, error, crit,<br />
        # alert, emerg.<br />
        LogLevel warn</p>
<p>        CustomLog /var/log/apache2/westgis.ac.cn-access.log combined<br />
        ServerSignature On</p>
<p>&lt;/VirtualHost&gt;</code></p></blockquote>
<p>激活这个vhost就可以了，注意AllowOverride部分和默认是不同的。</p>
]]></content:encoded>
			<wfw:commentRss>http://wlx.westgis.ac.cn/324/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>wordpres mu 1.0的安装</title>
		<link>http://wlx.westgis.ac.cn/301/</link>
		<comments>http://wlx.westgis.ac.cn/301/#comments</comments>
		<pubDate>Mon, 11 Dec 2006 09:41:40 +0000</pubDate>
		<dc:creator>wlx</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[mu]]></category>
		<category><![CDATA[wildcard]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://wlx.westgis.ac.cn/301/</guid>
		<description><![CDATA[WordPress mu 1.0版本发布已经很长时间了，这次正好凑着转移DNS的机会，也尝了一把鲜。 一、DNS准备工作 wordpress mu 1.0支持两种方式：目录方式和域名方式。 因为有自己的域名服务器，于是就采用域名方式。即让用户可以实现自定义的myusername.westgis.ac.cn的这样个性BLOG网站。需要DNS服务支持泛子域名。 在原来的db.westgis.ac.cn上添加了如下的内容： westgis.ac.cn. IN A 210.77.68.252 * IN A 210.77.68.240 前面一行是支持无前缀的域名形式，后面一行实现了泛子域名支持。 重新启动dns服务： /etc/init.d/bin9 restart 二、Apache设置 wordpress mu需要apache支持alias，不过这个多数系统上都已经默认支持了，还需要mod_rewrite支持。同时，wordpress mu会占用一个独立的IP，因为会影响在同一IP上的其他子域名WEB服务。（这个可能和DEBIAN里引用vhost的机制有关，若能确认mu这个vhost是最后一个启用的，即查找vhost时是最后一个才查找到它，在这种情况下就不会影响其他子域名。） 我建立了两个vhost才能完全支持，不知道问题出在哪儿。 第一个vhost实现了泛子域名支持： &#60;VirtualHost 1.2.3.4&#62; ServerAdmin xxx@xxx.org ServerName blog.westgis.ac.cn ServerAlias *.westgis.ac.cn DocumentRoot /var/www/westgis.ac.cn/ &#60;Directory /&#62; Options &#8230; <a href="http://wlx.westgis.ac.cn/301/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://mu.wordpress.org/">WordPress mu</a> 1.0版本发布已经很长时间了，这次正好凑着转移DNS的机会，也尝了一把鲜。<span id="more-301"></span><br />
一、DNS准备工作<br />
wordpress mu 1.0支持两种方式：目录方式和域名方式。<br />
因为有自己的域名服务器，于是就采用域名方式。即让用户可以实现自定义的myusername.westgis.ac.cn的这样个性BLOG网站。需要DNS服务支持泛子域名。<br />
在原来的db.westgis.ac.cn上添加了如下的内容：</p>
<blockquote><p>westgis.ac.cn.  IN      A       210.77.68.252<br />
*       IN      A       210.77.68.240</p></blockquote>
<p>前面一行是支持无前缀的域名形式，后面一行实现了泛子域名支持。<br />
重新启动dns服务：</p>
<blockquote><p>/etc/init.d/bin9 restart</p></blockquote>
<p>二、Apache设置<br />
wordpress mu需要apache支持alias，不过这个多数系统上都已经默认支持了，还需要mod_rewrite支持。同时，wordpress mu会占用一个独立的IP，因为会影响在同一IP上的其他子域名WEB服务。（这个可能和DEBIAN里引用vhost的机制有关，若能确认mu这个vhost是最后一个启用的，即查找vhost时是最后一个才查找到它，在这种情况下就不会影响其他子域名。）<br />
我建立了两个vhost才能完全支持，不知道问题出在哪儿。<br />
第一个vhost实现了泛子域名支持：</p>
<blockquote><p><code>&lt;VirtualHost 1.2.3.4&gt;<br />
        ServerAdmin xxx@xxx.org<br />
        ServerName blog.westgis.ac.cn<br />
        ServerAlias *.westgis.ac.cn<br />
        DocumentRoot /var/www/westgis.ac.cn/</p>
<p>        &lt;Directory /&gt;<br />
                Options FollowSymLinks<br />
                AllowOverride  None<br />
        &lt;/Directory&gt;<br />
        &lt;Directory /var/www/westgis.ac.cn/&gt;<br />
                Options Indexes FollowSymLinks MultiViews<br />
                AllowOverride All<br />
                Order allow,deny<br />
                allow from all<br />
        &lt;/Directory&gt;</p>
<p>        ErrorLog /var/log/apache2/error-blog.westgis.ac.cn.log<br />
        LogLevel debug</p>
<p>        CustomLog /var/log/apache2/access-blog.westgis.ac.cn.log combined<br />
        ServerSignature On<br />
&lt;/VirtualHost&gt;</code></p></blockquote>
<p>本来我是想用blog这个子域名实现wordpress mu的门户站点，但是实践下来总是有问题，apache就不认这个blog，认为这是个新域名。<br />
因此我又添加了westgis.ac.cn域名作为门户：</p>
<blockquote><p><code>&lt;VirtualHost ＊&gt;<br />
        ServerAdmin xxx@xxx.org<br />
        ServerName westgis.ac.cn<br />
        DocumentRoot /var/www/westgis.ac.cn/</p>
<p>        &lt;Directory /&gt;<br />
                Options FollowSymLinks<br />
                AllowOverride  None<br />
        &lt;/Directory&gt;<br />
        &lt;Directory /var/www/westgis.ac.cn/&gt;<br />
                Options Indexes FollowSymLinks MultiViews<br />
                AllowOverride All<br />
                Order allow,deny<br />
                allow from all<br />
        &lt;/Directory&gt;</p>
<p>        ErrorLog /var/log/apache2/error-blog.westgis.ac.cn.log<br />
        LogLevel debug</p>
<p>        CustomLog /var/log/apache2/access-blog.westgis.ac.cn.log combined<br />
        ServerSignature On<br />
&lt;/VirtualHost&gt;</code></p></blockquote>
<p>三、安装<br />
下载下来代码，解压缩，转移目录：</p>
<blockquote><p>cd /var/www/<br />
sudo wget http://mu.wordpress.org/latest.zip<br />
sudo unzip latest.zip<br />
sudo mv wordpressmu-1.0 westgis.ac.cn
</p></blockquote>
<p>在mysql建立一个库给mu使用。<br />
然后就在页面上就可以安装了。<br />
注意：在这儿不需要手工配置wp-config.php，WP会帮你作，但若你作了，WP反而不知道如何继续了。<br />
（我在这一步吃了亏，在望上找了好几个地方才发现。）<br />
安装后的配置还是比较简单的，和WP基本相同。<br />
然后就可以安装一些plugin和theme了，但好像有些theme不通用，需要修改。<br />
默认情况下要修改门户站点的外观，修改themes目录下的home/home.php文件。<br />
四、后注<br />
官方的readme有问题，若按照<a href="http://photomatt.net/2003/10/10/wildcard-dns-and-sub-domains/">matt</a>的修改方法，会有问题。<br />
在vhost的设置里面，若添加：</p>
<blockquote><p>RedirectMatch 301 (.*) http://photomatt.net$1</p></blockquote>
<p>会导致很多奇怪的问题。不添加反而没有任何问题。<br />
一开始我总是找不出问题的所在，后来在<a href="http://blog.cookys.org/2006/10/02/315/">餅乾</a> 这里才发现原因。</p>
]]></content:encoded>
			<wfw:commentRss>http://wlx.westgis.ac.cn/301/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>apache2反向代理</title>
		<link>http://wlx.westgis.ac.cn/271/</link>
		<comments>http://wlx.westgis.ac.cn/271/#comments</comments>
		<pubDate>Mon, 16 Oct 2006 09:09:51 +0000</pubDate>
		<dc:creator>wlx</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[proxy]]></category>
		<category><![CDATA[反向代理]]></category>

		<guid isPermaLink="false">http://wlxblog.westgis.ac.cn/271/</guid>
		<description><![CDATA[在DEBIAN下使用apache2的反向代理，连接到一台内部服务器上。 首先要激活proxy模块： sudo a2enmod 选择proxy sudo mkdir /var/www/proxy sudo chown www-data:www-data /var/www/proxy 然后修改对应的sites： &#60;VirtualHost *&#62; ServerAdmin xxx@xxx.org ServerName xxxxx ProxyRequests Off &#60;Proxy *&#62; Order allow,deny Allow from all &#60;/Proxy&#62; # reverse proxy setting ProxyPass / http://192.168.100.8:8180/ ProxyPassReverse / http://192.168.100.8:8180/ # &#8230; <a href="http://wlx.westgis.ac.cn/271/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>在DEBIAN下使用apache2的反向代理，连接到一台内部服务器上。<br />
首先要激活proxy模块：<br />
sudo a2enmod<br />
选择proxy<br />
sudo mkdir /var/www/proxy<br />
sudo chown www-data:www-data /var/www/proxy<br />
然后修改对应的sites：</p>
<blockquote><p><code>&lt;VirtualHost *&gt;<br />
        ServerAdmin xxx@xxx.org<br />
        ServerName xxxxx<br />
 ProxyRequests Off<br />
&lt;Proxy *&gt;<br />
Order allow,deny<br />
Allow from all<br />
&lt;/Proxy&gt;<br />
# reverse proxy setting<br />
ProxyPass / http://192.168.100.8:8180/<br />
ProxyPassReverse / http://192.168.100.8:8180/<br />
# cache dir root<br />
CacheRoot "/var/www/proxy"<br />
# max cache storage<br />
CacheSize 50000000<br />
# hour: every 4 hour<br />
CacheGcInterval 4<br />
# max page expire time: hour<br />
CacheMaxExpire 240<br />
# Expire time = (now - last_modified) * CacheLastModifiedFactor<br />
CacheLastModifiedFactor 0.1<br />
# defalt expire tag: hour<br />
CacheDefaultExpire 1<br />
# force complete after precent of content retrived: 60-90%<br />
CacheForceCompletion 80</p>
<p>        ErrorLog /var/log/apache2/error-westdc.geodata.cn.log<br />
        CustomLog /var/log/apache2/access-westdc.geodata.cn.log combined<br />
        ServerSignature On</p>
<p>&lt;/VirtualHost&gt;</code></p></blockquote>
<p>参考： http://www.chedong.com/tech/cache.html</p>
]]></content:encoded>
			<wfw:commentRss>http://wlx.westgis.ac.cn/271/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Tomcat5.5的基本配置说明</title>
		<link>http://wlx.westgis.ac.cn/269/</link>
		<comments>http://wlx.westgis.ac.cn/269/#comments</comments>
		<pubDate>Sat, 14 Oct 2006 15:17:30 +0000</pubDate>
		<dc:creator>wlx</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[配置]]></category>
		<category><![CDATA[tomcat]]></category>

		<guid isPermaLink="false">http://wlxblog.westgis.ac.cn/269/</guid>
		<description><![CDATA[原文见http://blog.csdn.net/jwsh1984/archive/2005/02/09/284999.aspx Tomcat是apache的一个子项目，也是一个开源项目，主要是用于J2EE web容器，由于是一个开源项目，在学习与开发测试中经常被用到（而目前商业最为经常用到的web服务器是BEA WebLogic）。在开源项目中，鼎鼎大名的apache基金会大家肯定有所了解，网站链接：http://www.apache.org/，而旗下的Jakarta Project 主要包括了Tomcat、Alexanda等Java项目，有兴趣者可看：http://jakarta.apache.org/。考虑到各位学习者的机器配置与学习成本问题，这里选了Tomcat作为我们学习与测试J2EE的环境 以下为一些基本配置： 一、先从网上下载tomcat，目前最新版本是5.57，下载地址是：http://apache.freelamp.com/jakarta/tomcat-5/v5.5.7/bin/jakarta-tomcat-5.5.7.zip，下载安装完后，在安装目录下有以下目录，主要介绍一下conf、common、webapps： 如果你现在等不急了，就想体验一下tomcat的魅力的话，把你的网页拷到webapps/ROOT目录下，然后再通过浏览器访问即可，默认如下格式：http://localhost:8080/你的网页 1)webapps文件夹主要用于web应用程序部署，比如你可以把你的应用程序包，如war文件拷到该目录下，容器会自动部署。 2)conf文件夹下主要是放置tomcat的服务器的相关配置文件 3)common文件夹主要是对容器全局变量的文件放置地方，如common/lib下就是放置一些需要全文配置的文件包。 二、j2ee的相关部署规范： 一般来说作为一个符合规范的web程序，会包括以下文件夹和文件：/WEB-INF/（主要是放置一些配置文件与不希望外部程序访问的隐私文件），在网络上是不允许访问该文件夹的，如当你输入以下http://localhost:8080/WEB-INF/的话就会出现错误。 在WEB-INF文件夹下有一个web.xml文件，这是对当前应用程序的相关设置，资源寻找等，/WEN-INF/文件夹下有个classes子文件夹，该文件夹是应用程序的根路径（等于是classpath的路径），/WEN-INF下还要有个lib文件夹，主要是放置需要引入的包，应用程序导入的包先从这里开始寻找，其次到容器的全局路径下$TOMCAT_HOME/common/lib下寻找。 以下是基本文件夹: /tomcat /common /lib /classes /conf /webapps /ROOT web.xml /WEB-INF /lib /classes /你部署的程序包 web.xml /WEB-INF /lib /classes 三、容器的配置（server.xml) 到主目录/conf文件夹下server.xml文件是对web服务器的配置： 以下是一些常见的设置，http端口设置，找到以下： &#60;Connector port="8080" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" &#8230; <a href="http://wlx.westgis.ac.cn/269/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>原文见http://blog.csdn.net/jwsh1984/archive/2005/02/09/284999.aspx</p>
<blockquote><p>      Tomcat是apache的一个子项目，也是一个开源项目，主要是用于J2EE web容器，由于是一个开源项目，在学习与开发测试中经常被用到（而目前商业最为经常用到的web服务器是BEA WebLogic）。在开源项目中，鼎鼎大名的apache基金会大家肯定有所了解，网站链接：http://www.apache.org/，而旗下的Jakarta Project 主要包括了Tomcat、Alexanda等Java项目，有兴趣者可看：http://jakarta.apache.org/。考虑到各位学习者的机器配置与学习成本问题，这里选了Tomcat作为我们学习与测试J2EE的环境<br />
      以下为一些基本配置：<br />
 一、先从网上下载tomcat，目前最新版本是5.57，下载地址是：http://apache.freelamp.com/jakarta/tomcat-5/v5.5.7/bin/jakarta-tomcat-5.5.7.zip，下载安装完后，在安装目录下有以下目录，主要介绍一下conf、common、webapps：<br />
     如果你现在等不急了，就想体验一下tomcat的魅力的话，把你的网页拷到webapps/ROOT目录下，然后再通过浏览器访问即可，默认如下格式：http://localhost:8080/你的网页<br />
     1)webapps文件夹主要用于web应用程序部署，比如你可以把你的应用程序包，如war文件拷到该目录下，容器会自动部署。<br />
     2)conf文件夹下主要是放置tomcat的服务器的相关配置文件<br />
     3)common文件夹主要是对容器全局变量的文件放置地方，如common/lib下就是放置一些需要全文配置的文件包。</p>
<p>二、j2ee的相关部署规范：<br />
     一般来说作为一个符合规范的web程序，会包括以下文件夹和文件：/WEB-INF/（主要是放置一些配置文件与不希望外部程序访问的隐私文件），在网络上是不允许访问该文件夹的，如当你输入以下http://localhost:8080/WEB-INF/的话就会出现错误。<br />
     在WEB-INF文件夹下有一个web.xml文件，这是对当前应用程序的相关设置，资源寻找等，/WEN-INF/文件夹下有个classes子文件夹，该文件夹是应用程序的根路径（等于是classpath的路径），/WEN-INF下还要有个lib文件夹，主要是放置需要引入的包，应用程序导入的包先从这里开始寻找，其次到容器的全局路径下$TOMCAT_HOME/common/lib下寻找。<br />
     以下是基本文件夹:<br />
/tomcat<br />
     /common<br />
           /lib<br />
           /classes<br />
    /conf<br />
    /webapps<br />
        /ROOT<br />
              web.xml<br />
              /WEB-INF<br />
                    /lib<br />
                    /classes<br />
        /你部署的程序包<br />
              web.xml<br />
              /WEB-INF<br />
                    /lib<br />
                    /classes<br />
三、容器的配置（server.xml)<br />
    到主目录/conf文件夹下server.xml文件是对web服务器的配置：<br />
    以下是一些常见的设置，http端口设置，找到以下：<br />
<code>&lt;Connector  port="8080"   maxThreads="150" minSpareThreads="25" maxSpareThreads="75"<br />
               enableLookups="false" redirectPort="8443" acceptCount="100"<br />
               connectionTimeout="20000" disableUploadTimeout="true" /&gt;</code><br />
    把8080端口改为你喜欢使用的端口，如常见的80，以后你就可以利用该端口进行访问你的网站了：http://localhost:80 期中80是默认的，可以不写，其他的一下配置，可以参观相关的内容，入门就是这么简单。<br />
    web.xml为servlet的一些相关配置，可以参照一下规范。可以看我写的其他文章。<br />
    继续说一下server.xml文件的设置，<br />
    找到以下：<br />
<code>   &lt;Host name="localhost" appBase="webapps"<br />
       unpackWARs="true" autoDeploy="true"<br />
       xmlValidation="false" xmlNamespaceAware="false"&gt;<br />
     ....<br />
  &lt;/Host&gt;</code><br />
     在他们之间可以添加一个<code>&lt;Context&gt;</code>元素，如：<code>&lt;Context path="/axis" reloadable="true" docBase="axis"  workDir="webapps/axis/work"/&gt;</code>，其中属性path代表是网络访问的上下文路径，reloadable表示可以在运行时在classes与lib文件夹下自动加载类包，docBase属性表示你的应用程序的路径，在windows在如：docBase=”E:\Sun\ axis”，workDir表示是缓存文件的放置地点，可以方便跨平台移植时不用重编译。这样，你的应用程序就可以放到硬盘上的任意地方了。还有一个方法可以做到这点（推荐）：编写一个xml文件，然后放到tomcat目录/conf/Catalina/<相应的网站>/目录下，如：现在我有个应用程序ACMEWeb，我编了一个文件ACMEWeb.xml内容如下：<br />
<code>      &lt;Context path="/ACMEWeb" reloadable="true" docBase="E:\eclipseproject\ACMEWeb" workDir="E:\eclipseproject\ACMEWeb\work" /&gt;</code><br />
      我把它放到了tomcat目录/conf/Cataline/localhost下，在浏览器打开http://localhost/ACMEWeb 就会转向我放在E:\eclipseproject\ACMEWeb下的程序了<br />
 四、关于taglib的修改：<br />
         （1）servlet-2.4之后，web.xml文件就有了一点修改。首先是声明命名空间：<br />
 <code>                  &lt;web-app xmlns="http://java.sun.com/xml/ns/j2ee"<br />
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"<br />
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"<br />
    version="2.4"&gt;&lt;/web-app&gt;</code><br />
        （2）其次是taglib，与传统的有所改变，对jsp的配置都被放置到<code>&lt;jsp-config&gt;</code>元素里了。可以使用Altova xmlspy打开web.xml文件，使用taglib的话，按照以下配置：<br />
<code>    &lt;jsp-config&gt;<br />
       &lt;taglib&gt;<br />
           &lt;taglib-uri&gt;oscache&lt;/taglib-uri&gt;<br />
           &lt;taglib-location&gt;/WEB-INF/oscache.tld&lt;/taglib-location&gt;<br />
     &lt;/taglib&gt;<br />
 &lt;/jsp-config&gt;</code> </p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://wlx.westgis.ac.cn/269/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ubuntu下安装tomcat5.5</title>
		<link>http://wlx.westgis.ac.cn/268/</link>
		<comments>http://wlx.westgis.ac.cn/268/#comments</comments>
		<pubDate>Sat, 14 Oct 2006 12:09:03 +0000</pubDate>
		<dc:creator>wlx</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[tomcat]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[安装]]></category>

		<guid isPermaLink="false">http://wlxblog.westgis.ac.cn/268/</guid>
		<description><![CDATA[安装： sudo aptitude install tomcat5.5 若还要和apache2结合，还要安装： sudo aptitude install libapache2-mod-jk 若没有配置JAVA环境变量，tomcat是无法启动的。 首先确认安装的JAVA位置： sudo update-alternatives &#8211;config java 然后修改环境变量： sudo nano /etc/profile 添加： JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun JRE_HOME=/usr/lib/jvm/java-1.5.0-sun/jre CLASSPATH=.:/usr/lib/jvm//java-1.5.0-sun/lib/tools.jar:/usr/lib/jvm/java-1.5.0-sun/lib/dt.jar export JRE_HOME export JAVA_HOME export CLASSPATH 注意，我的jdk是安装在/usr/lib/jvm/java-1.5.0-sun这个目录下，这是ubuntu下的默认安装位置。 若安装了libapache2-mod-jk，则还需要进一步的配置： sudo nano /etc/apache2/mods-available/jk.load 添加一行： Include /etc/apache2/conf.d/jk.conf sudo nano &#8230; <a href="http://wlx.westgis.ac.cn/268/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>安装：</p>
<blockquote><p>sudo aptitude install tomcat5.5</p></blockquote>
<p>若还要和apache2结合，还要安装：</p>
<blockquote><p>sudo aptitude install libapache2-mod-jk</p></blockquote>
<p>若没有配置JAVA环境变量，tomcat是无法启动的。<br />
首先确认安装的JAVA位置：</p>
<blockquote><p>sudo update-alternatives &#8211;config java</p></blockquote>
<p>然后修改环境变量：</p>
<blockquote><p>sudo nano /etc/profile</p></blockquote>
<p>添加：</p>
<blockquote><p>JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun<br />
JRE_HOME=/usr/lib/jvm/java-1.5.0-sun/jre<br />
CLASSPATH=.:/usr/lib/jvm//java-1.5.0-sun/lib/tools.jar:/usr/lib/jvm/java-1.5.0-sun/lib/dt.jar<br />
export JRE_HOME<br />
export JAVA_HOME<br />
export CLASSPATH</p></blockquote>
<p>注意，我的jdk是安装在/usr/lib/jvm/java-1.5.0-sun这个目录下，这是ubuntu下的默认安装位置。<br />
若安装了libapache2-mod-jk，则还需要进一步的配置：<br />
sudo nano /etc/apache2/mods-available/jk.load<br />
添加一行：<br />
Include /etc/apache2/conf.d/jk.conf</p>
<p>sudo nano /etc/apache2/conf.d/jk.conf<br />
其内容如下：</p>
<blockquote><p><code>JkWorkersFile /etc/libapache2-mod-jk/workers.properties</p>
<p># Where to put jk logs<br />
JkLogFile /var/log/apache2/mod_jk.log</p>
<p># Set the jk log level [debug/error/info]<br />
JkLogLevel info</p>
<p># Select the log format<br />
JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"</p>
<p># JkOptions indicate to send SSL KEY SIZE,<br />
JkOptions  +ForwardKeySize +ForwardURICompat -ForwardDirectories</p>
<p># JkRequestLogFormat set the request format<br />
JkRequestLogFormat "%w %V %T"</p>
<p># 将所有servlet 和jsp请求通过ajp13的协议送给Tomcat，让Tomcat来处理<br />
JkMount /servlet/*  ajp13_worker<br />
JkMount /*.jsp ajp13_worker<br />
JkShmFile /var/log/jk-runtime-status<br />
&lt;LocationMatch '.*WEB-INF.*'&gt;<br />
       AllowOverride None<br />
       deny from all<br />
&lt;/LocationMatch&gt;</code>
</p></blockquote>
<p>修改网站的配置，把index.jsp添加到默认首页。<br />
重新启动tomcat/apache2。</p>
]]></content:encoded>
			<wfw:commentRss>http://wlx.westgis.ac.cn/268/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

