<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[小雨的博客]]></title> 
<link>http://blog.gsywx.com/index.php</link> 
<description><![CDATA[小雨的博客]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[小雨的博客]]></copyright>
<item>
<link>http://blog.gsywx.com/read.php/109.htm</link>
<title><![CDATA[lighttpd下discuzx2 伪静态规则 ]]></title> 
<author>xiaoyuwxz &lt;wxz@gsywx.com&gt;</author>
<category><![CDATA[原创]]></category>
<pubDate>Sat, 10 Sep 2011 02:00:11 +0000</pubDate> 
<guid>http://blog.gsywx.com/read.php/109.htm</guid> 
<description>
<![CDATA[ 
	本内容为原创内容，转载请注明：<br/>本文来自http://blog.gsywx.com<br/><br/><br/>规则文件为：<br/><br/><div class="code">&nbsp;&nbsp;<br/>url.rewrite-once = (<br/>&quot;^(.*)/topic-(.+)&#92;.html$&quot; =&gt; &quot;$1/portal.php?mod=topic&amp;topic=$2&quot;,<br/>&quot;^(.*)/article-(&#91;0-9&#93;+)-(&#91;0-9&#93;+)&#92;.html$&quot; =&gt; &quot;$1/portal.php?mod=view&amp;aid=$2&quot;,<br/>&quot;^(.*)/forum-(&#92;w+)-(&#91;0-9&#93;+)&#92;.html$&quot; =&gt; &quot;$1/forum.php?mod=forumdisplay&amp;fid=$2&amp;page=$3&quot;,<br/>&quot;^(.*)/thread-(&#91;0-9&#93;+)-(&#91;0-9&#93;+)-(&#91;0-9&#93;+)&#92;.html$&quot; =&gt; &quot;$1/forum.php?mod=viewthread&amp;tid=$2&amp;extra=page%3D$4&amp;page=$3&quot;,<br/>&quot;^(.*)/group-(&#91;0-9&#93;+)-(&#91;0-9&#93;+)&#92;.html$&quot; =&gt; &quot;$1/forum.php?mod=group&amp;fid=$2&amp;page=$3&quot;,<br/>&quot;^(.*)/space-(username&#124;uid)-(.+)&#92;.html$&quot; =&gt; &quot;$1/home.php?mod=space&amp;$2=$3&quot;,<br/>&quot;^(.*)/blog-(&#91;0-9&#93;+)-(&#91;0-9&#93;+)&#92;.html$&quot; =&gt; &quot;$1/home.php?mod=space&amp;uid=$2&amp;do=blog&amp;id=$3&quot;,<br/>&quot;^(.*)/(fid&#124;tid)-(&#91;0-9&#93;+)&#92;.html$&quot; =&gt; &quot;$1/index.php?action=$2&amp;value=$3&quot;<br/>)<br/><br/> </div><br/><br/><br/>加载方法有两种：<br/><br/>一、直接加载到配置文件中<br/>修改配置lighttpd配置文件如：lighttpd.conf或者lighttpd-vhost.conf<br/>在server.document-root = &quot;/home/wwwroot/htdocs&quot;下面一行添加以上规则，保存退出后重启lighttpd服务即可<br/><br/>二、创建规则文件后添加到配置文件<br/>在/etc/lighttpd目录创建规则文件discuzx2.conf内容为以上的规则内容，退出保存<br/>修改配置lighttpd配置文件如：lighttpd.conf或者lighttpd-vhost.conf<br/>在server.document-root = &quot;/home/wwwroot/htdocs&quot;下面一行添加一行：<br/>include &quot;discuzx2.conf&quot;<br/>退出保存重启lighttpd服务 <br/><br/>Tags - <a href="http://blog.gsywx.com/go.php/tags/lighttpd%25E4%25BC%25AA%25E9%259D%2599%25E6%2580%2581/" rel="tag">lighttpd伪静态</a>
]]>
</description>
</item><item>
<link>http://blog.gsywx.com/read.php/107.htm</link>
<title><![CDATA[关于伪静态收录后更改域名的两点记录]]></title> 
<author>xiaoyuwxz &lt;wxz@gsywx.com&gt;</author>
<category><![CDATA[电脑类]]></category>
<pubDate>Sun, 03 Apr 2011 01:00:25 +0000</pubDate> 
<guid>http://blog.gsywx.com/read.php/107.htm</guid> 
<description>
<![CDATA[ 
	一、更换域名后原收录的地址转到新域名<br/><br/>安装rewrite组件2.x 版本，如isapi_rwf_x86_2.13.1.73<br/>在httpd.ini规则中增加如下语句：<br/># For ISAPI_Rewrite 2.x<br/>RewriteCond Host: ^www&#92;.bb&#92;.com$<br/>RewriteRule (.*) http&#92;://www&#92;.cc&#92;.com$1 [I,RP]<br/><br/>如是3.x版本的则增加如下语句：<br/># For ISAPI_Rewrite 3.x<br/>RewriteCond %&#123;HTTP:Host&#125; ^www&#92;.bb&#92;.com$<br/>RewriteRule (.*) http&#92;://www&#92;.cc&#92;.com$1 [NC,R=301]<br/><br/>二、取消伪静态转向动态，使原收录保持能访问<br/><br/>安装rewrite组件2.x 版本，如isapi_rwf_x86_2.13.1.73<br/>在httpd.ini规则中的第一行增加：<br/>[RP,L]<br/><br/>如是3.x版本的则增加：<br/>[R=301,L]<br/><br/><br/>Tags - <a href="http://blog.gsywx.com/go.php/tags/%25E4%25BC%25AA%25E9%259D%2599%25E6%2580%2581/" rel="tag">伪静态</a> , <a href="http://blog.gsywx.com/go.php/tags/isapi/" rel="tag">isapi</a>
]]>
</description>
</item><item>
<link>http://blog.gsywx.com/read.php/106.htm</link>
<title><![CDATA[mysql5.5.10源码安装教程]]></title> 
<author>xiaoyuwxz &lt;wxz@gsywx.com&gt;</author>
<category><![CDATA[电脑类]]></category>
<pubDate>Sat, 02 Apr 2011 01:31:43 +0000</pubDate> 
<guid>http://blog.gsywx.com/read.php/106.htm</guid> 
<description>
<![CDATA[ 
	本内容为原创内容，转载请注明：<br/>本文来自http://blog.gsywx.com<br/><br/>系统为centos5.5 32位，从官方下载mysql-5.5.10.tar.gz源码包<br/>mysql-5.5.10.tar.gz上传到系统中的/soft/目录<br/><br/><div class="code"><br/>cd /soft/<br/>wget http://www.cmake.org/files/v2.8/cmake-2.8.4.tar.gz<br/>tar zxvf cmake-2.8.4.tar.gz <br/>cd cmake-2.8.4<br/>./configure <br/>make<br/>make install<br/>cd ../<br/>&nbsp;&nbsp;<br/>tar zxvf mysql-5.5.10.tar.gz <br/>cd mysql-5.5.10<br/>cmake . -DCMAKE_INSTALL_PREFIX=/web/mysql/ -DMYSQL_DATADIR=/web/mysql/data -DWITH_INNOBASE_STORAGE_ENGINE=1 -DENABLED_LOCAL_INFILE=1 -DEXTRA_CHARSETS=all -DWITH_DEBUG=0<br/>make &amp;&amp; make install<br/>cd /web/mysql/<br/>cp support-files/mysql.server /etc/init.d/mysqld<br/>groupadd mysql<br/>useradd mysql -g mysql -d /dev/null -s /sbin/nologin<br/>chown -R mysql .<br/>chgrp -R mysql .<br/>chmod 755 /etc/init.d/mysqld<br/>cp support-files/my-medium.cnf /etc/my.cnf <br/>sed -i &#039;s/log-bin=mysql-bin/#log-bin=mysql-bin/g&#039; /etc/my.cnf<br/>sed -i &#039;s/binlog_format=mixed/#binlog_format=mixed/g&#039; /etc/my.cnf<br/>sed -i &#039;s/skip-federated/#skip-federated/g&#039; /etc/my.cnf<br/>sed -i &#039;s/skip-locking/skip-locking&#92;nmax_connections = 1000&#92;nwait_timeout = 5/g&#039; /etc/my.cnf<br/>chkconfig --add mysqld<br/>chkconfig mysqld on<br/>./scripts/mysql_install_db --user=mysql <br/>service mysqld start<br/>./bin/mysqladmin -u root password 123654<br/>./bin/mysql -uroot -p<br/>mysql&gt;use mysql;<br/>mysql&gt;show databases;<br/>mysql&gt;quit;<br/></div><br/>Tags - <a href="http://blog.gsywx.com/go.php/tags/mysql5.5/" rel="tag">mysql5.5</a>
]]>
</description>
</item><item>
<link>http://blog.gsywx.com/read.php/105.htm</link>
<title><![CDATA[vsftpd2.3.4 源码安装脚本]]></title> 
<author>xiaoyuwxz &lt;wxz@gsywx.com&gt;</author>
<category><![CDATA[电脑类]]></category>
<pubDate>Fri, 01 Apr 2011 13:06:16 +0000</pubDate> 
<guid>http://blog.gsywx.com/read.php/105.htm</guid> 
<description>
<![CDATA[ 
	本内容为原创内容，转载请注明：<br/>本文来自http://blog.gsywx.com<br/><br/><a href="attachment.php?fid=47">点击这里下载文件</a><br/><br/><br/>本安装为vsftpd2.3.4源码包安装，安装环境为centos5.5 32位，安装过程中创建ftp用户为：www，密码为：123654，并打开日志，日志为：/var/log/vsftpd.log 和 ：/var/log/xferlog<br/><br/>下面为安装脚本，也可以直接下载附件包上传后进行安装。<br/><br/><div class="code"><br/>#!/bin/bash<br/>clear<br/>echo &quot;----------------源码安装vsftpd安装程序，按任意键继续----------------&quot;&nbsp;&nbsp;<br/>get_char()<br/>&nbsp;&nbsp;&#123;<br/>&nbsp;&nbsp;SAVEDSTTY=`stty -g`<br/>&nbsp;&nbsp;stty -echo<br/>&nbsp;&nbsp;stty cbreak<br/>&nbsp;&nbsp;dd if=/dev/tty bs=1 count=1 2&gt; /dev/null<br/>&nbsp;&nbsp;stty -raw<br/>&nbsp;&nbsp;stty echo<br/>&nbsp;&nbsp;stty $SAVEDSTTY<br/>&nbsp;&nbsp;&#125;<br/>&nbsp;&nbsp;echo &quot;&quot;<br/>&nbsp;&nbsp;echo &quot;本安装为本地用户登录FTP，并开启日志，请按任意键继续......&quot;<br/>&nbsp;&nbsp;char=`get_char`<br/><br/>mkdir -p /usr/local/man/man8/<br/>mkdir -p /usr/local/man/man5/<br/><br/>tar zxvf vsftpd-2.3.4.tar.gz <br/>cd vsftpd-2.3.4<br/>make<br/>make install<br/><br/>cp vsftpd.conf /etc/<br/>#touch /etc/vsftpd.chroot_list<br/>touch /etc/ftpusers<br/>cat &gt;&gt;/etc/ftpusers&lt;&lt;EOF<br/>root<br/>bin<br/>daemon<br/>adm<br/>lp<br/>sync<br/>shutdown<br/>halt<br/>mail<br/>news<br/>uucp<br/>operator<br/>games<br/>nobody<br/>mysql<br/>EOF<br/><br/>touch /var/log/vsftpd.log<br/>cp RedHat/vsftpd.pam /etc/pam.d/vsftpd<br/>cp ../vsftpd /etc/rc.d/init.d/<br/>chmod 755 /etc/rc.d/init.d/vsftpd<br/>chkconfig --add vsftpd<br/>chkconfig&nbsp;&nbsp;vsftpd on<br/><br/>sed -i &#039;s#anonymous_enable=YES#anonymous_enable=NO#&#039;&nbsp;&nbsp;/etc/vsftpd.conf<br/>sed -i &#039;s&#92;#local_enable=YES&#92;local_enable=YES&#92;g&#039;&nbsp;&nbsp;/etc/vsftpd.conf<br/>sed -i &#039;s&#92;#write_enable=YES&#92;write_enable=YES&#92;g&#039;&nbsp;&nbsp;/etc/vsftpd.conf<br/>sed -i &#039;s&#92;#local_umask=022&#92;local_umask=022&#92;g&#039;&nbsp;&nbsp;/etc/vsftpd.conf<br/>sed -i &#039;s&#92;#ftpd_banner=Welcome to blah FTP service.&#92;ftpd_banner=Welcome to xiaoyuwxzs FTP service.&#92;g&#039; /etc/vsftpd.conf<br/>sed -i &#039;s&#92;dirmessage_enable=YES&#92;#dirmessage_enable=YES&#92;g&#039; /etc/vsftpd.conf<br/>sed -i &#039;s&#92;xferlog_enable=YES&#92;#xferlog_enable=YES&#92;g&#039; /etc/vsftpd.conf<br/>echo &quot;dual_log_enable=YES&quot; &gt;&gt;/etc/vsftpd.conf<br/>echo &quot;vsftpd_log_file=/var/log/vsftpd.log&quot; &gt;&gt;/etc/vsftpd.conf<br/>sed -i &#039;s&#92;connect_from_port_20=YES&#92;#connect_from_port_20=YES&#92;g&#039; /etc/vsftpd.conf<br/>echo &quot;pam_service_name=vsftpd&quot; &gt;&gt;/etc/vsftpd.conf<br/>echo &quot;chroot_local_user=YES&quot; &gt;&gt;/etc/vsftpd.conf<br/>echo &quot;增加www用户组，并增加www用户，www家目录设为/home/wwwroot/&quot;<br/>sleep2 <br/>groupadd www<br/>useradd www -g www -d /home/wwwroot/ -s /sbin/nologin<br/>echo &quot;123654&quot; &#124; passwd --stdin www<br/>chown www.www /home/wwwroot/<br/>service vsftpd start<br/>sleep 1<br/>echo &quot;删除安装临时文件..............&quot;<br/>rm -Rf vsftpd-2.3.4<br/>echo <br/>echo<br/>echo &quot; ------------------- 如需增加新用户，请使用以下命令 -------------------&quot;<br/>echo &quot;&#124;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;useradd 用户名 -g 用户组 -d 用户家目录 -s /sbin/nologin&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#124;&quot;<br/>echo &quot;&#124;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 如需禁用用户，增加用户名到 /etc/ftpusers&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#124;&quot;<br/>sleep 1 <br/>echo &quot; -------------------------- vsftpd 安装结束! --------------------------&quot;<br/>echo <br/></div><br/>Tags - <a href="http://blog.gsywx.com/go.php/tags/vsftpd/" rel="tag">vsftpd</a>
]]>
</description>
</item><item>
<link>http://blog.gsywx.com/read.php/104.htm</link>
<title><![CDATA[centos系统中：nginx前端apache后端 虚拟主机的配置]]></title> 
<author>xiaoyuwxz &lt;wxz@gsywx.com&gt;</author>
<category><![CDATA[电脑类]]></category>
<pubDate>Tue, 15 Mar 2011 22:59:09 +0000</pubDate> 
<guid>http://blog.gsywx.com/read.php/104.htm</guid> 
<description>
<![CDATA[ 
	httpd.conf中增加：<br/>Listen 81<br/>Listen 82<br/>Listen 83<br/>并同时开启：<br/>Include conf/extra/httpd-vhosts.conf<br/><br/>httpd-vhosts.conf配置三个站点，分别对应81 82 83 三个端口，配置如下：<br/><div class="code"> <br/>#-------------------- default root open with http://ip -------------------------<br/>&lt;VirtualHost *:81&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;ServerAdmin root@localhost<br/>&nbsp;&nbsp;&nbsp;&nbsp;DocumentRoot &quot;/home/wwwroot/htdocs&quot;<br/>&nbsp;&nbsp;&nbsp;&nbsp;ServerName 192.168.0.2<br/>#&nbsp;&nbsp;&nbsp;&nbsp;ServerAlias locahost 127.0.0.1<br/>#&nbsp;&nbsp;&nbsp;&nbsp;DirectoryIndex index.html index.html.var index.php<br/>#&nbsp;&nbsp; ErrorLog &quot;logs/error.log&quot;<br/>#&nbsp;&nbsp; CustomLog &quot;logs/access.log&quot; common<br/>&lt;/VirtualHost&gt;<br/><br/>#------------------------- virtual web www.aaa.com -----------------------------<br/>&lt;Directory /home/wwwroot/htdocs&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;AllowOverride ALL<br/>&nbsp;&nbsp;&nbsp;&nbsp;Allow from all<br/>&lt;/Directory&gt;<br/><br/>&lt;VirtualHost *:82&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;ServerAdmin admin@gsywx.com<br/>&nbsp;&nbsp;&nbsp;&nbsp;DocumentRoot /home/wwwroot/htdocs/www.aaa.com<br/>&nbsp;&nbsp;&nbsp;&nbsp;ServerName www.aaa.com<br/>#&nbsp;&nbsp;&nbsp;&nbsp;ServerAlias *.aaa.com<br/>#&nbsp;&nbsp;&nbsp;&nbsp;ErrorLog &quot;logs/www.aaa.com-error.log&quot;<br/>#&nbsp;&nbsp;&nbsp;&nbsp;CustomLog &quot;logs/www.aaa.com-access.log&quot; common<br/>&lt;/VirtualHost&gt;<br/><br/>#------------------------- virtual web www.bbb.com -----------------------------<br/>&lt;Directory /home/wwwroot/htdocs&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;AllowOverride ALL<br/>&nbsp;&nbsp;&nbsp;&nbsp;Allow from all<br/>&lt;/Directory&gt;<br/><br/>&lt;VirtualHost *:83&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;ServerAdmin admin@gsywx.com<br/>&nbsp;&nbsp;&nbsp;&nbsp;DocumentRoot /home/wwwroot/htdocs/www.bbb.com<br/>&nbsp;&nbsp;&nbsp;&nbsp;ServerName www.bbb.com<br/>#&nbsp;&nbsp;&nbsp;&nbsp;ServerAlias *.bbb.com<br/>#&nbsp;&nbsp;&nbsp;&nbsp;ErrorLog &quot;logs/www.bbb.com-error.log&quot;<br/>#&nbsp;&nbsp;&nbsp;&nbsp;CustomLog &quot;logs/www.bbb.com-access.log&quot; common<br/>&lt;/VirtualHost&gt;<br/></div><br/><br/><br/>nginx中的vhost.conf中配置对应的三个虚拟主机，配置如下：<br/><div class="code"><br/>&nbsp;&nbsp;upstream&nbsp;&nbsp;phppool1 &#123;<br/>&nbsp;&nbsp;server 127.0.0.1:81;<br/>&nbsp;&nbsp; &#125;<br/><br/>&nbsp;&nbsp;upstream&nbsp;&nbsp;phppool2 &#123;<br/>&nbsp;&nbsp;server 127.0.0.1:82;<br/>&nbsp;&nbsp; &#125;<br/><br/>&nbsp;&nbsp;upstream&nbsp;&nbsp;phppool3 &#123;<br/>&nbsp;&nbsp;server 127.0.0.1:83;<br/>&nbsp;&nbsp; &#125;<br/><br/>#------------------------------- default web dir -------------------------------<br/>server<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;listen 80;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;server_name 192.168.0.2;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;root /home/wwwroot/htdocs;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;location / &#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;proxy_pass http://phppool1;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;proxy_set_header Host $host;<br/>&#125;<br/>&#125;<br/><br/>#-------------------------------- www.aaa.com --------------------------------<br/>server<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;listen 80;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;server_name www.aaa.com;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;root /home/wwwroot/htdocs/www.aaa.com;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;location / &#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;proxy_pass http://phppool2;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;proxy_set_header Host $host;<br/>&#125;<br/>&#125;<br/><br/>#-------------------------------- www.bbb.com --------------------------------<br/>server<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;listen 80;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;server_name www.bbb.com;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;root /home/wwwroot/htdocs/www.bbb.com;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;location / &#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;proxy_pass http://phppool3;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;proxy_set_header Host $host;<br/>&#125;<br/>&#125;<br/></div><br/>Tags - <a href="http://blog.gsywx.com/go.php/tags/apache%25E8%2599%259A%25E6%258B%259F%25E4%25B8%25BB%25E6%259C%25BA/" rel="tag">apache虚拟主机</a> , <a href="http://blog.gsywx.com/go.php/tags/nginx%25E8%2599%259A%25E6%258B%259F%25E4%25B8%25BB%25E6%259C%25BA/" rel="tag">nginx虚拟主机</a>
]]>
</description>
</item><item>
<link>http://blog.gsywx.com/read.php/103.htm</link>
<title><![CDATA[centos网站图片显示变形不完整的解决]]></title> 
<author>xiaoyuwxz &lt;wxz@gsywx.com&gt;</author>
<category><![CDATA[电脑类]]></category>
<pubDate>Thu, 13 Jan 2011 00:43:55 +0000</pubDate> 
<guid>http://blog.gsywx.com/read.php/103.htm</guid> 
<description>
<![CDATA[ 
	本内容为原创内容，转载请注明：<br/>本文来自http://blog.gsywx.com<br/><br/><br/>在用centos建立网站环境时，出现了这样的问题：<br/>网站上的图片无法在IE中正确打开，发现都变形了，或色彩变得模糊或一块块的，使用图片另存为，发现图片只有上面一部份，下面部份丢失，或索性整个都不完整。检查网站上的图片完全正确，是用ssh二进制上传的。<br/>重新安装nginx后问题依旧，于是，再安装apache，测试还一样，再用yum安装centos自带的apache，还是如此，后来经朋友查找发现说apache下的sendfile会有某些系统或CPU情况下存在bug，具体不深究它，解决问题即可。<br/>解决方法：<br/>在apache情况下：在httpd.conf中增加语句：EnableSendfile Off <br/>在nginx情况下：修改nginx.conf中的 sendfile on;为 sendfile off;<br/><br/>为了更深地了解此问题，以下内容为搜索来的：<br/><br/>apache 配置中的两个指令EnableMMAP与EnableSendfile详解<br/>访问大文件时>100k,只能送出前30k左右的内容,<br/>在 ie中如何刷新都不能显示完整, 在 firefox中刷新几次后可显示完整,用 wget时,可看出明显的续传的过程.<br/><br/>需要关闭以下两项, 具体还是不知为何,但行之有效:<br/><br/>EnableMMAP 指令 <br/>说明 在递送中使用内存映射(memory-mapping)来读取文件 <br/>语法 EnableMMAP On&#124;Off <br/>默认值 EnableMMAP On <br/>作用域 server config, virtual host, directory, .htaccess <br/>覆盖项 FileInfo <br/>状态 核心(C) <br/>模块 core <br/><br/>此指令指示httpd在递送中如果需要读取一个文件的内容，它是否可以使用内存映射。当处理一个需要访问文件中的数据的请求时，比如说当递送一个使用mod_include进行服务器端分析的文件时，如果操作系统支持，Apache将默认使用内存映射。<br/><br/>这种内存映射有时会带来性能的提高，但在某些情况下，您可能会需要禁用内存映射以避免一些操作系统的问题：<br/><br/>在一些多处理器的系统上，内存映射会减低一些httpd的性能。 <br/>在挂载了NFS的DocumentRoot上，若已经将一个文件进行了内存映射，则删除或截断这个文件会造成httpd因为分段故障而崩溃。 <br/>在可能遇到这些问题的服务器配置过程中，您应当使用下面的命令来禁用内存映射：<br/><br/>EnableMMAP Off <br/><br/>对于挂载了NFS的文件夹，可以单独指定禁用内存映射：<br/><br/><Directory "/path-to-nfs-files"> EnableMMAP Off </Directory> <br/><br/>EnableSendfile 指令 <br/>说明 使用操作系统内核的sendfile支持来将文件发送到客户端 <br/>语法 EnableSendfile On&#124;Off <br/>默认值 EnableSendfile On <br/>作用域 server config, virtual host, directory, .htaccess <br/>覆盖项 FileInfo <br/>状态 核心(C) <br/>模块 core <br/>兼容性 仅在 Apache 2.0.44 及以后的版本中可用 <br/><br/>这个指令控制httpd是否可以使用操作系统内核的sendfile支持来将文件发送到客户端。默认情况下，当处理一个请求并不需要访问文件内部的数据时(比如发送一个静态的文件内容)，如果操作系统支持，Apache将使用sendfile将文件内容直接发送到客户端而并不读取文件。译者注：Linux2.4/2.6内核都支持。<br/><br/>这个sendfile机制避免了分开的读和写操作以及缓冲区分配，但是在一些平台或者一些文件系统上，最好禁止这个特性来避免一些问题：<br/><br/>一些平台可能会有编译系统检测不到的有缺陷的sendfile支持，特别是将在其他平台上使用交叉编译得到的二进制文件运行于当前对sendfile支持有缺陷的平台时。 <br/>在Linux上启用IPv6时，使用sendfile将会触发某些网卡上的TCP校验和卸载bug。 <br/>当Linux运行在Itanium处理器上的时候，sendfile可能无法处理大于2GB的文件。 <br/>对于一个通过网络挂载了NFS文件系统的DocumentRoot (比如：NFS或SMB)，内核可能无法可靠的通过自己的缓冲区服务于网络文件。 <br/>如果出现以上情况，你应当禁用sendfile ：<br/><br/>EnableSendfile Off <br/><br/>针对NFS或SMB，这个指令可以被针对目录的设置覆盖：<br/><br/><Directory "/path-to-nfs-files"> EnableSendfile Off </Directory> <br/> <br/><br/><br/>Tags - <a href="http://blog.gsywx.com/go.php/tags/centos/" rel="tag">centos</a>
]]>
</description>
</item><item>
<link>http://blog.gsywx.com/read.php/102.htm</link>
<title><![CDATA[linux系统时间的设置]]></title> 
<author>xiaoyuwxz &lt;wxz@gsywx.com&gt;</author>
<category><![CDATA[电脑类]]></category>
<pubDate>Sat, 13 Nov 2010 12:44:06 +0000</pubDate> 
<guid>http://blog.gsywx.com/read.php/102.htm</guid> 
<description>
<![CDATA[ 
	linux系统时间的设置<br/><br/>一、设置时区<br/>命令 tzselect<br/>选择 5) Asia<br/>选择 9) China<br/>选择1) east China - Beijing, Guangdong, Shanghai, etc.<br/>选择1) Yes<br/><br/>以上如果不通过tzselect，也可以直接修改 <br/>/etc/sysconfig/clock<br/>内容为<br/>ZONE="Asia/Shanghai"<br/>UTC=true<br/>ARC=false<br/>保存即可<br/><br/>二、设置时间自动更新<br/>安装ntpdate,ntpdate使用UDP协议<br/>yum install netdate<br/>加入计划任务<br/>crontab -e<br/>00 */3 * * * ntpdate 210.72.145.44<br/>每3小时更新一次，210.72.145.44 为中国国家时间检验中心IP<br/><br/>如果系统上层UDP协议被封，那么可以使用rdate命令来更新时间，格式如下：<br/>00 */3 * * * rdate -s time-b.nist.gov<br/><br/>Tags - <a href="http://blog.gsywx.com/go.php/tags/linux%25E6%2597%25B6%25E9%2597%25B4/" rel="tag">linux时间</a> , <a href="http://blog.gsywx.com/go.php/tags/%25E8%2587%25AA%25E5%258A%25A8%25E6%259B%25B4%25E6%2596%25B0%25E6%2597%25B6%25E9%2597%25B4/" rel="tag">自动更新时间</a>
]]>
</description>
</item><item>
<link>http://blog.gsywx.com/read.php/101.htm</link>
<title><![CDATA[Centos下安装TWiki教程]]></title> 
<author>xiaoyuwxz &lt;wxz@gsywx.com&gt;</author>
<category><![CDATA[电脑类]]></category>
<pubDate>Tue, 09 Nov 2010 11:17:47 +0000</pubDate> 
<guid>http://blog.gsywx.com/read.php/101.htm</guid> 
<description>
<![CDATA[ 
	本内容为原创内容，转载请注明：<br/>本文来自http://blog.gsywx.com<br/><br/>默认约定：服务器环境centos5.5 32位，为了省时间环境使用yum安装<br/><br/>1、首先配置服务器环境，使用yum -y install httpd rcs<br/>2、打开/etc/httpd/conf/httpd.con<br/>&nbsp;&nbsp;&nbsp;&nbsp;查找 AddDefaultCharset UTF-8&nbsp;&nbsp;改成AddDefaultCharset GB2312<br/>&nbsp;&nbsp;&nbsp;&nbsp;查找：AddHandler cgi-script .cgi 前面的#去掉<br/>&nbsp;&nbsp; Options Indexes FollowSymLinks 修改为Options ExecCGI<br/>&nbsp;&nbsp;&nbsp;&nbsp;AllowOverride None修改为AllowOverride All<br/>&nbsp;&nbsp;&nbsp;&nbsp;重启httpd，service httpd restart<br/>3、下载Twiki<br/>&nbsp;&nbsp; 下载地址为：http://twiki.org/ 或http://down.zzbaike.com/download/TWiki-476.html<br/>4、上传解压出来的程序，给网站目录当前用户的可执行权限。<br/>&nbsp;&nbsp; /bin/LocalLib.cfg.txt 改名为/bin/LocalLib.cfg，修改$twikiLibPath = "/absolute/path/to/your/lib";为$twikiLibPath = "/var/www/html/lib";<br/>&nbsp;&nbsp;&nbsp;&nbsp;修改/bin/.htaccess.txt 为/bin/.htaccess<br/>&nbsp;&nbsp;&nbsp;&nbsp;修改root-htaccess.txt为.htaccess<br/>&nbsp;&nbsp;&nbsp;&nbsp;修改/bin/configure为/bin/configure.cgi<br/>5、运行配置文件 http://192.168.0.2/bin/configure.cgi进行安装<br/>&nbsp;&nbsp;&nbsp;&nbsp;如果要支持中文，配置的时候做如下设置：在configure中的Localisation设置需要特别注意，需要选中 &#123;UserInterfaceInternationalisation&#125;、&#123;Languages&#125;&#123;'zh-cn'&#125;&#123;Enabled&#125;、&#123;UseLocale&#125;这几项设置的复选框，并设置&#123;Site&#125;&#123;Locale&#125;为zh_CN.UTF-8，设置&#123;Site&#125; &#123;CharSet&#125;为UTF-8，&#123;Site&#125;&#123;Lang&#125;和&#123;Site&#125;&#123;FullLang&#125;为zh-CN，这样保存设置之后，打开Wiki就会是中文，并且能够正常的使用和编辑中文了。 <br/>6、设置好之后，通过bin目录下的view打开Wiki，例如http://192.168.0.2/bin/view <br/><br/>Tags - <a href="http://blog.gsywx.com/go.php/tags/twiki/" rel="tag">twiki</a> , <a href="http://blog.gsywx.com/go.php/tags/cgi%25E7%258E%25AF%25E5%25A2%2583/" rel="tag">cgi环境</a>
]]>
</description>
</item><item>
<link>http://blog.gsywx.com/read.php/100.htm</link>
<title><![CDATA[MSN2009无法在win2003上安装的解决方法]]></title> 
<author>xiaoyuwxz &lt;wxz@gsywx.com&gt;</author>
<category><![CDATA[电脑类]]></category>
<pubDate>Mon, 08 Nov 2010 00:58:32 +0000</pubDate> 
<guid>http://blog.gsywx.com/read.php/100.htm</guid> 
<description>
<![CDATA[ 
	去MSN官方下载MSN2009，(这是个在线安装版)下载地址为：<br/>http://www.windowslive.cn/get/<br/>从网上下载ResHacker<br/><br/>用ResHacker 打开MSN9的安装文件,修改 CONFIG 下的 CONFIG0 下的 0<br/>把&lt;os productType=&quot;workstation&quot; /&gt;改为&lt;os productType=&quot;server&quot; /&gt;<br/>在&quot;&lt;os version=&quot;vista&quot; condition=&quot;greaterthanorequal&quot; /&gt;&lt;/group&gt;&quot;，后面插入以下代码&quot;&lt;group logic=&quot;and&quot; name=&quot;server&quot;&gt;&lt;os version=&quot;server2003sp2&quot; condition=&quot;greaterthanorequal&quot; /&gt;&lt;/group&gt;&quot; 然后点编译脚本，保存<br/><br/>或者可以直接复制下面的代码覆盖原来的代码编译脚本后保存<br/><br/>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;&lt;installerConfig version=&quot;1&quot;&gt;&lt;setting name=&quot;language&quot;&gt;zh-chs&lt;/setting&gt;&lt;setting name=&quot;buildtype&quot;&gt;ship&lt;/setting&gt;&lt;setting name=&quot;CeipDefault&quot;&gt;false&lt;/setting&gt;&lt;setting name=&quot;HomepageDefault&quot;&gt;true&lt;/setting&gt;&lt;setting name=&quot;SearchDefault&quot;&gt;true&lt;/setting&gt;&lt;setting name=&quot;ToolbarDefault&quot;&gt;true&lt;/setting&gt;&lt;setting name=&quot;SearchFormCode&quot;&gt;IEFM1&lt;/setting&gt;&lt;setting name=&quot;paralleltasks&quot;&gt;0&lt;/setting&gt;&lt;setting name=&quot;sku&quot;&gt;wlsetup-web.exe&lt;/setting&gt;&lt;applications&gt;&lt;application id=&quot;messenger&quot;&gt;&lt;launch&gt;true&lt;/launch&gt;&lt;/application&gt;&lt;application id=&quot;familysafety&quot;&gt;&lt;launch&gt;true&lt;/launch&gt;&lt;/application&gt;&lt;/applications&gt;&lt;ui&gt;&lt;level&gt;standard&lt;/level&gt;&lt;/ui&gt;&lt;rule name=&quot;IsValidOs&quot; logic=&quot;or&quot;&gt;&lt;group logic=&quot;and&quot; name=&quot;vista+&quot;&gt;&lt;os version=&quot;vista&quot; condition=&quot;greaterthanorequal&quot; /&gt;&lt;/group&gt;&lt;group logic=&quot;and&quot; name=&quot;server&quot;&gt;&lt;os version=&quot;server2003sp2&quot; condition=&quot;greaterthanorequal&quot; /&gt;&lt;/group&gt;&lt;group logic=&quot;and&quot; name=&quot;xpsp2&quot;&gt;&lt;os version=&quot;xp&quot; servicePack=&quot;2&quot; condition=&quot;greaterthanorequal&quot; /&gt;&lt;os version=&quot;vista&quot; condition=&quot;lessthan&quot; /&gt;&lt;os productType=&quot;server&quot; /&gt;&lt;os cpu=&quot;i386&quot; /&gt;&lt;/group&gt;&lt;/rule&gt;&lt;rule name=&quot;IsValidMsi&quot; logic=&quot;or&quot;&gt;&lt;group logic=&quot;and&quot; name=&quot;vista&quot;&gt;&lt;os version=&quot;vista&quot; condition=&quot;greaterthanorequal&quot; /&gt;&lt;true /&gt;&lt;/group&gt;&lt;group logic=&quot;and&quot; name=&quot;xpsp2&quot;&gt;&lt;os version=&quot;xp&quot; servicePack=&quot;2&quot; condition=&quot;greaterthanorequal&quot; /&gt;&lt;fileVersion path=&quot;CSIDL_SYSTEM&quot; file=&quot;msi.dll&quot; version=&quot;3.1.0.0&quot; condition=&quot;greaterthanorequal&quot; /&gt;&lt;/group&gt;&lt;/rule&gt;&lt;/installerConfig&gt;<br/>Tags - <a href="http://blog.gsywx.com/go.php/tags/msn/" rel="tag">msn</a> , <a href="http://blog.gsywx.com/go.php/tags/msn2003/" rel="tag">msn2003</a>
]]>
</description>
</item><item>
<link>http://blog.gsywx.com/read.php/99.htm</link>
<title><![CDATA[vsftpd+mysql虚拟用户配置笔记及说明]]></title> 
<author>xiaoyuwxz &lt;wxz@gsywx.com&gt;</author>
<category><![CDATA[原创]]></category>
<pubDate>Mon, 27 Sep 2010 13:26:48 +0000</pubDate> 
<guid>http://blog.gsywx.com/read.php/99.htm</guid> 
<description>
<![CDATA[ 
	本内容为原创内容，转载请注明：<br/>本文来自http://blog.gsywx.com<br/><br/>一、目的：安装vsftpd+mysql，vsftpd用户由mysql数据表存放虚拟用户<br/>二、安装方式：采用yum进行安装vsftpd及mysql，系统环境为centos5.5(32)<br/>注：所有加#开头的为说明语句<br/><br/>三、具体安装<br/>1、安装vsftpd<br/>yum -y install vsftpd<br/>vi /etc/vsftpd/vsftpd.conf<br/>作如下修改：<br/>anonymous_enable=YES 改为 anonymous_enable=NO<br/>#禁用匿名用户登录<br/>在最后加上：<br/>chroot_local_user=YES<br/>#将本地用户锁定在家目录<br/>chkconfig vsftpd on<br/>service vsftpd start<br/>#以下添加vsftpd的虚拟公共帐户<br/>useradd vsftpdguest -d /home/vsftpdguest -s /sbin/nologin<br/>chmod 755 /home/vsftpdguest<br/><br/>2、安装mysql<br/>yum -y install mysql mysql-devel mysql-server<br/>service mysqld start<br/>#设置mysql密码<br/>mysqladmin -u root password 123654<br/>mysql -u root -p<br/>#输入密码 123654<br/>#建立vsftpd两虚拟用户： aaa 密码: 123456&nbsp;&nbsp;、bbb 密码: 123654<br/>create database vsftpd; <br/>use vsftpd; <br/>create table users(name char(16) binary,passwd char(16) binary); <br/>insert into users (name,passwd) values ('aaa','123456'); <br/>insert into users (name,passwd) values ('bbb','123654'); <br/>#给数据库vsftpd赋予用户vsftpdguest密码654321对users表的读取权限<br/>grant select on vsftpd.users to vsftpdguest@localhost identified by '654321'; <br/>flush privileges;<br/>select * from users;<br/>#这时可以看到新加的用户和密码，密码是以明文列示的<br/>quit;<br/><br/>3、安装pam_mysql模块，下载地址为：http://sourceforge.net/projects/pam-mysql/files/pam-mysql/<br/>#这里我下载pam_mysql-0.7RC1.tar.gz<br/>tar zxvf pam_mysql-0.7RC1.tar.gz<br/>cd pam_mysql-0.7RC1<br/>./configure<br/>#因为mysql为默认安装，所以可以缺少编译参数，如果自定义安装可以参照以下语句<br/>#(#./configure --with-mysql=/web/mysql)<br/>make<br/>make install<br/>安装后会看到以下语句<br/>#Libraries have been installed in:<br/>#/usr/lib/security<br/>cp /usr/lib/security/pam_mysql.* /lib/security/<br/>#以下备份vsftpd的pam文件以及创建新的认证文件<br/>mv /etc/pam.d/vsftpd /etc/pam.d/vsftpd.bak<br/>#加上<br/>vi /etc/pam.d/vsftpd&nbsp;&nbsp;加上：<br/>#%PAM-1.0<br/>auth required /lib/security/pam_mysql.so user=vsftpdguest passwd=654321 host=localhost db=vsftpd table=users usercolumn=name passwdcolumn=passwd crypt=0<br/>account required /lib/security/pam_mysql.so user=vsftpdguest passwd=654321 host=localhost db=vsftpd table=users usercolumn=name passwdcolumn=passwd crypt=0 <br/><br/><br/>4、配置vsftpd.conf<br/>vi /etc/vsftpd/vsftpd.conf&nbsp;&nbsp; 在最后加上：<br/>guest_enable=YES<br/>guest_username=vsftpdguest<br/>virtual_use_local_privs=YES<br/>重启vsftpd<br/>service vsftpd restart<br/>#说明：以上三句为除了匿名用户外的所有用户都是guest，除了匿名用户外的所有用户使用vsftpdguest，虚拟用户使用与本地用户相同的权限<br/><br/>四、额外的部份权限控制说明：<br/>当virtual_use_local_privs=YES时，只需设置write_enable=YES，虚拟用户就可以就拥有写权限<br/><br/>当virtual_use_local_privs=NO时，anon_world_readable_only=YES,则虚拟用户只读不能上传<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;anon_upload_enable=YES时，匿名用户能上传，但不能覆盖和改写删除文件<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;anon_mkdir_write_enable=YES时，能建立目录<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;anon_other_write_enable=YES时，虚拟用户具体所有读写权限<br/><br/>虚拟用户目录的权限改为只能由vsftpdguest操作： <br/>chown vsftpdguest.vsftpdguest /home/vsftpdguest <br/>chmod 700 /home/vsftpdguest <br/><br/>五、虚拟用户拥有各自的家目录<br/>vi /etc/vsftpd/vsftpd.conf&nbsp;&nbsp;加上：<br/>user_config_dir=/etc/vsftpd/vsftpd_user_conf<br/>mkdir /etc/vsftpd/vsftpd_user_conf<br/>touch /etc/vsftpd/vsftpd_user_conf/aaa<br/>vi /etc/vsftpd/vsftpd_user_conf/aaa&nbsp;&nbsp; 加上：<br/>local_root=/home/aaa<br/>mkdir /home/aaa<br/>chown vsftpdguest.vsftpdguest /home/aaa<br/><br/>touch /etc/vsftpd/vsftpd_user_conf/bbb<br/>vi /etc/vsftpd/vsftpd_user_conf/aaa&nbsp;&nbsp;加上：<br/>local_root=/home/bbb<br/>mkdir /home/bbb<br/>chown vsftpdguest.vsftpdguest /home/bbb<br/><br/><br/>六、以上程序安装脚本：<br/><div class="code"><br/>#!bin/bash<br/>yum -y install vsftpd<br/>sed -i &#039;s#anonymous_enable=YES#anonymous_enable=NO#&#039;&nbsp;&nbsp;/etc/vsftpd/vsftpd.conf<br/>echo &quot;chroot_local_user=YES&quot; &gt;&gt;/etc/vsftpd/vsftpd.conf<br/>chkconfig vsftpd on<br/>service vsftpd start<br/>useradd vsftpdguest -d /home/vsftpdguest -s /sbin/nologin<br/>chmod 755 /home/vsftpdguest<br/>yum -y install mysql mysql-devel mysql-server<br/>service mysqld start<br/>mysqladmin -u root password 123654<br/>mysql -u root -p<br/>create database vsftpd; <br/>use vsftpd; <br/>create table users(name char(16) binary,passwd char(16) binary); <br/>insert into users (name,passwd) values (&#039;aaa&#039;,&#039;123456&#039;); <br/>insert into users (name,passwd) values (&#039;bbb&#039;,&#039;123654&#039;); <br/>grant select on vsftpd.users to vsftpdguest@localhost identified by &#039;654321&#039;; <br/>flush privileges;<br/>select * from users;<br/>quit;<br/>#pam_mysql文件上传在系统根目录<br/>cd /<br/>tar zxvf pam_mysql-0.7RC1.tar.gz<br/>cd pam_mysql-0.7RC1<br/>./configure<br/>make<br/>make install<br/>cp /usr/lib/security/pam_mysql.* /lib/security/<br/>mv /etc/pam.d/vsftpd /etc/pam.d/vsftpd.bak<br/>cat &gt;&gt;/etc/pam.d/vsftpd&lt;&lt;EOF<br/>#%PAM-1.0<br/>auth required /lib/security/pam_mysql.so user=vsftpdguest passwd=654321 host=localhost db=vsftpd table=users usercolumn=name passwdcolumn=passwd crypt=0<br/>account required /lib/security/pam_mysql.so user=vsftpdguest passwd=654321 host=localhost db=vsftpd table=users usercolumn=name passwdcolumn=passwd crypt=0 <br/>EOF<br/>echo &quot;guest_enable=YES&quot; &gt;&gt;/etc/vsftpd/vsftpd.conf<br/>echo &quot;guest_username=vsftpdguest&quot; &gt;&gt;/etc/vsftpd/vsftpd.conf<br/>echo &quot;virtual_use_local_privs=YES&quot; &gt;&gt;/etc/vsftpd/vsftpd.conf<br/>service vsftpd restart<br/>echo &quot;user_config_dir=/etc/vsftpd/vsftpd_user_conf&quot; &gt;&gt;/etc/vsftpd/vsftpd.conf<br/>mkdir /etc/vsftpd/vsftpd_user_conf<br/>touch /etc/vsftpd/vsftpd_user_conf/aaa<br/>echo &quot;local_root=/home/aaa&quot; &gt;&gt;/etc/vsftpd/vsftpd_user_conf/aaa<br/>mkdir /home/aaa<br/>chown vsftpdguest.vsftpdguest /home/aaa<br/>touch /etc/vsftpd/vsftpd_user_conf/bbb<br/>echo &quot;local_root=/home/bbb&quot; &gt;&gt;/etc/vsftpd/vsftpd_user_conf/bbb<br/>mkdir /home/bbb<br/>chown vsftpdguest.vsftpdguest /home/bbb<br/>service vsftpd restart<br/></div><br/>Tags - <a href="http://blog.gsywx.com/go.php/tags/vsftpd%25E8%2599%259A%25E6%258B%259F%25E7%2594%25A8%25E6%2588%25B7/" rel="tag">vsftpd虚拟用户</a>
]]>
</description>
</item>
</channel>
</rss>
