﻿<?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>Vi`blog · 唯音 &#187; √web</title>
	<atom:link href="http://www.viyin.net/category/web/feed" rel="self" type="application/rss+xml" />
	<link>http://www.viyin.net</link>
	<description>岂能尽如人意，但求无愧于心</description>
	<lastBuildDate>Mon, 14 Nov 2011 15:43:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>在Windows平台上升级MySQL步骤</title>
		<link>http://www.viyin.net/2010/11/mysqld-remove.html</link>
		<comments>http://www.viyin.net/2010/11/mysqld-remove.html#comments</comments>
		<pubDate>Tue, 16 Nov 2010 07:24:30 +0000</pubDate>
		<dc:creator>vi</dc:creator>
				<category><![CDATA[√linux]]></category>
		<category><![CDATA[√web]]></category>
		<category><![CDATA[√windows]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[mysql删除]]></category>
		<category><![CDATA[mysql升级]]></category>

		<guid isPermaLink="false">http://www.viyin.net/?p=1036</guid>
		<description><![CDATA[1.备份旧数据 2.停止旧服务器 3.从windows的系统服务中删掉mysql服务，用如下命令： C:\> C:\mysql\bin\mysqld &#8211;remove 4.用可执行安装文件方式安装mysql，或者解压可直接执行的二进制压缩包来安装 5.重新注册mysql服务，用如下命令： C:\> C:\mysql\bin\mysqld &#8211;install 6.重启服务器]]></description>
			<content:encoded><![CDATA[<p>1.备份旧数据<br />
2.停止旧服务器<br />
3.从windows的系统服务中删掉mysql服务，用如下命令：</p>
<p>C:\> C:\<a href="http://www.viyin.net/tag/mysql" class="st_tag internal_tag" rel="tag" title="标签 mysql 下的日志">mysql</a>\bin\mysqld &#8211;remove</p>
<p>4.用可执行安装文件方式安装mysql，或者解压可直接执行的二进制压缩包来安装<br />
5.重新注册mysql服务，用如下命令：</p>
<p>C:\> C:\mysql\bin\mysqld &#8211;install </p>
<p> 6.重启服务器</p>
]]></content:encoded>
			<wfw:commentRss>http://www.viyin.net/2010/11/mysqld-remove.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>nginx限制目录IP访问</title>
		<link>http://www.viyin.net/2010/06/nginx-ip-access.html</link>
		<comments>http://www.viyin.net/2010/06/nginx-ip-access.html#comments</comments>
		<pubDate>Sat, 26 Jun 2010 10:54:37 +0000</pubDate>
		<dc:creator>vi</dc:creator>
				<category><![CDATA[√nginx]]></category>
		<category><![CDATA[√web]]></category>
		<category><![CDATA[目录]]></category>
		<category><![CDATA[限制IP]]></category>

		<guid isPermaLink="false">http://www.viyin.net/?p=884</guid>
		<description><![CDATA[location ~ ^/phpmyadmin/ { allow 1.1.1.0/24; allow 2.2.2.2.2/32; deny all; index index.php index.do index.html index.htm; location ~ .*\.(php&#124;php5)?$ { fastcgi_pass unix:/tmp/php-cgi.sock; #fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fcgi.conf; } }]]></description>
			<content:encoded><![CDATA[<p> location ~ ^/phpmyadmin/ {<br />
                                allow 1.1.1.0/24;<br />
                                allow 2.2.2.2.2/32;<br />
                                deny all;<br />
                                index index.<a href="http://www.viyin.net/tag/php" class="st_tag internal_tag" rel="tag" title="标签 php 下的日志">php</a> index.do index.html index.htm;</p>
<p>              location ~ .*\.(php|php5)?$<br />
                        {<br />
                                fastcgi_pass  unix:/tmp/php-cgi.sock;<br />
                                #fastcgi_pass  127.0.0.1:9000;<br />
                                fastcgi_index index.php;<br />
                                include fcgi.conf;<br />
                        }<br />
                }</p>
]]></content:encoded>
			<wfw:commentRss>http://www.viyin.net/2010/06/nginx-ip-access.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>查看apache、mysql、php编译参数</title>
		<link>http://www.viyin.net/2010/06/apache-mysql-php.html</link>
		<comments>http://www.viyin.net/2010/06/apache-mysql-php.html#comments</comments>
		<pubDate>Sat, 19 Jun 2010 07:15:05 +0000</pubDate>
		<dc:creator>vi</dc:creator>
				<category><![CDATA[√linux]]></category>
		<category><![CDATA[√web]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.viyin.net/?p=880</guid>
		<description><![CDATA[apache编译参数： 通过编译安装文件夹下的cat config.status文件进行查看； 或到安装目录如/usr/local/apache2/build下的config.nice文件查看。 php编译参数： 直接通过命令：/usr/local/php/bin/php -i &#124;grep configure ； 或者通过编译安装文件夹下的cat config.nice文件进行查看； 或利用phpinfo()参数进行查看。 mysql编译参数： 直接通过命令：cat “/usr/local/mysql/bin/mysqlbug”&#124;grep configure ；]]></description>
			<content:encoded><![CDATA[<p>apache编译参数：</p>
<p>    通过编译安装文件夹下的cat config.status文件进行查看；</p>
<p>    或到安装目录如/usr/local/<a href="http://www.viyin.net/tag/apache" class="st_tag internal_tag" rel="tag" title="标签 apache 下的日志">apache</a>2/build下的config.nice文件查看。</p>
<p>php编译参数：</p>
<p>    直接通过命令：/usr/local/<a href="http://www.viyin.net/tag/php" class="st_tag internal_tag" rel="tag" title="标签 php 下的日志">php</a>/bin/<a href="http://www.viyin.net/tag/php" class="st_tag internal_tag" rel="tag" title="标签 php 下的日志">php</a> -i |grep configure ；</p>
<p>    或者通过编译安装文件夹下的cat config.nice文件进行查看；</p>
<p>    或利用phpinfo()参数进行查看。</p>
<p>mysql编译参数：</p>
<p>    直接通过命令：cat “/usr/local/<a href="http://www.viyin.net/tag/mysql" class="st_tag internal_tag" rel="tag" title="标签 mysql 下的日志">mysql</a>/bin/mysqlbug”|grep configure ；</p>
]]></content:encoded>
			<wfw:commentRss>http://www.viyin.net/2010/06/apache-mysql-php.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>nginx+fastcgi(11: Resource temporarily unavailable)</title>
		<link>http://www.viyin.net/2010/06/nginxfastcgi11-resource-temporarily-unavailable.html</link>
		<comments>http://www.viyin.net/2010/06/nginxfastcgi11-resource-temporarily-unavailable.html#comments</comments>
		<pubDate>Thu, 03 Jun 2010 09:00:42 +0000</pubDate>
		<dc:creator>vi</dc:creator>
				<category><![CDATA[√nginx]]></category>
		<category><![CDATA[√web]]></category>
		<category><![CDATA[502]]></category>
		<category><![CDATA[Resource temporarily unavailable]]></category>

		<guid isPermaLink="false">http://www.viyin.net/?p=848</guid>
		<description><![CDATA[connect() to unix:/tmp/php-cgi.sock failed (11: Resource temporarily unavailable) while connecting to upstream, PHP-FPM 配置文件中的： -1 改成： 1024 参考 http://forum.nginx.org/read.php?3,31467,31467]]></description>
			<content:encoded><![CDATA[<p>connect() to unix:/tmp/<a href="http://www.viyin.net/tag/php" class="st_tag internal_tag" rel="tag" title="标签 php 下的日志">php</a>-cgi.sock failed (11: <a href="http://www.viyin.net/tag/resource-temporarily-unavailable" class="st_tag internal_tag" rel="tag" title="标签 Resource temporarily unavailable 下的日志">Resource temporarily unavailable</a>) while connecting to upstream,</p>
<p>PHP-FPM 配置文件中的：</p>
<p><value name="backlog">-1</value><br />
改成：<br />
<value name="backlog">1024</value></p>
<p>参考</p>
<p>http://forum.nginx.org/read.php?3,31467,31467</p>
]]></content:encoded>
			<wfw:commentRss>http://www.viyin.net/2010/06/nginxfastcgi11-resource-temporarily-unavailable.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>nagios配置文件</title>
		<link>http://www.viyin.net/2010/05/nagios.html</link>
		<comments>http://www.viyin.net/2010/05/nagios.html#comments</comments>
		<pubDate>Mon, 31 May 2010 07:49:18 +0000</pubDate>
		<dc:creator>vi</dc:creator>
				<category><![CDATA[√linux]]></category>
		<category><![CDATA[√web]]></category>
		<category><![CDATA[nagios]]></category>
		<category><![CDATA[nagios配置]]></category>

		<guid isPermaLink="false">http://www.viyin.net/?p=842</guid>
		<description><![CDATA[个人觉得这东西太难搞了。尽管网上教程那么多。也请教了不少人。但我还是很艰难的才搞成。。 我太笨了…… nagios.cfg cfg_file=/usr/local/nagios/etc/objects/commands.cfg cfg_file=/usr/local/nagios/etc/objects/contacts.cfg cfg_file=/usr/local/nagios/etc/objects/timeperiods.cfg cfg_file=/usr/local/nagios/etc/objects/templates.cfg cfg_file=/usr/local/nagios/etc/objects/services.cfg cfg_file=/usr/local/nagios/etc/objects/hosts.cfg cfg_file=/usr/local/nagios/etc/objects/hostgroups.cfg cfg_file=/usr/local/nagios/etc/objects/contactgroups.cfg [root@moniter objects]# more contacts.cfg define contact{ contact_name vi; alias sys admin service_notification_period 24&#215;7 host_notification_period 24&#215;7 service_notification_options w,u,c,r host_notification_options d,u,r service_notification_commands notify-service-by-email host_notification_commands notify-host-by-email email viyin@yahoo.com pager 1391119xxxx } [root@moniter objects]# more contactgroups.cfg define contactgroup{ contactgroup_name vis; alias roots; members vi } [root@moniter objects]# more [...]]]></description>
			<content:encoded><![CDATA[<p>个人觉得这东西太难搞了。尽管网上教程那么多。也请教了不少人。但我还是很艰难的才搞成。。<br />
我太笨了……<br />
<a href="http://www.viyin.net/tag/nagios" class="st_tag internal_tag" rel="tag" title="标签 nagios 下的日志">nagios</a>.cfg<br />
cfg_file=/usr/local/nagios/etc/objects/commands.cfg<br />
cfg_file=/usr/local/nagios/etc/objects/contacts.cfg<br />
cfg_file=/usr/local/nagios/etc/objects/timeperiods.cfg<br />
cfg_file=/usr/local/nagios/etc/objects/templates.cfg<br />
cfg_file=/usr/local/nagios/etc/objects/services.cfg<br />
cfg_file=/usr/local/nagios/etc/objects/hosts.cfg<br />
cfg_file=/usr/local/nagios/etc/objects/hostgroups.cfg<br />
cfg_file=/usr/local/nagios/etc/objects/contactgroups.cfg</p>
<p>[root@moniter objects]# more contacts.cfg<br />
define contact{<br />
        contact_name   vi;<br />
        alias                           sys admin<br />
        service_notification_period     24&#215;7<br />
        host_notification_period        24&#215;7<br />
        service_notification_options    w,u,c,r<br />
        host_notification_options       d,u,r<br />
        service_notification_commands   notify-service-by-email<br />
        host_notification_commands      notify-host-by-email<br />
        email                           viyin@yahoo.com<br />
        pager                           1391119xxxx<br />
        } </p>
<p>[root@moniter objects]# more contactgroups.cfg<br />
define contactgroup{<br />
       contactgroup_name   vis;<br />
       alias               roots;<br />
       members             vi<br />
}</p>
<p>[root@moniter objects]# more hosts.cfg<br />
define host{<br />
#        use              host-pnp<br />
        host_name        viyin.net<br />
        alias            www<br />
        address          218.6.15.105<br />
        check_command    check-host-alive<br />
        max_check_attempts    3<br />
        check_period          24&#215;7<br />
        contact_groups        vis<br />
        notification_interval  10<br />
        notification_period   24&#215;7<br />
        notification_options            d,u,r<br />
}<br />
[root@moniter objects]# more hostgroups.cfg<br />
define hostgroup{<br />
        hostgroup_name          linux-servers<br />
        alias                   linux-servers<br />
        members                viyin.net<br />
}</p>
<p>[root@moniter objects]# more services.cfg<br />
define service{<br />
   #     use                     srv-pnp<br />
        host_name    viyin.net<br />
        service_description     Current Users<br />
        check_command           check_local_users!20!50<br />
        max_check_attempts      3<br />
        normal_check_interval   3<br />
        retry_check_interval    1<br />
        check_period            24&#215;7<br />
        notification_interval   10<br />
        notification_period     24&#215;7<br />
        notification_options    w,u,c,r<br />
        contact_groups          vis<br />
}</p>
]]></content:encoded>
			<wfw:commentRss>http://www.viyin.net/2010/05/nagios.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>nginx反向代理discuz设置</title>
		<link>http://www.viyin.net/2010/05/nginx-discuz.html</link>
		<comments>http://www.viyin.net/2010/05/nginx-discuz.html#comments</comments>
		<pubDate>Thu, 06 May 2010 02:08:51 +0000</pubDate>
		<dc:creator>vi</dc:creator>
				<category><![CDATA[√web]]></category>
		<category><![CDATA[nginx.discuz]]></category>
		<category><![CDATA[proxy]]></category>

		<guid isPermaLink="false">http://www.viyin.net/?p=801</guid>
		<description><![CDATA[ip 1.1.1.1:80 -> 1.1.1.2:8080 ->1.1.1.2:80 1.1.1.1 nginx文件配置 server { listen 80; server_name www.viyin.net; index index.html index.htm index.php default.html default.htm de fault.php; location / { proxy_pass http://1.1.1.2:8080/; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass_header User-Agent; proxy_set_header Host $host; # 转发host的信息，如果不设置host,在后台使用request.getServerName()取到的域名不是www.viyin.net，而是127.0.0.1 # 因Discuz! 为了安全，需要获取客户端User-Agent来判断每次POST数据是否跟第一次请求来自同1个浏览器， # 如果不转发User-Agent,Discuz! 提交数据就会报”您的请求来路不正确，无法提交”的错误 } location /bbs/ { proxy_pass http://1.1.1.2:8080/bbs/; proxy_redirect off; [...]]]></description>
			<content:encoded><![CDATA[<p>ip 1.1.1.1:80 -> 1.1.1.2:8080 ->1.1.1.2:80</p>
<p>1.1.1.1<br />
nginx文件配置</p>
<p>server<br />
        {<br />
                listen       80;<br />
                server_name www.viyin.net;<br />
                index index.html index.htm index.<a href="http://www.viyin.net/tag/php" class="st_tag internal_tag" rel="tag" title="标签 php 下的日志">php</a> default.html default.htm de<br />
fault.php;</p>
<p>location / {<br />
         <a href="http://www.viyin.net/tag/proxy" class="st_tag internal_tag" rel="tag" title="标签 proxy 下的日志">proxy</a>_pass              http://1.1.1.2:8080/;<br />
         proxy_redirect          off;<br />
         proxy_set_header        X-Real-IP       $remote_addr;<br />
         proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;<br />
         proxy_pass_header User-Agent;<br />
        proxy_set_header Host $host;<br />
       # 转发host的信息，如果不设置host,在后台使用request.getServerName()取到的域名不是www.viyin.net，而是127.0.0.1<br />
    # 因Discuz! 为了安全，需要获取客户端User-Agent来判断每次POST数据是否跟第一次请求来自同1个浏览器，<br />
   # 如果不转发User-Agent,Discuz! 提交数据就会报”您的请求来路不正确，无法提交”的错误</p>
<p>}<br />
location /bbs/ {</p>
<p>         proxy_pass              http://1.1.1.2:8080/bbs/;<br />
         proxy_redirect          off;<br />
         proxy_set_header        X-Real-IP       $remote_addr;<br />
         proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;<br />
         proxy_pass_header User-Agent;<br />
        proxy_set_header Host $host;<br />
        }</p>
<p>1.1.1.2</p>
<p>location ~ \.php$ {<br />
 proxy_pass   http://127.0.0.1:81;<br />
proxy_redirect off;<br />
#proxy_set_header Host $proxy_host;<br />
proxy_pass_header User-Agent;<br />
proxy_set_header Host $host;<br />
#proxy_set_header X-Real-IP $remote_addr;<br />
#proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;<br />
#proxy_hide_header Content-Type;   </p>
]]></content:encoded>
			<wfw:commentRss>http://www.viyin.net/2010/05/nginx-discuz.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>nginx权限控制</title>
		<link>http://www.viyin.net/2010/05/nginx-2.html</link>
		<comments>http://www.viyin.net/2010/05/nginx-2.html#comments</comments>
		<pubDate>Wed, 05 May 2010 06:20:29 +0000</pubDate>
		<dc:creator>vi</dc:creator>
				<category><![CDATA[√web]]></category>
		<category><![CDATA[nginx权限]]></category>
		<category><![CDATA[√nginx]]></category>

		<guid isPermaLink="false">http://www.viyin.net/?p=793</guid>
		<description><![CDATA[1、用低权限账号运行Nginx。例www 2、在php.ini中禁用危险的函数。如：system,passthru,shell_exec,exec,popen,proc_open,chroot,scandir,chgrp,chown等，但禁止太多的函数可能对某些php程序的正常运行产生影响。 3、在php.ini中设置open_basedir,如：open_basedir = “/usr/local/webserver/nginx/html/www.xpb.cn_7da347bc1a9fd621/:/usr/local/webserver/nginx/html/viyin.cn_7da347bc1a9fd621/” 4、禁止目录遍历，各个虚拟主机用户放在不易于猜到的目录，如：www.viyin.net_7da347bc1a9fd621、viyin.cn_7da347bc1a9fd621 5、自己找一个php木马，自我测试服务器安全！]]></description>
			<content:encoded><![CDATA[<p>1、用低权限账号运行Nginx。例www</p>
<p>2、在php.ini中禁用危险的函数。如：system,passthru,shell_exec,exec,popen,proc_open,chroot,scandir,chgrp,chown等，但禁止太多的函数可能对某些php程序的正常运行产生影响。</p>
<p>3、在php.ini中设置open_basedir,如：open_basedir = “/usr/local/webserver/nginx/html/www.xpb.cn_7da347bc1a9fd621/:/usr/local/webserver/nginx/html/viyin.cn_7da347bc1a9fd621/”</p>
<p>4、禁止目录遍历，各个虚拟主机用户放在不易于猜到的目录，如：www.viyin.net_7da347bc1a9fd621、viyin.cn_7da347bc1a9fd621</p>
<p>5、自己找一个php木马，自我测试服务器安全！</p>
]]></content:encoded>
			<wfw:commentRss>http://www.viyin.net/2010/05/nginx-2.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>freebsd下apache+nginx+php+mysql+eaccelerator+memcache安装配置</title>
		<link>http://www.viyin.net/2010/04/freebsdapachenginxphpmysqleacceleratormemcache.html</link>
		<comments>http://www.viyin.net/2010/04/freebsdapachenginxphpmysqleacceleratormemcache.html#comments</comments>
		<pubDate>Mon, 19 Apr 2010 07:15:02 +0000</pubDate>
		<dc:creator>vi</dc:creator>
				<category><![CDATA[√freebsd]]></category>
		<category><![CDATA[√linux]]></category>
		<category><![CDATA[√web]]></category>
		<category><![CDATA[√个人碎语]]></category>
		<category><![CDATA[√历史]]></category>
		<category><![CDATA[√思科华为]]></category>
		<category><![CDATA[√文章精选]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[eaccelerator]]></category>
		<category><![CDATA[famp]]></category>
		<category><![CDATA[freebsd]]></category>
		<category><![CDATA[memcache]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[√nginx]]></category>

		<guid isPermaLink="false">http://www.viyin.net/?p=769</guid>
		<description><![CDATA[freebsd下apache+nginx+php+mysql+eaccelerator+memcache安装配置 太长了。到后面没那么细心了。直接复制粘贴上来。就不加说明了。 1.安装apache bsd1# pwd /usr/ports/www/apache22 bsd1# make install clean 2.安装MYSQL ./configure &#8211;prefix=/usr/local/mysql &#8211;enable-assembler &#8211;with-charset=utf8 &#8211;enable-thread-safe-client &#8211;with-extra-charsets=all &#8211;with-big-tables &#8211;with-readline &#8211;with-ssl &#8211;with-embedded-server &#8211;enable-local-infile &#8211;with-plugins=innobase make -j 5 make install groupadd mysql useradd -g mysql mysql cp /usr/local/mysql/share/mysql/my-medium.cnf /etc/my.cnf /usr/local/mysql/bin/mysql_install_db &#8211;user=mysql chown -R mysql /usr/local/mysql/var chgrp -R mysql /usr/local/mysql/. cp /usr/local/mysql/share/mysql/mysql.server /etc/init.d/mysql chmod 755 /etc/init.d/mysql 这是linux的安装命令。BSD照着改一下 2.安装PHP [...]]]></description>
			<content:encoded><![CDATA[<p>freebsd下apache+nginx+<a href="http://www.viyin.net/tag/php" class="st_tag internal_tag" rel="tag" title="标签 php 下的日志">php</a>+<a href="http://www.viyin.net/tag/mysql" class="st_tag internal_tag" rel="tag" title="标签 mysql 下的日志">mysql</a>+<a href="http://www.viyin.net/tag/eaccelerator" class="st_tag internal_tag" rel="tag" title="标签 eaccelerator 下的日志">eaccelerator</a>+memcache安装配置<br />
太长了。到后面没那么细心了。直接复制粘贴上来。就不加说明了。<br />
1.安装apache</p>
<p>bsd1# pwd<br />
/usr/ports/www/<a href="http://www.viyin.net/tag/apache" class="st_tag internal_tag" rel="tag" title="标签 apache 下的日志">apache</a>22<br />
bsd1# make install clean</p>
<p>2.安装MYSQL<br />
./configure &#8211;prefix=/usr/local/mysql &#8211;enable-assembler &#8211;with-charset=utf8 &#8211;enable-thread-safe-client &#8211;with-extra-charsets=all &#8211;with-big-tables &#8211;with-readline &#8211;with-ssl &#8211;with-embedded-server &#8211;enable-local-infile &#8211;with-plugins=innobase</p>
<p>make -j 5<br />
make install<br />
groupadd mysql<br />
useradd -g mysql mysql<br />
cp /usr/local/mysql/share/mysql/my-medium.cnf /etc/my.cnf<br />
/usr/local/mysql/bin/mysql_install_db &#8211;user=mysql<br />
chown -R mysql /usr/local/mysql/var<br />
chgrp -R mysql /usr/local/mysql/.<br />
cp /usr/local/mysql/share/mysql/mysql.server /etc/init.d/mysql<br />
chmod 755 /etc/init.d/mysql<br />
这是linux的安装命令。BSD照着改一下</p>
<p>2.安装PHP<br />
先装组件jpeg，libpng，freetype，zlib，gd，curl，libxml2，libxslt，libmcrypt<br />
pkg_add -r gd<br />
pkg_add -r freetype<br />
pkg_add -r curl<br />
pkg_add -r libxml2<br />
pkg_add -r libxslt<br />
pkg_add -r libmcrypt<br />
pkg_add -r mhash<br />
./configure  &#8211;prefix=/usr/local/php &#8211;with-config-file-path=/etc &#8211;with-apxs2=/usr/local/sbin/apxs &#8211;with-mysql=/usr/local/mysql &#8211;with-mysqli=/usr/local/mysql/bin/mysql_config &#8211;with-iconv-dir &#8211;with-freetype-dir &#8211;with-jpeg-dir &#8211;with-png-dir &#8211;with-zlib &#8211;with-libxml-dir &#8211;enable-xml &#8211;disable-rpath &#8211;enable-discard-path &#8211;enable-magic-quotes &#8211;enable-safe-mode &#8211;enable-bcmath &#8211;enable-shmop &#8211;enable-sysvsem &#8211;enable-inline-optimization &#8211;with-curl &#8211;with-curlwrappers &#8211;enable-mbregex &#8211;enable-force-cgi-redirect &#8211;enable-mbstring &#8211;with-mcrypt &#8211;enable-ftp &#8211;with-gd &#8211;enable-gd-native-ttf &#8211;with-openssl &#8211;with-mhash &#8211;enable-pcntl &#8211;enable-sockets &#8211;with-xmlrpc &#8211;enable-zip &#8211;enable-soap &#8211;without-pear &#8211;with-gettext &#8211;with-mime-magic &#8211;enable-suhosin<br />
make &#038;&#038;make install<br />
cp php.ini-dist /etc/php.ini<br />
<span id="more-769"></span></p>
<p>http://www.viyin.net</p>
<p>vi httpd.conf<br />
AddType application/x-httpd-php .php</p>
<p>3.安装PHP扩展<br />
tar zxvf <a href="http://www.viyin.net/tag/memcache" class="st_tag internal_tag" rel="tag" title="标签 memcache 下的日志">memcache</a>-2.2.5.tgz<br />
cd memcache-2.2.5/<br />
/usr/local/php/bin/phpize<br />
./configure &#8211;with-php-config=/usr/local/php/bin/php-config<br />
make &#038;&#038; make install</p>
<p>tar zxvf PDO_MYSQL-1.0.2.tgz<br />
cd PDO_MYSQL-1.0.2/<br />
/usr/local/php/bin/phpize<br />
./configure &#8211;with-php-config=/usr/local/php/bin/php-config &#8211;with-pdo-mysql=/usr/local/mysql<br />
make<br />
make install</p>
<p>tar jxvf eaccelerator-0.9.5.3.tar.bz2<br />
cd eaccelerator-0.9.5.3/<br />
/usr/local/php/bin/phpize<br />
./configure &#8211;enable-eaccelerator=shared &#8211;with-php-config=/usr/local/php/bin/php-config &#8211;with-eaccelerator-shared-memory<br />
make<br />
make install<br />
mkdir -p /usr/local/eaccelerator_cache<br />
cat >>/etc/php.ini<<EOF<br />
[eaccelerator]<br />
zend_extension="/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/eaccelerator.so"<br />
eaccelerator.shm_size="1"<br />
eaccelerator.cache_dir="/usr/local/eaccelerator_cache"<br />
eaccelerator.enable="1"<br />
eaccelerator.optimizer="1"<br />
eaccelerator.check_mtime="1"<br />
eaccelerator.debug="0"<br />
eaccelerator.filter=""<br />
eaccelerator.shm_max="0"<br />
eaccelerator.shm_ttl="3600"<br />
eaccelerator.shm_prune_period="3600"<br />
eaccelerator.shm_only="0"<br />
eaccelerator.compress="1"<br />
eaccelerator.compress_level="9"<br />
eaccelerator.keys = "disk_only"<br />
eaccelerator.sessions = "disk_only"<br />
eaccelerator.content = "disk_only"<br />
EOF</p>
<p>fetch http://www.viyin.net/vi/web/ZendOptimizer-3.3.9-linux-glibc23-x86_64.tar.gz<br />
tar zxvf ZendOptimizer-3.3.9-linux-glibc23-x86_64.tar.gz<br />
mkdir -p /usr/local/zend/<br />
cp ZendOptimizer-3.3.9-linux-glibc23-x86_64/data/5_2_x_comp/ZendOptimizer.so /usr/local/zend/</p>
<p>cat >>/etc/php.ini<<EOF<br />
[Zend Optimizer]<br />
zend_optimizer.optimization_level=1<br />
zend_extension="/usr/local/zend/ZendOptimizer.so"<br />
EOF</p>
<p>修改php.ini文件<br />
　　手工修改：查找/etc/php.ini中的extension_dir = "./"<br />
　　修改为extension_dir = "/usr/local/bin/php/lib/php/extensions/no-debug-non-zts-20060613/"<br />
　　并在此行后增加以下几行，然后保存：<br />
　　extension = "memcache.so"<br />
　　extension = "pdo_mysql.so"<br />
　　再查找output_buffering = Off<br />
　　修改为output_buffering = On</p>
<p>sed -i 's#extension_dir = "./"#extension_dir = "/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/"\nextension = "memcache.so"\nextension = "pdo_mysql.so"\n#' /etc/php.ini<br />
sed -i 's#output_buffering = Off#output_buffering = On#' /etc/php.ini<br />
sed -i 's/post_max_size = 8M/post_max_size = 50M/g' /etc/php.ini<br />
sed -i 's/upload_max_filesize = 2M/upload_max_filesize = 50M/g' /etc/php.ini<br />
sed -i 's/;date.timezone =/date.timezone = PRC/g' /etc/php.ini</p>
<p>nginx配置<br />
./configure --user=www --group=www --prefix=/usr/local/nginx  --without-http_rewrite_module  --with-http_realip_module   --with-http_stub_status_module --with-http_ssl_module --with-pcre<br />
make<br />
make install</p>
<p>修改nginx.conf<br />
转发PHP请求到本地的81端口,让Apache处理.<br />
location ~ \.php$ {<br />
            <a href="http://www.viyin.net/tag/proxy" class="st_tag internal_tag" rel="tag" title="标签 proxy 下的日志">proxy</a>_pass   http://127.0.0.1:81;<br />
            proxy_redirect off;<br />
            proxy_set_header Host $host;<br />
            proxy_set_header X-Real-IP $remote_addr;<br />
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;<br />
            proxy_hide_header Content-Type;</p>
<p>        }</p>
<p>bsd1# cat nginx.conf</p>
<p>user  www www;<br />
worker_processes  4;</p>
<p>http://viyin.net</p>
<p>error_log  logs/nginx_error.log  crit;</p>
<p>pid /usr/local/nginx/logs/nginx.pid;</p>
<p>worker_rlimit_nofile 65535;</p>
<p>events {<br />
    use kqueue;<br />
    worker_connections  65535;<br />
}</p>
<p>http {<br />
                include       mime.types;<br />
                default_type  application/octet-stream;</p>
<p>                server_names_hash_bucket_size 128;<br />
                client_header_buffer_size 32k;<br />
                large_client_header_buffers 4 32k;<br />
                client_max_body_size 8m;</p>
<p>                sendfile on;<br />
                tcp_nopush     on;</p>
<p>                keepalive_timeout 60;</p>
<p>                tcp_nodelay on;</p>
<p>                server_tokens off;<br />
                fastcgi_connect_timeout 300;<br />
                fastcgi_send_timeout 300;<br />
                fastcgi_read_timeout 300;<br />
                fastcgi_buffer_size 64k;<br />
                fastcgi_buffers 4 64k;<br />
                fastcgi_busy_buffers_size 128k;<br />
                fastcgi_temp_file_write_size 256k;</p>
<p>                gzip on;<br />
                gzip_min_length  1k;<br />
                gzip_buffers     4 16k;<br />
                gzip_http_version 1.0;<br />
                gzip_comp_level 2;<br />
                gzip_types       text/plain application/x-javascript text/css application/xml;<br />
                gzip_vary on;</p>
<p>    server {<br />
        listen       80;<br />
        server_name  lwww.viyin.net viyin.net;<br />
        #access_log  logs/host.access.log  main;</p>
<p>        index index.html index.htm index.php;<br />
        root  /usr/www/viyin.net;</p>
<p>        location ~ \.php$ {<br />
            proxy_pass   http://127.0.0.1:81;<br />
            proxy_redirect off;<br />
            proxy_set_header Host $host;<br />
            proxy_set_header X-Real-IP $remote_addr;<br />
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;<br />
            proxy_hide_header Content-Type;   </p>
<p>        }<br />
    }</p>
<p>include server/*.conf;<br />
}</p>
<p>编辑httpd.conf 。去掉#号<br />
# Virtual hosts<br />
Include etc/apache22/extra/httpd-vhosts.conf </p>
<p>编辑httpd-vhosts.conf ，绑上与nginx.conf相对应的目录和域名</p>
<p><VirtualHost *:81><br />
    ServerAdmin vi@viyin.net<br />
    DocumentRoot “/usr/www/viyin.net”<br />
    ServerName www.viyin.net<br />
    ServerAlias viyin.net<br />
#    ErrorLog “/var/log/dummy-host.example.com-error_log”<br />
#    CustomLog “/var/log/dummy-host.example.com-access_log” common<br />
</VirtualHost><br />
<Directory "/usr/www/viyin.net"></p>
<p>Options FollowSymLinks</p>
<p>AllowOverride All</p>
<p>Order allow,deny</p>
<p>Allow from all</p>
<p></Directory><br />
apache开启的模块<br />
LoadModule authz_host_module modules/mod_authz_host.so<br />
LoadModule access_module libexec/apache2/mod_access.so<br />
LoadModule setenvif_module libexec/apache2/mod_setenvif.so<br />
LoadModule mime_module libexec/apache2/mod_mime.so<br />
LoadModule autoindex_module libexec/apache2/mod_autoindex.so<br />
LoadModule negotiation_module libexec/apache2/mod_negotiation.so<br />
LoadModule alias_module libexec/apache2/mod_alias.so<br />
LoadModule rewrite_module libexec/apache2/mod_rewrite.so<br />
LoadModule php5_module libexec/apache2/libphp5.so</p>
<p>操！！！！终于结束了！！！！！！！</p>
]]></content:encoded>
			<wfw:commentRss>http://www.viyin.net/2010/04/freebsdapachenginxphpmysqleacceleratormemcache.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>nginx 404 php页面</title>
		<link>http://www.viyin.net/2010/04/nginx-404-php.html</link>
		<comments>http://www.viyin.net/2010/04/nginx-404-php.html#comments</comments>
		<pubDate>Sat, 10 Apr 2010 09:46:06 +0000</pubDate>
		<dc:creator>vi</dc:creator>
				<category><![CDATA[√linux]]></category>
		<category><![CDATA[√web]]></category>
		<category><![CDATA[√文章精选]]></category>
		<category><![CDATA[404]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[√nginx]]></category>

		<guid isPermaLink="false">http://www.viyin.net/?p=753</guid>
		<description><![CDATA[配置文件中增加 fastcgi_intercept_errors on;]]></description>
			<content:encoded><![CDATA[<p>配置文件中增加<br />
fastcgi_intercept_errors on;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.viyin.net/2010/04/nginx-404-php.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>svn安装配置,post-commit同步</title>
		<link>http://www.viyin.net/2010/04/svn-post-commit.html</link>
		<comments>http://www.viyin.net/2010/04/svn-post-commit.html#comments</comments>
		<pubDate>Sat, 03 Apr 2010 05:56:57 +0000</pubDate>
		<dc:creator>vi</dc:creator>
				<category><![CDATA[√linux]]></category>
		<category><![CDATA[√web]]></category>
		<category><![CDATA[√文章精选]]></category>
		<category><![CDATA[lamp]]></category>
		<category><![CDATA[mod_authz_svn.so]]></category>
		<category><![CDATA[mod_dav_svn.so]]></category>
		<category><![CDATA[post-commit]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://www.viyin.net/?p=731</guid>
		<description><![CDATA[1.搭建lamp yum install  httpd httpd-devel mysql-server php php-devel php-mysql 2.yum安装svn及所需模块  yum install httpd subversion mod_dav_svn mod_auth_mysql centos默认源的SVN版本较老。1.4.2的。yum前。换一个源。（参考：RedHat和CentOs系统下的第三方软件仓库） 3.查看版本 [root@abc100 ~]# svn &#8211;version svn, version 1.6.9 (r901367) compiled Mar 22 2010, 00:59:50 Copyright (C) 2000-2009 CollabNet. Subversion is open source software, see http://subversion.tigris.org/ This product includes software developed by CollabNet (http://www.Collab.Net/). The following repository access (RA) [...]]]></description>
			<content:encoded><![CDATA[<p>1.搭建lamp<br />
yum install  httpd httpd-devel  <a href="http://www.viyin.net/tag/mysql" class="st_tag internal_tag" rel="tag" title="标签 mysql 下的日志">mysql</a>-server <a href="http://www.viyin.net/tag/php" class="st_tag internal_tag" rel="tag" title="标签 php 下的日志">php</a> php-devel <a href="http://www.viyin.net/tag/php" class="st_tag internal_tag" rel="tag" title="标签 php 下的日志">php</a>-mysql<br />
2.yum安装svn及所需模块<br />
 yum install httpd subversion mod_dav_<a href="http://www.viyin.net/tag/svn" class="st_tag internal_tag" rel="tag" title="标签 svn 下的日志">svn</a> mod_auth_mysql<br />
centos默认源的SVN版本较老。1.4.2的。yum前。换一个源。（参考：<a href="http://www.viyin.net/2009/06/centos-yum.html">RedHat和CentOs系统下的第三方软件仓库</a>）<br />
3.查看版本<br />
[root@abc100 ~]# svn &#8211;version<br />
svn, version 1.6.9 (r901367)<br />
   compiled Mar 22 2010, 00:59:50</p>
<p>Copyright (C) 2000-2009 CollabNet.<br />
Subversion is open source software, see http://subversion.tigris.org/<br />
This product includes software developed by CollabNet (http://www.Collab.Net/).</p>
<p>The following repository access (RA) modules are available:</p>
<p>* ra_neon : Module for accessing a repository via WebDAV protocol using Neon.<br />
  &#8211; handles &#8216;http&#8217; scheme<br />
  &#8211; handles &#8216;https&#8217; scheme<br />
* ra_svn : Module for accessing a repository using the svn network protocol.<br />
  &#8211; with Cyrus SASL authentication<br />
  &#8211; handles &#8216;svn&#8217; scheme<br />
* ra_local : Module for accessing a repository on local disk.<br />
  &#8211; handles &#8216;file&#8217; scheme<br />
4.确认已安装模块<br />
[root@abc100 modules]# pwd<br />
/etc/httpd/modules<br />
[root@abc100 modules]# ls |grep svn<br />
<a href="http://www.viyin.net/tag/mod_authz_svn-so" class="st_tag internal_tag" rel="tag" title="标签 mod_authz_svn.so 下的日志">mod_authz_svn.so</a><br />
<a href="http://www.viyin.net/tag/mod_dav_svn-so" class="st_tag internal_tag" rel="tag" title="标签 mod_dav_svn.so 下的日志">mod_dav_svn.so</a></p>
<p>5.修改httpd.conf配置文件，载入模块<br />
增加</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">LoadModule dav_svn_module&nbsp; &nbsp; &nbsp;modules/mod_dav_svn.so</li>
<li>LoadModule authz_svn_module&nbsp; &nbsp;modules/mod_authz_svn.so</li>
<li>LoadModule php5_module modules/libphp5.so</li></ol></div>
<p>6.配置SVN</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">[root@abc100 conf.d]# pwd</li>
<li>/etc/httpd/conf.d</li>
<li>[root@abc100 conf.d]# vi subversion.conf</li>
<li>&nbsp;</li>
<li>&lt;Location /svn&gt;</li>
<li>DAV svn</li>
<li>SVNPath /var/www/testsvn/</li>
<li>AuthType Basic</li>
<li>AuthName &quot;Authorization Realm&quot;</li>
<li>AuthUserFile /var/www/testsvn/passwd</li>
<li>Require valid-user</li>
<li>&lt;/Location&gt;</li></ol></div>
<p>7.创建SVN版本库<br />
svnadmin create /var/www/testsvn/<br />
chown <a href="http://www.viyin.net/tag/apache" class="st_tag internal_tag" rel="tag" title="标签 apache 下的日志">apache</a>.apache /var/www/testsvn/ -R<br />
8.增加用户名密码验证<br />
htpasswd -c /var/www/testsvn/passwd viyin.net</p>
<p>重启apahce后看效果。</p>
<p>8.<a href="http://www.viyin.net/tag/post-commit" class="st_tag internal_tag" rel="tag" title="标签 post-commit 下的日志">post-commit</a>(利用SVN的钩子post-commit同步测试服务器代码)</p>
<p>[root@abc100 hooks]# pwd<br />
/var/www/testsvn/hooks</p>
<p>cp post-commit.tmpl post-commit<br />
chown apache.apache post-commit </p>
<p>修改post-commint</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">export LANG=&quot;en_US.UTF-8&quot;</li>
<li>svn up /var/www/html/viyin.net/</li></ol></div>
<p>chmod a+x post-commit </p>
<p>chown -R apache.apache /var/www/html/viyin.net (确保web目录能访问，否则post-commit不会正常工作)</p>
<p>svn co file:///var/www/svn4/ /var/www/0519 检出 </p>
]]></content:encoded>
			<wfw:commentRss>http://www.viyin.net/2010/04/svn-post-commit.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

