<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[BIWEB开源PHP WMS系统创始人ArthurXF肖飞的blog]]></title> 
<link>http://www.bizeway.net/index.php</link> 
<description><![CDATA[网务通 - 网务公司发展之路]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[BIWEB开源PHP WMS系统创始人ArthurXF肖飞的blog]]></copyright>
<item>
<link>http://www.bizeway.net/read.php?</link>
<title><![CDATA[跟着ArthurXF学FreeBSD36——ports安装apache+mysql+php]]></title> 
<author>ArthurXF &lt;arthurxf@gmail.com&gt;</author>
<category><![CDATA[FreeBSD]]></category>
<pubDate>Wed, 02 Jan 2008 07:42:41 +0000</pubDate> 
<guid>http://www.bizeway.net/read.php?</guid> 
<description>
<![CDATA[ 
	　　很多朋友不太习惯使用集成包安装，都来问我一些用ports安装apache+mysql+php的问题，我这里就重新写一篇文章，来解决这些问题。此文章由ArthurXF倾情奉献，谢谢支持。<br/><br/>一、安装mysql51 <br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content">先添加mysql组和mysql用户<br/>pw addgroup mysql<br/>pw adduser mysql<br/><br/>开始安装<br/>cd /usr/ports/databases/mysql51-server/ <br/>make <br/>make thread-safe-client=enable dtrace=disable assembler=enable with_big_tables=yes with_embedded_server=yes with_local_infile=yes with_plugins=partition,innobase,myisammrg WITH_CHARSET=utf8 WITH_XCHARSET=all WITH_COLLATION=utf8_general_ci WITH_PROC_SCOPE_PTH=yes BUILD_OPTIMIZED=yes BUILD_STATIC=yes SKIP_DNS_CHECK=yes install clean &nbsp;// 设定编码字符集为utf-8<br/>cp /usr/local/share/mysql/my-large.cnf /etc/my.cnf <br/>//服务器内存1G，但是与apache在一起/usr/local/share/mysql下面有5个my-xxxx.cnf文件<br/><div class="code">my-small.cnf &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 最小配置安装，内存&lt;=64M，数据数量最少<br/>my-medium.cnf &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 32M&lt;内存&lt;64M，或者内存有128M，但是数据库与web服务器公用内存<br/>my-large.cnf &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 内存=512M<br/>my-huge.cnf &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 1G&lt;内存&lt;2G，服务器主要运行mysql<br/>my-innodb-heavy-4G.cnf &nbsp; innodb格式数据大于4G的</div><br/><br/>因为如果你安装系统的时候默认分配空间的话/var一般的空间比例很小，也就3G，对于大数据库的话，肯定是不够用的，所以我们这里把数据库搬到/usr去，一般/usr的空间都是最大的，这样可以保证数据库空间充足。<br/>搬mysql数据库需要操作下面的命令，如果不搬这个可以跳过。本文适合最新的FreeBSD6.2，其他版本可能文件名会有变化，请自行查找<br/>vi /etc/rc.conf<br/>增加<br/>mysql_dbdir="/usr/local/db/mysql"<br/>重起服务器，再执行下面的命令。<br/>cd &nbsp;/usr/local<br/>mysql_install_db --user=mysql --datadir=/usr/local/db/mysql/data #建立数据库目录<br/>mysqld_safe & #启动mysql<br/></div></div><br/><br/>二、安装apache22+php5<br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content">#cd /usr/ports/www/apache22/ <br/>选择你需要安装的模块<br/>#make config<br/>如果你的服务器是多个CPU的，可以把Apache以worker模式运行，则需要修改Makefile文件。<br/># ee Makefile<br/>将WITH_MPM?= &nbsp; &nbsp; &nbsp;prefork # or worker, event, itk改成：<br/>WITH_MPM?= &nbsp; &nbsp; &nbsp;worker # or worker, event, itk<br/>开始安装了<br/># make install clean<br/><br/>安装php5<br/>cd /usr/ports/lang/php5/<br/>make config #选择php的模块,一定要选择apache module，否则不会自动安装到apahce里面的，那样php就不会执行的。<br/>make<br/>make install clean<br/><br/>安装php5-extensions<br/>cd /usr/ports/lang/php5-extensions/<br/>make config #选择php的扩展模块<br/>make<br/>make install clean<br/><br/>配置/usr/local/etc/apache/httpd.conf：<br/>修改<br/><IfModule dir_module><br/> &nbsp; &nbsp;DirectoryIndex index.html index.htm index index.php index.phps<br/></IfModule><br/><br/>如果你需要修改网站根目录，就修改下面两个地方，下面仅仅是个例子，大家可根据需要自行修改，确保一致即可。<br/>DocumentRoot "/usr/local/www/web"<br/><Directory "/usr/local/www/web"><br/> &nbsp;Options Indexes FollowSymLinks<br/>去掉Indexes可以限制浏览你的主页目录<br/><br/>加入<br/>AddType application/x-httpd-php .php <br/>AddType application/x-httpd-php-source .phps #可不加 <br/>*注意：第二行主要为查看php代码用，加上的话web目录下的所有扩展名为.phps的文件在被浏览器访问时都显示其源代码<br/><br/>配置/usr/local/etc/php.ini：<br/>cd /usr/local/etc/<br/>cp php.ini-recommended php.ini<br/>vi php.ini<br/>在error_reporting &nbsp;= &nbsp;E_ALL前面加上;<br/>将error_reporting = E_ALL & ~E_NOTICE前面的;去掉<br/>*将报错信息设置改成去掉notice<br/><br/>upload_max_filesize = 2M<br/>上传最大文件尺寸可根据需要修改<br/><br/>date.timezone = CST<br/>设置服务器时区为中国的时区<br/><br/><br/>apachectl start <br/>echo "<?php phpinfo() ?>" > /usr/loacl/www/data/info.php <br/>可能你的apache启动的时候和我一样会报这样的错误：<br/>[Wed Jan 02 19:54:30 2008] [warn] (2)No such file or directory: Failed to enable the 'httpready' Accept Filter<br/><br/>解决这个错误，执行如下操作：<br/>kldload accf_http<br/>grep accf /boot/defaults/loader.conf<br/>显示内容如下<br/>accf_data_load="NO" # Wait for data accept filter<br/>accf_http_load="NO" # Wait for full HTTP request accept filter #将这个"NO"改成"YES"<br/>vi /boot/defaults/loader.conf<br/>找到Other modules 就可以找到accf_http_load了。<br/><br/>访问http://服务器的IP/info.php，如果有php的说明文件说明基本的php+apache2已经工作正常！ <br/><br/>开机后自动启动：<br/>echo 'mysql_enable="YES" ' >> /etc/rc.conf <br/>echo 'apache22_enable="YES" ' >> /etc/rc.conf <br/>以便开机后自动启动mysql apache<br/>如果启动不了，就执行下面的命令<br/>cp /usr/local/share/mysql/mysql.server /usr/local/etc/rc.d/mysql.sh<br/>这样mysql就可以自动执行了。</div></div><br/>以上文章是由ArthurXF倾情奉献，谢谢支持！<br/><br/>现在ArthurXF本人正在搞PHP等技术培训，如果想学习的人可以跟我联系。另外培训的招生简章在这个网址，想了解的可以去看看。加我QQ：29011218交流也可。<br/><a href="http://www.bizeway.net/read.php/285.htm" target="_blank">PHP培训招生简章</a><br/>Tags - <a href="tag.php?tag=ports" rel="tag">ports</a> , <a href="tag.php?tag=apache" rel="tag">apache</a> , <a href="tag.php?tag=mysql" rel="tag">mysql</a> , <a href="tag.php?tag=php" rel="tag">php</a>
]]>
</description>
</item><item>
<link>http://www.bizeway.net/read.php?&amp;guid=0#topreply</link>
<title><![CDATA[[评论] 跟着ArthurXF学FreeBSD36——ports安装apache+mysql+php]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://www.bizeway.net/read.php?&amp;guid=0#topreply</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>