??xml version="1.0" encoding="utf-8" standalone="yes"?>国产传媒av在线,欧美不卡视频一区,亚洲日本久久http://www.aygfsteel.com/sealyu/category/45940.html--- The devil's in the Details (<a >http://www.sealyu.com</a>)zh-cnFri, 10 Dec 2010 09:01:20 GMTFri, 10 Dec 2010 09:01:20 GMT60最受欢q的50个免费wordpress模板(?http://www.aygfsteel.com/sealyu/archive/2010/12/09/340138.htmlsealsealThu, 09 Dec 2010 05:20:00 GMThttp://www.aygfsteel.com/sealyu/archive/2010/12/09/340138.htmlhttp://www.aygfsteel.com/sealyu/comments/340138.htmlhttp://www.aygfsteel.com/sealyu/archive/2010/12/09/340138.html#Feedback0http://www.aygfsteel.com/sealyu/comments/commentRss/340138.htmlhttp://www.aygfsteel.com/sealyu/services/trackbacks/340138.html

译者注Q?em>WordPress是最受欢q的博客发布q_之一Q具有免费,高度可定制、容易安装和使用{特艌Ӏ由于Wordpress是如此流行和受欢q,你可以找到大量的Wordpress开发以及管理等斚w的资源,丰富的用h南让你能够快速的上手使用。参考资料:30个顶UWordpress培训视频指南与教E?/a>

有很多天才设计师选择发表免费?a title="wordpress" >wordpress主题。大多数时候,对于他们来说唯一的一点小要求是保留他们的设计元素,q接到他们的网站(非常合理的要求)?/p>

在本文中Q我们整理了50个优U的、高质量的?a >免费的Wordpress主题l大家。这些主题包含了制作_且华丽的主题Q也有简z清爽的主题Q你可以扑ֈ适合你的设计品位的wordpress主题?/p>

说明: 请务必检查主题的许可协议Q不要违反用限Ӟ如果有的话)Qƈ且保留设计师的设计属性[footer中的设计信息]Q即使设计师没有要求你这么做。[互联|营销博客?/strong>Q设 计一个漂亮的wordpress themeQ需要花费设计师很多的时间和_֊Q如果你喜欢q些免费的wordpress主题Q请重设计师的力_成果。]

译者注Q在本文中介l的wordpress主题均ؓ英文模板Q对于用英文写博客的朋友来_q里q有我收集的3个英文写作Y件可以参考,都有免费试用版本可供下蝲Q??a title="whitesmoke" >Whitesmoke Q?最适合ESL使用的英文写作和语法U错软gQ支持mac os??a title="stylewriter" >Stylewriter Q?最适合公司Q组l,作家使用的plain english写作软g??a title="ginger software" >Ginger Software - 英文拼写和语法检查YӞ和whitesmoke差不多,但更Z业的英文写作工具?/p>

Color Paper

Color Paper - screen shot.

Demo | Download

Cellar Heat

Cellar Heat - screen shot.
Demo | Download

Simply Ornate

Simply Ornate - screen shot.
Demo | Download

Agregado

Agregado - screen shot.
Demo | Download

Notepad Chaos

Notepad Chaos - screen shot
Preview | Download

WordPress Fun

WordPress Fun - screen shot.
Preview | Download

Infinity

Infinity - screen shot.
Preview | Download

Outdoorsy Theme

Outdoorsy Theme - screen shot.
Download

Curious

Curious - screen shot.
Demo | Download

Brightness

Brightness - screen shot.
Demo | Download

japan-style

japan-style - screen shot.
Demo | Download

BizTheme

BizTheme - screen shot.
Demo | Download

SCRUFFY

SCRUFFY - screen shot.
Demo | Download

Aspire

Aspire - screen shot.
Demo | Download

Pixeled

Pixeled - screen shot.
Download

Wilderness

Wilderness - screen shot.
Download

SuperFresh

SuperFresh - screen shot.
Demo | Download

WP CODA

WP CODA - screen shot.
Demo | Download

Vikiworks V5

Vikiworks V5 - screen shot.
Download

MyWall

MyWall - screen shot.
Preview | Download

Firebug

Firebug - screen shot.
Demo | Download

Illacrimo

Illacrimo - screen shot.
Download

iTheme

iTheme - screen shot.
Demo | Download

Tigerpress

Tigerpress - screen shot.
Preview | Download

Mahiwaga

Mahiwaga - screen shot.
Download

Photo Clip

Photo Clip - screen shot.
Demo | Download

Dilectio

Dilectio - screen shot.
Download

Typebased

Typebased - screen shot.
Download

The Original Premium News

The Original Premium News -screen shot.
Download

Snapshot

Snapshot - screen shot.
Download

Portfolio

Portfolio - screen shot.
Demo | Download

Mimbo 2

Mimbo 2 - screen shot.
Demo | Download

ColdBlue

ColdBlue - screens hot.
Download

Sharpfolio

Sharpfolio - screen shot.
Demo | Download

Yoghourt

Yoghourt - screen shot.
Download

BlogBus

BlogBus - screen shot.
Preview | Download

Ashford

Ashford - screen shot.
Download

SubtleZen

SubtleZen - screen shot.
Download

Vistalicious

Vistalicious - screen shot.
Download

Small Magazine

Small Magazine - screen shot.
Preview | Download

Sp142 theme

Sp142 theme - screen shot.
Demo | Download

Chronicles

Chronicles - screen shot.
Download

DailyPress

DailyPress - screen shot.
Download

Portfolio Press

Portfolio Press - screen shot.
Download

Wordpress Magazine theme

Wordpress Magazine theme - screen shot.
Preview | Download

Brilliance

Brilliance - screen shot.
Download

Simple Balance 2.0

Simple Balance 2.0 - screen shot.
Demo | Download

The Unstandard

The Unstandard - screen shot.
Download

Modicus Remix

Modicus Remix - screen shot.
Demo | Download

Lightning

Lightning - screen shot.
Demo | Download



seal 2010-12-09 13:20 发表评论
]]>
关于多站点安装的ȝQ{Q?/title><link>http://www.aygfsteel.com/sealyu/archive/2010/12/04/339801.html</link><dc:creator>seal</dc:creator><author>seal</author><pubDate>Sat, 04 Dec 2010 11:47:00 GMT</pubDate><guid>http://www.aygfsteel.com/sealyu/archive/2010/12/04/339801.html</guid><wfw:comment>http://www.aygfsteel.com/sealyu/comments/339801.html</wfw:comment><comments>http://www.aygfsteel.com/sealyu/archive/2010/12/04/339801.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/sealyu/comments/commentRss/339801.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/sealyu/services/trackbacks/339801.html</trackback:ping><description><![CDATA[<p>一些相兌源:</p> <ul> <li><a title="http://zhupou.cn/drupal-handbook/tutorials/set-up-multi-site-using-drupal" >http://zhupou.cn/drupal-handbook/tutorials/set-up-multi-site-using-drupal</a></li> <li><a title="http://drupal.org/node/99840" >http://drupal.org/node/99840</a></li> <li><a title="http://drupal.org/node/66657" >http://drupal.org/node/66657</a></li> <li><a title="http://drupal.org/node/428596" >http://drupal.org/node/428596</a></li> <li><a title="http://drupal.org/node/69199#comment-129840" >http://drupal.org/node/69199#comment-129840</a></li> <li><a title="http://drupal.org/node/14697" >http://drupal.org/node/14697</a></li> <li><a title="http://drupal.org/node/147828" >http://drupal.org/node/147828</a></li> <li><a title="http://drupal.org/node/63863" >http://drupal.org/node/63863</a></li> <li><a title="http://drupal.org/node/125539" >http://drupal.org/node/125539</a></li> <li><a title="http://drupal.org/node/43816" >http://drupal.org/node/43816</a></li> <li><a title="http://drupal.org/node/25011" >http://drupal.org/node/25011</a></li> <li><a title="http://drupal.org/node/25011#comment-136227" >http://drupal.org/node/25011#comment-136227</a></li> </ul> <p>Drupal 实在是一个很强大的网l操作系l,它内建的多站点安装机刉常强大,但也比较复杂Q下面我来ȝ一下本?robinlord.org)的多站点安装Ҏ?/p> <p>很多朋友购买的虚拟主机对数据库或者空间或者可以绑定的域名或者能够设|的子域名限刉常厉宻I但是使用 drupal q一切将不再是问题。Drupal 可以使用一个数据库来安装多个站点,q个只要在安装过E中讑֮数据表前~卛_?/p> <p>我来分析下本?robinlord.org)的结构。本站目前共使用同一?Drupal 代码搭徏了三个独立的站点Qblogs.robinlord.org、drupal.robinlord.org? drupal.robinlord.org/hanhua。是的,没错Q最后那个是独立的站点,不是一个\径,q个是利?drupal 的子目录来做独立站点的,本文的关键也在q一切的实现?/p> <p>本站是采?strong>泛域名解?/strong>+<strong>.htacess</strong>的方案来实现的?/p> <p>首先需要了解什么是<strong>泛域名解?/strong>Q然后把所有的 *.roginlord.org 解析到站点的 web 根目?public_html)Q接着在根目录下徏?drupal 目录做ؓ drupal 的代码目录,接着在根目录下的 .htacess d urlrewrite 规则Q把?drupal.robinlord.org ?blogs.robinlord.org 的请求全部定向到 drupal 目录Q其它的二域名目录q样做。至?drupal.robinlord.org/hanhua Q则是徏立一个名?hanhua 软链接到 drupal 目录(Linux LQwindows L再行研究)。比?/public_html/hanhua 是? /public_html/drupal 的Y链接Q同时在l?drupal.robinlord.org 做url重写旉开?hanhua 的重写,实C?/p> <p>下面是站点的目录l构:</p> <pre>public_html/ --|<br /> |-- drupal/ #[目录]q个?drupal 的程序目?br /> |--hanhua/ #[目录]q个是到 drupal 的Y链接<br /> |--.htacess #[文g]q里配置目录?URL 重写规则<br /> </pre> <p>下面是根目录?.htacess 的内容:</p> <pre><IfModule mod_rewrite.c><br /> RewriteEngine on<br /> #重写二域名的\?br /> RewriteCond %{HTTP_HOST} ^blogs".robinlord".org$<br /> RewriteRule ^(.*)$ drupal/$1 [L]<br /> RewriteCond %{HTTP_HOST} ^drupal".robinlord".org$<br /> #对于子目录独立站点的配置<br /> RewriteCond %{REQUEST_URI} !^hanhua<br /> RewriteRule ^(.*)$ drupal/$1 [L]<br /> </IfModule><br /> </pre> <p>q样实C多个站点的访问,下面是多站点的安装及公用用户数据的设|?/p> <p>首先Q在安装之前手动建立好各个站点的配置文gQ遵循多站点目录的命名规则。本站则建立了如下几个目录:</p> <pre> sites/--|<br /> |-- blogs.robinlord.org<br /> |-- drupal.robinlord.org<br /> |-- drupal.robinlord.org.hanhua<br /> </pre> <p>在每个目录手动徏立相应的 settings.php Q下面是 blogs.robinlord.org ?settings.php 配置文g中需要手动设定的地方Q其他配|在安装q程中会自动讄?/p> <pre>$db_url = 'mysql://username:password@localhost/databasename';<br /> $db_prefix = array(<br /> 'default' => 'blogs_',<br /> 'users' => 'shared_',<br /> 'access' => 'shared_',<br /> 'authmap' => 'shared_',<br /> 'sessions' => 'shared_',<br /> 'profile_fields' => 'shared_',<br /> 'profile_values' => 'shared_',<br /> 'languages' => 'shared_',<br /> 'locales_source' => 'shared_',<br /> 'locales_target' => 'shared_',<br /> );<br /> $base_url = 'http://blogs.robinlord.org';<br /> $cookie_domain = 'robinlord.org';<br /> </pre> <p>$db_url 是数据库配置?/p> <p>$db_prefix 讑֮表前~Qdefault 讑֮站点默认的表前缀Q其他的则是数据表的名称及其对应的前~讑֮Q一般都设ؓ 'shared_'?/p> <p>$base_url 讑֮站点根域名,q个必须Ҏ具体情况讄Q负责站点\径可能会出错?/p> <p>$cookie_domain q个是多站点公用登陆的关键Q设|ؓ站点的根域,卛_实现在多站点登陆一ơ即可。当然还需要公?user ?session 相关的表Q这个前面已l配|好了?/p> <p>讑֮好配|文件后Q就可以开始安装进E。因为已l设定了数据库配|,所以安装程序会直接跌q些讄的页面而直接开始安装?/p> <img src ="http://www.aygfsteel.com/sealyu/aggbug/339801.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/sealyu/" target="_blank">seal</a> 2010-12-04 19:47 <a href="http://www.aygfsteel.com/sealyu/archive/2010/12/04/339801.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>zencart l你的购物网站加上phpBB论坛http://www.aygfsteel.com/sealyu/archive/2010/11/30/339422.htmlsealsealTue, 30 Nov 2010 10:10:00 GMThttp://www.aygfsteel.com/sealyu/archive/2010/11/30/339422.htmlhttp://www.aygfsteel.com/sealyu/comments/339422.htmlhttp://www.aygfsteel.com/sealyu/archive/2010/11/30/339422.html#Feedback0http://www.aygfsteel.com/sealyu/comments/commentRss/339422.htmlhttp://www.aygfsteel.com/sealyu/services/trackbacks/339422.html安装好Zen Cart v1.2.1或更高版本,q且你在安装Zen Cart时没有选择集成phpBB?/div>
2. 安装phpBBq保证能正常工作。ؓ了容易配|,在根目录下安装phpBBQ例如:
http://mysite.com/forums
或?/div>
http://mysite.com/phpbb
3. ~辑文g/includes/configure.phpQ在下面q行定义phpBB目录的\径:
define(‘DIR_WS_PHPBB’, ‘/phpBB2/’);
路径必须是物理\径,?/var/www/client/public_html/ q样的格式。可以参?DIR_FS_CATALOGQ然后加上phpBB ?forum 或相应目录名?/div>
必须?/ l尾?/div>
4. 在Zen Cart的管理页面,Configuration->My Store下,讄”Enable phpBB Linkage?” ?TRUE
讄完成后,新用h册时Q系l会让用戯入一个论坛的用户?

安装好Zen Cart v1.2.1或更高版本,q且你在安装Zen Cart时没有选择集成phpBB?br /> 2. 安装phpBBq保证能正常工作。ؓ了容易配|,在根目录下安装phpBBQ例如:http://mysite.com/forums或者http://mysite.com/phpbb
3. ~辑文g/includes/configure.phpQ在下面q行定义phpBB目录的\径:define(‘DIR_WS_PHPBB’, ‘/phpBB2/’);

路径必须是物理\径,?/var/www/client/public_html/ q样的格式。可以参?DIR_FS_CATALOGQ然后加上phpBB ?forum 或相应目录名?br /> 必须?/ l尾?br /> 4. 在Zen Cart的管理页面,Configuration->My Store下,讄”Enable phpBB Linkage?” ?TRUE
讄完成后,新用h册时Q系l会让用戯入一个论坛的用户?










看了一个网站关于zen-cart安装集成phpbb3的步骤和Ҏ,基本都有些错误及不正的地方,我了自己记录方便,我将步骤及方法介l如?
1 ?a >www.phpbb.com 官方下蝲一个最新版,然后Ҏ需要在http://www.phpbb.com/languages/,下蝲指定的语a,q把相应的目录language?
2 在指定的zen-cart目录下徏立一个forums或bbs的目?phpbb3代码攑օ目录?扑ֈ指定的数据库用户名密码资?可以安?安装q程中可选择指定的语a,当然安装后也可重新选择默认的语a.
3 ׃phpbb3需要将zencart的一个类文g换掉,|上传的代码有问题,我做了修正和补充./includes/classes/class.phpbb.php
4 在configure.php中的define(‘DIR_WS_PHPBB’, ‘/home/|站?public_html/forums/’);讄完整的\?br /> 5 在admin/基本讄 ??nbsp; 打开phpBB链接? 讄成true.
完成上述5个步?卛_在用h册时,注册信息同时注入到phpbb3的数据库?/p>

seal 2010-11-30 18:10 发表评论
]]> Simplest Drupal iPhone AppQ{Q?/title><link>http://www.aygfsteel.com/sealyu/archive/2010/09/15/332066.html</link><dc:creator>seal</dc:creator><author>seal</author><pubDate>Wed, 15 Sep 2010 05:53:00 GMT</pubDate><guid>http://www.aygfsteel.com/sealyu/archive/2010/09/15/332066.html</guid><wfw:comment>http://www.aygfsteel.com/sealyu/comments/332066.html</wfw:comment><comments>http://www.aygfsteel.com/sealyu/archive/2010/09/15/332066.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/sealyu/comments/commentRss/332066.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/sealyu/services/trackbacks/332066.html</trackback:ping><description><![CDATA[<p>Maybe not the most simple, but pretty close. This app posts a node to Drupal Services using XML-RPC. We thought it would be useful for anyone interested in building an iPhone app that interacts with Drupal and wanted a basic starting point. It provides two text fields and a submit button. Enter some text and press submit and the fields get posted to the Drupal site (the URL is hardcoded into the app, not very useful). </p> <p> On the Drupal end, you will need the Services, the XML-RPC server, and the Node Service modules enabled (these are all bundled with <a target="_blank">Services</a>). In addition you will have to disable keys and sessid in Services (Site Building > Services > Settings). Also you have to allow anonymous access to services, and allow anonymous creation of story nodes (both in User management > Permissions). So you really do not want to do this on any kind of production site. </p> <p> The iPhone calls the node.save method by posting the following XML:</p> <p><methodName>node.save</methodName><br /> <params><br /> <param><value><struct><br /> <member><name>type</name><value><string>story</string></value></member><br /> <member><name>title</name><value><string>title text</string></value></member><br /> <member><name>body</name><value><string>body text</string></value></member><br /> </struct></value></param><br /> </params></methodCall></p> <p> The iPhone app provides two ways to accomplish this. The first (commented out in the code) creates a HTTP POST request with the XML above as the body. This is not very useful since you have to provide the raw XML, but it shows how to execute an HTTP POST which is useful for many other things. The second uses XML-RPC functionality borrowed from the open-source <a target="_blank">wordpress app</a> (which itself is a version of the <a target="_blank">Cocoa XML-RPC Framework</a> ). This makes it much easier to formulate and execute XML-RPC calls, and the whole thing boils down to this:</p> <div id="wmqeeuq" class="codeblock"><code>    XMLRPCRequest *request = [[XMLRPCRequest alloc] initWithHost:[NSURL URLWithString: @"http://192.168.1.14/drupal-6.6/services/xmlrpc"]];<br /> NSMutableDictionary *postParams = [NSMutableDictionary dictionary];<br /> [postParams setObject:@"story" forKey:@"type"];     <br /> [postParams setObject:titleString forKey:@"title"];  // title input from iphone<br /> [postParams setObject:bodyString forKey:@"body"];    // body input from iphone<br /> [request setMethod:@"node.save" withObject:postParams];<br /> XMLRPCResponse *nodeSaveResponse = [XMLRPCConnection sendSynchronousXMLRPCRequest:request];</code></div> <p> The full app below. Developed with iPhone SDK 2.2.</p> <table id="attachments" class="sticky-enabled"> <thead> <tr> <th>Attachment</th><th>Size</th> </tr> </thead> <tbody> <tr class="odd"> <td><a >simpleNodeTitleBody-XMLRPC.zip</a></td> <td>899.47 KB</td> </tr> </tbody> </table> <img src ="http://www.aygfsteel.com/sealyu/aggbug/332066.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/sealyu/" target="_blank">seal</a> 2010-09-15 13:53 <a href="http://www.aygfsteel.com/sealyu/archive/2010/09/15/332066.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title> An overview of Mobile modules for Drupalhttp://www.aygfsteel.com/sealyu/archive/2010/09/03/330834.htmlsealsealFri, 03 Sep 2010 02:51:00 GMThttp://www.aygfsteel.com/sealyu/archive/2010/09/03/330834.htmlhttp://www.aygfsteel.com/sealyu/comments/330834.htmlhttp://www.aygfsteel.com/sealyu/archive/2010/09/03/330834.html#Feedback0http://www.aygfsteel.com/sealyu/comments/commentRss/330834.htmlhttp://www.aygfsteel.com/sealyu/services/trackbacks/330834.html阅读全文

seal 2010-09-03 10:51 发表评论
]]>
301 Redirecthttp://www.aygfsteel.com/sealyu/archive/2010/08/26/329968.htmlsealsealThu, 26 Aug 2010 06:17:00 GMThttp://www.aygfsteel.com/sealyu/archive/2010/08/26/329968.htmlhttp://www.aygfsteel.com/sealyu/comments/329968.htmlhttp://www.aygfsteel.com/sealyu/archive/2010/08/26/329968.html#Feedback0http://www.aygfsteel.com/sealyu/comments/commentRss/329968.htmlhttp://www.aygfsteel.com/sealyu/services/trackbacks/329968.html RewriteEngine on
rewritecond %{http_host} ^coolexample.com [nc]
rewriterule ^(.*)$ http://www.coolexample.com/$1 [r=301,nc]

q样pcoolexample.com的url怹性重定向到www.coolexample.comQ从而实现搜索引擎的友好性,提高搜烦排名?br /> 注:前提要开始rewrite模块


seal 2010-08-26 14:17 发表评论
]]>
Drupal SEO 入门(?http://www.aygfsteel.com/sealyu/archive/2010/08/20/329505.htmlsealsealFri, 20 Aug 2010 13:08:00 GMThttp://www.aygfsteel.com/sealyu/archive/2010/08/20/329505.htmlhttp://www.aygfsteel.com/sealyu/comments/329505.htmlhttp://www.aygfsteel.com/sealyu/archive/2010/08/20/329505.html#Feedback0http://www.aygfsteel.com/sealyu/comments/commentRss/329505.htmlhttp://www.aygfsteel.com/sealyu/services/trackbacks/329505.htmlDrupal 核心模块中就包含了可选的 SEO 优化选项Q此外还有一些有益的 Drupal 的第三方模块Q他们都可以帮助 Drupal 的用者提升搜索引擎的排名。本文就介l一?Drupal SEO 时必装模块和相应的设|,希望Ҏ有所帮助。但是这只是 Drupal SEO 的开?#8230;…

开启简z链?Clean URLs)
开?Path 模块 (?Drupal 4.3 开始进?Drupal 核心模块)
Path 模块可以让您通过d路径别名(path alias)Q来辑ֈ自定义链接名的效果。例?http://www.mypetal.com/node/7 可以定义?http://www.mypetal.com/library/drupal-seo ?/p>

开?Pathauto 模块 Qhttp://drupal.org/project/pathautoQ?br /> Pathauto 模块能够Z同类型的面Qnodes, categories, usersQ自动生成\l别?path alias)Q而不在需要用h动定义\径别名?/p>

讄 Pathauto 模块Q在修改 node 的标题时Q禁?Pathauto 模块二次修改路径别名?br /> 开?Global Redirect 模块Qhttp://drupal.org/project/globalredirectQ?br /> Global Redirect 模块在页面拥有\径别名的情况下,U除该页面的原始路径Q这样可以减网站的重复内容面Q有利于 SEO?/p>

开?Meta Tags QnodewordsQ模块(http://drupal.org/project/nodewordsQ?br /> Meta Tags 模块可以让您为每?node、user、view ?panel 面讄多种 meta tagsQ例如:keywords ?descriptionQ有利于 SEO?/p>

开?Page Title 模块Qhttp://drupal.org/project/page_titleQ?br /> Page Title 模块能让您自定义面标题Q有利于 SEO?/p>

使用 Drupal XML Sitemap 模块
调整 .htaccess 文gto redirect to "www" or remove the "www" subdomain.
调整您网站主题的 HTML headers -- 许多主题讄不正?br /> 调整您网站的 robots.txt 文g。在 Drupal 6 ?Drupal 默认?robots.txt 文gq是有一些问题?br /> 查安装的W三Ҏ块是否新增了一些重复的链接Q如果有Q用在 robots.txt d规则Ҏ索引擎的爬虫q行屏蔽?/p>

seal 2010-08-20 21:08 发表评论
]]>
drupal's audio modulehttp://www.aygfsteel.com/sealyu/archive/2010/08/19/329351.htmlsealsealThu, 19 Aug 2010 04:01:00 GMThttp://www.aygfsteel.com/sealyu/archive/2010/08/19/329351.htmlhttp://www.aygfsteel.com/sealyu/comments/329351.htmlhttp://www.aygfsteel.com/sealyu/archive/2010/08/19/329351.html#Feedback0http://www.aygfsteel.com/sealyu/comments/commentRss/329351.htmlhttp://www.aygfsteel.com/sealyu/services/trackbacks/329351.htmlches

Updated for Drupal 5.1! See the bottom of the article.

I have a growing backlog of stories that I've been meaning to type up here, including several articles of interest for folks getting started with drupal, but I've just finished setting up the audio module, so I thought I'd share my experience while it's fresh on the mind.

You'll notice that you can now play the "two out of three" mp3 from my last post direct from the site without the need to download, and this is thanks to the audio module. Since it utilizes drupal's node model for content types, this module is able to harness much of the power and flexibility inherent in the CMS, including the taxonomy system and automatic RSS/podcast feed generation. It can also be readily extended through modules like the playlist toolkit for sites with sophisticated audio needs.

My intent here, though, is just to offer a quick step-by-step guide for a simpler application: a blog or some other site seeking to include audio files attached to other content types (pages and stories, for instance). Still, this should be helpful for anyone getting started with the audio module.

Installation and Configuration

  1. Let's obtain the audio module from the project page. I'm using version 4.7.0 for this guide. Untar the file in your site's modules directory.

    > tar xzvf audio-4.7.0.tar.gz

  2. Next we need to download the getid3 PHP libraries and unzip the downloaded file into the same directory as audio.module.

    > unzip getid3-1.7.7.zip -d <yoursitepath>/modules/audio/

    Version 1.7.7 of getid3 is recommended in the audio module's documentation.

  3. Open the site in your browser and go to administer >> modules. Enable the audio, audio_attach and audio_getid3 modules. I don't need to add audio files in bulk or use cover art, so I don't use audio_import or audio_images. Configuration for those modules is not covered here.
  4. I don't want audio entries in my navigation menu, so I disabled "audio" and "browse by" at administer >> menus. You can optionally enable audio-related blocks at, you guessed it, administer >> blocks.
  5. You'll need to set user privelages according to your needs: at administer >> access control I gave my blog user "create audio" and "edit own audio" permissions in addition to the defaults.
  6. In order to attach audio nodes to other content types, we need to enable this capability for each type at administer >> settings >> content types. I first configured audio, disabling Attach Images and Attachments since I have the image_attach and upload modules enabled. I also disabled comments and promotion to front page. Then, enable Attach audio files for the content types that suit your needs. I did so for story. You might do the same for page, CCK types or others.
  7. Finally, check your settings at administer >> settings >> audio. Typical PHP configurations will default to a 2MB upload limit -- you'll probably need to adjust your php.ini as suggested if you haven't already done so. Disable Downloadable by default if you want to make it more difficult for users to save copies of your music. Check that settings on the metadata tags tab are to your liking, and check the getid3 tab to assure that your installation is detected correctly.
  8. That's it! You should now be able to create a new node -- of a type set up in step six -- with the option to attach an audio file. This will create an audio node behind the scenes, which you can browse (and edit id3 tags for) at yoursite.com/audio. If you don't want this behavior, uncheck Published when attaching the audio file to your node.

Taking it Further

Of course, if audio plays a more prominent role at your site, there's much more that you can do with the audio module, incorporating taxonomy, changing the look of the player, and so on. Here are some links to get you started.

Update for Drupal 5.1

For the most part, updating my audio module for use as outlined above was intuitive, with one exception: the audio_attach module has just been contributed to CVS for 5.x by zirafa. He's also contributed a new audio_playlist module, but I haven't tried that out yet. To get audio_attach (and get my existing nodes with attached audio back to working order), I checked out the audio module from CVS with the following commands:

> cd <yoursitepath>/modules
> cvs -z6 -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal-contrib checkout -d audio contributions/modules/audio

I installed the modules as normal and ran update.php. At this point I received an SQL error as the script attempted to set multiple primary keys for the audio_attach table. I manually set nid, aid and weight as primary keys using phpMyAdmin, and I was back in business. I've found that my Flash players are not visible when using the handy admin_menu module, but that probably shouldn't effect many of your users.

I'll try to update all of these instructions soon. In the meantime, comment if you have questions!



seal 2010-08-19 12:01 发表评论
]]>
45个可用于Drupal主题的免费PSD|页模版下蝲Q{Q?/title><link>http://www.aygfsteel.com/sealyu/archive/2010/08/19/329309.html</link><dc:creator>seal</dc:creator><author>seal</author><pubDate>Thu, 19 Aug 2010 01:59:00 GMT</pubDate><guid>http://www.aygfsteel.com/sealyu/archive/2010/08/19/329309.html</guid><wfw:comment>http://www.aygfsteel.com/sealyu/comments/329309.html</wfw:comment><comments>http://www.aygfsteel.com/sealyu/archive/2010/08/19/329309.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/sealyu/comments/commentRss/329309.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/sealyu/services/trackbacks/329309.html</trackback:ping><description><![CDATA[     摘要: q些PSD对于设计师者来说真是天大的音Q再也不用ؓl尽脑汁的设计模版而头g。设计师们可以下载收藏一下,以备需要之Ӟ拿来用上?1.) Solitude 2.) Dusky 3.) Tour 4.) Anticipated 5.) Shape 6.) Fashio...  <a href='http://www.aygfsteel.com/sealyu/archive/2010/08/19/329309.html'>阅读全文</a><img src ="http://www.aygfsteel.com/sealyu/aggbug/329309.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/sealyu/" target="_blank">seal</a> 2010-08-19 09:59 <a href="http://www.aygfsteel.com/sealyu/archive/2010/08/19/329309.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Drupal Clean URLs -- Apache 2 Configuration on Ubuntuhttp://www.aygfsteel.com/sealyu/archive/2010/08/19/329304.htmlsealsealThu, 19 Aug 2010 01:32:00 GMThttp://www.aygfsteel.com/sealyu/archive/2010/08/19/329304.htmlhttp://www.aygfsteel.com/sealyu/comments/329304.htmlhttp://www.aygfsteel.com/sealyu/archive/2010/08/19/329304.html#Feedback0http://www.aygfsteel.com/sealyu/comments/commentRss/329304.htmlhttp://www.aygfsteel.com/sealyu/services/trackbacks/329304.htmlThere are two methods for setting up Drupal 5.x/6.x with Apache on Ubuntu. The first (preferred) method edits the virtual host configuration, which is the default setup on Ubuntu (even for a single-site web server). The second edits the main apache2.conf, which is typical for an older setup.

Step 1 - Method A: "Virtual Host" Setup

First, from the Linux command line, enable the rewrite module for apache with this command:

sudo a2enmod rewrite

You can check to see if this worked by running:

apache2ctl -M

and seeing if it is on the list.

Next, use an editor (such as nano) to edit the appropriate Apache configuration file for your Drupal site in the /etc/apache2/sites-available/ directory. For a single site, the file is /etc/apache2/sites-available/default; if you have multiple sites, the file names should reflect the names of the sites to which they refer. Thus, to edit the default site configuration, use

sudo nano /etc/apache2/sites-available/default

Look for the Directory section referring to the folder where your Drupal site lives (in /etc/apache2/sites-available/default, this is typically <Directory /var/www>), and change the line:

AllowOverride None to AllowOverride All

(This directive permits an .htaccess file, such as Drupal's, to be used to override Apache's default settings, and is necessary to allow the URL rewriting to work. See https://help.ubuntu.com/community/EnablingUseOfApacheHtaccessFiles for more information).

Save this file and then reload Apache as follows:

sudo /etc/init.d/apache2 reload

Subdomain Setup

Instead of creating multiple virtual host files, you can create one virtual host file that uses a wildcard in the ServerAlias. Both a simple multi-site Drupal setup and multiple Drupal versions can run this way, if the different subdomains are defined for each site in settings.php.

Consider the following and modify your configuration file to fit your needs.

  1. http://myproject.dr5.example/
  2. http://myproject.dr6.example/
  3. http://myproject2.dr6.example/

Here is a partial listing of a virtual host configuration file that would support the last two lines in the above example. Note this is not intended to be a COMPLETE configuration file, but rather provide guidance for your development setup.

<VirtualHost *>
DocumentRoot "/www/Dr6"
ServerName example
ServerAlias *.dr6.example

<Directory "/www/Dr6">
AllowOverride All
</Directory>

Edit & save your config file to suit your development needs. Assuming the site is already enabled, then reload Apache.

Step 1 - Method B: apache2.conf

In Apache version 2, httpd.conf has been deprecated and the new file is located at:
/etc/apache2/apache2.conf.

Thus, it's no longer necessary to do the following in httpd.conf to enable the rewrite module (mod_rewrite):

LoadModule rewrite_module modules/mod_rewrite.so
AddModule mod_rewrite.c

Simply run the following from the Linux command line:
sudo a2enmod rewrite

To disable the module you can run:
sudo a2dismod rewrite
(Note that this would cause clean URLs to break.)

Once mod_rewrite is enabled, open apache2.conf in a text editor. Note that it will probably be read-only, so you will need sudo privileges to edit it. Use a command such as:
sudo nano /etc/apache2/apache2.conf

Find where the sections are in your apache2.conf and add another one for your Drupal site similar to this:

<Directory /var/www/your_drupal_site>
    AllowOverride All
</Directory>

After you edit apache2.conf as listed above, you need to restart the server by:
sudo /etc/init.d/apache2 reload

Step 1 - Method C: Add Rewrite Rules Directly to Virtual Host or apache2.conf

If you do not wish to allow .htaccess overrides, you can add the rewrite rules directly to a virtual host file or apache2.conf. The following should work:

<Directory /var/www/your_drupal_site>
         RewriteEngine On
         RewriteBase /
         RewriteCond %{REQUEST_FILENAME} !-f
         RewriteCond %{REQUEST_FILENAME} !-d
         RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
      </Directory>

This can provide slightly faster server performance since Apache will not look in every directory for an .htaccess file.

Note that, for proper security, you will need to add in the rules from the Drupal files directory's .htaccess file as well.

Debugging Rewrite Issues

If you are having problems with getting your rewrite to work you can set Apache to log rewrite errors. To do that add this to the end of /etc/apache2/apache2.conf:

RewriteLog "/var/log/apache2/rewrite.log"
RewriteLogLevel 3

Level 0 does no logging. Level 9 logs everything. Choose the level necessary for resolving your issue.

Security Warning: Make sure to either remove or comment the logging code out when finished, or else put the log file in a directory that can't be read by normal users (such as /var/log/apache2). If this is not done, it can result in a security breach. Also, note that rewrite logging adds somewhat to server load, and can easily generate large amounts of output not needed on a production server.

Step 2: Enable Clean URLs

Now go to http://yoursite.com/?q=admin/settings/clean-urls, and run the test for "Clean URLs" (In Drupal 4.6 - 5.x this is buried in the paragraph explaining what "clean urls" are).

Then, select the radio button to set clean URLs to "enabled" and submit the form. You should now be able to access your site using URLs without the query string in them.



seal 2010-08-19 09:32 发表评论
]]>
Create a page to list users by role-Drupalhttp://www.aygfsteel.com/sealyu/archive/2010/08/18/329222.htmlsealsealWed, 18 Aug 2010 07:39:00 GMThttp://www.aygfsteel.com/sealyu/archive/2010/08/18/329222.htmlhttp://www.aygfsteel.com/sealyu/comments/329222.htmlhttp://www.aygfsteel.com/sealyu/archive/2010/08/18/329222.html#Feedback0http://www.aygfsteel.com/sealyu/comments/commentRss/329222.htmlhttp://www.aygfsteel.com/sealyu/services/trackbacks/329222.htmlIn this example you will create a page view listing users on your site. Through this step-by-step process, you will become familiar with some basic steps in creating a view, and familiarize yourself with the Views User Interface.

  1. Creating a new view

    Go to add new view. Give your new view the name 'user_list', description 'A simple user listing.', tag 'users', type 'User' and click Next.

  2. About the Interface

    You have been brought to the Views User Interface. As you start, you are editing the "Default" options for the view. In the 1st column on the left you can see the drop-down menu offers 'block', for example, to select settings specific only to block views. In the remaining columns, you will be able to add or change options by clicking on links or icons. These options will then appear below this main area. Most likely, you will need to scroll to see the options appear. As you make changes, these options will appear in bold until you save your view.

  3. Creating a page display; choosing a URL and creating a menu link

    1. In the 1st column, ensure that 'Page' is selected in the drop-down menu, and click Add Display.
    2. Next we'll define the path for this page. A page must have a path, and we define it early so that Views doesn't warn us "Display Page uses path but path is undefined." Locate the Page settings in the 2nd column, and click the None link next to the Path setting. In the options editing area that appears below, set the path to 'user_list' (or something else if you prefer) and click Update.
    3. Next to Menu setting, Click the No menu link. In the options which appear below, select Normal menu entry, and set the title to 'User list' and click Update.
    4. Scroll up to Basic settings, in that same 2nd column, and click the No link next to Use pager. Below, in the options, select Full pager and click Update default display.
  4. Selecting the fields to display

    1. In 3rd column locate the Fields options. Click the + icon to add fields.
    2. Scroll down to Defaults: Add fields. In the Groups drop-down menu select 'User', then check the following fields: User: Created date, User: Delete link, User: Edit link, User: Last access, User: Name and User: Picture. Then click Add.
    3. You will be taken through the fields you added one at a time. Click Update default display to go to each next field. Leave the default options on all fields except Delete link; change that field's label to 'Operations'.
    4. Scroll back up to Fields and click the ↑↓ icon to rearrange fields. Down below, drag the Name field, by dragging its four-sided arrow, to the top. Drag the Delete link (Operations) field to the bottom, and the Edit link field just above it. Then click Update.
  5. Seeing what we've done so far

    At this point, you have done enough to create a valid view. If you scroll down, you will see a preview of your view. If it doesn't show already, click the Preview button; but generally this display updates automatically whenever you finish working in one of the mini forms.

  6. Styling the view as a table; combining related fields into columns

    1. Under Basic settings, in the 1st column, click the Unformatted link next to the Style setting. In the options below, under Page: How should this view be styled, choose Table and click Update default display.
    2. You will be taken to a Page: Style options form to edit the table settings. Locate our Edit link field in this mini form, and notice the Column drop-down. Change this drop-down to show Operations. In the Separator column next to the Operations field, type ' | ' (note the spaces around the | symbol). Check all of the Sortable checkboxes, and set Default sort to Name. When finished, click Update default display.
  7. Filtering the user list to exclude unwanted entries

    1. Click the + icon next to Filters.
    2. In the Groups drop-down menu select 'User', then check the User: Name filter, and click Add.
    3. Select Is not one of and enter 'Anonymous' in the Usernames box. Click Update default display.
  8. Adding an argument to list users by role dynamically

    1. Scroll up to Arguments, and click its + icon.
    2. Check the User: Roles argument, and click Add. Set the title to '%1' (don't type the quotes), and under Action to take if argument is not present select Summary, sorted ascending. Leave the other settings as they are. Click Update default display, and click Update through the prompts that follow to accept their default values.
  9. Saving the view

    Finally, click the Save button to save your work. At the very top, click View "Page" to go to your new view!



seal 2010-08-18 15:39 发表评论
]]>
Play Media files in Drupal 6http://www.aygfsteel.com/sealyu/archive/2010/08/18/329191.htmlsealsealWed, 18 Aug 2010 02:55:00 GMThttp://www.aygfsteel.com/sealyu/archive/2010/08/18/329191.htmlhttp://www.aygfsteel.com/sealyu/comments/329191.htmlhttp://www.aygfsteel.com/sealyu/archive/2010/08/18/329191.html#Feedback0http://www.aygfsteel.com/sealyu/comments/commentRss/329191.htmlhttp://www.aygfsteel.com/sealyu/services/trackbacks/329191.html

The best media file handle is Embedded Media Field module
http://drupal.org/project/emfield

The problem: one needs to modify: zzz_custom_url.inc
to play mp3.

Sample site: http://www.thanhsiang.org/en/av

How to use jQuery Media module to play flv and mp3 files?

Another module is jQuery Media module
http://drupal.org/project/jquery_media

1. Install modules
jQuery Media module
jQ module

2. Install player
flv (mp3) player:
http://www.jeroenwijering.com/?item=JW_FLV_Player
Download the player something like: mediaplayer-3-16.zip
You only need one file: mediaplayer.swf
copy that file to your drupal directory, http://localhost/drupal/files/mediaplayer.swf

3. configure
admin/settings/jq

Select "Auto-invoke Media class"

setting player
flve player:
http://localhost/drupal/files/mediaplayer.swf

mp3 player:
http://localhost/drupal/files/mediaplayer.swf

Default settings
Media Width: 320
Media Height: 240

4. create a page use link (a class="media" href=)
Example:

<a class="media" href="http://localhost/files/flvfiles.flv">Movie Files</a>

<a class="media" href="http://localhost/files/mp3files.mp3"> MP3 Files</a>


seal 2010-08-18 10:55 发表评论
]]>定制Drupal首页Q{Q?/title><link>http://www.aygfsteel.com/sealyu/archive/2010/08/13/328781.html</link><dc:creator>seal</dc:creator><author>seal</author><pubDate>Fri, 13 Aug 2010 06:42:00 GMT</pubDate><guid>http://www.aygfsteel.com/sealyu/archive/2010/08/13/328781.html</guid><wfw:comment>http://www.aygfsteel.com/sealyu/comments/328781.html</wfw:comment><comments>http://www.aygfsteel.com/sealyu/archive/2010/08/13/328781.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/sealyu/comments/commentRss/328781.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/sealyu/services/trackbacks/328781.html</trackback:ping><description><![CDATA[<div> <p>Drupal默认的首像是一个博客的文章列表Q如何定制成自己惌的样子呢Q有以下几种Ҏ来实玎ͼ</p> <h4>使用Front Page模块</h4> <p>大多Ch实现某个功能旉先想到的是用模块(<a target="_blank">Front Page</a>首页模块Q,但个人ƈ不认同动不动׃用模块,太多模块增加pȝ负担Q下面的Ҏ同样解决了定刉늚问题而不必用模块?/p> <h4>使用page-front.tpl.php面模板</h4> <p>page-front.tpl.php是首늚面模板Q把page.tpl.php复制q改名ؓpage-front.tpl.phpQ修攚w面的内容可以定刉了?/p> <h4>使用node-front.tpl.php节点模板</h4> <p>如果只是更改首页节点昄的样式,仅更改节点别的模板卛_。把node.tpl.php复制q改名ؓnode-front_page.tpl.phpQ修攚w面的节点昄样式?/p> <h4>使用一个page面作ؓ首页</h4> <p>新徏一个page面Q加入html代码Q然后选择full htmlQ记住ID受导航到admin/settings/site-informationQ在最下面?#8220;Default front page”输入框中Q现在默认ؓnodeQ我们把它改为node/1Q注1改ؓ设ؓ首页的page面的IDP?/p> <h4>使用block区块</h4> <p>在admin/build/block中逐个定义block的显C属性,把需要显C在首页block的页面可见性(只在下列面中显C)中填 ?lt;front>Q那么这个block仅在首页可见Q修改这个block可以定刉늚内容Q同时可以增加多个block在首|C?/p> <h4>使用drupal自带?mission变量</h4> <p>$mission变量最大的特点是只能昄在首,利用q个Ҏ,我们可以轻村֮刉了。在admin/settings/site- information中定义missiondQ把首页代码写进去)Q然后编辑page.tpl.php文gQ把$missionUd到想要的位置Q如 果文件中没有q个变量Q加入以下代码即可:</p> <div php="" id="highlighter_432329"> <div> <div><a viewsource="" style="width: 16px; height: 16px;" title="view source" >view source</a> <div copytoclipboard=""><embed id="highlighter_432329_clipboard" type="application/x-shockwave-flash" title="copy to clipboard" allowscriptaccess="always" wmode="transparent" flashvars="highlighterId=highlighter_432329" menu="false" src="http://tugesha.com/wp-content/libraries/syntaxhighlighter/scripts/clipboard.swf" height="16" width="16"></div> <a printsource="" style="width: 16px; height: 16px;" title="print" >print</a><a about="" style="width: 16px; height: 16px;" title="?" >?</a></div> </div> <div> <div alt1=""> <table> <tbody> <tr> <td><code>1</code></td> <td><code plain=""><?php </code><code keyword="">if</code> <code plain="">(</code><code variable="">$mission</code><code plain="">): ?></code></td> </tr> </tbody> </table> </div> <div alt2=""> <table> <tbody> <tr> <td><code>2</code></td> <td><code>        </code><code plain=""><div id=</code><code string="">"missions"</code><code plain="">></code></td> </tr> </tbody> </table> </div> <div alt1=""> <table> <tbody> <tr> <td><code>3</code></td> <td><code>            </code><code plain=""><?php print </code><code variable="">$mission</code><code plain="">; ?></code></td> </tr> </tbody> </table> </div> <div alt2=""> <table> <tbody> <tr> <td><code>4</code></td> <td><code>        </code><code plain=""></div></code></td> </tr> </tbody> </table> </div> <div alt1=""> <table> <tbody> <tr> <td><code>5</code></td> <td><code plain=""><?php </code><code keyword="">endif</code><code plain="">; ?></code></td> </tr> </tbody> </table> </div> </div> </div> <p>以上Ҏ可以单独使用Q也可以按需要结合v来用。还有一U办法就是直接用index.html静态页面,但这已经q了drupalQ因此ƈ不推荐?/p> </div> <blockquote> <p>声明Q如蒙{载,请以链接的形式标明文章原始出处和作者信息?/p> <p>来自Q图个啥 | http://tugesha.com</p> <p>标题Q定制Drupal首页</p> <p>链接Qhttp://tugesha.com/blog/drupal/dp-design/dp-design-theme/custom-drupal-front-page/</p> </blockquote> <img src ="http://www.aygfsteel.com/sealyu/aggbug/328781.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/sealyu/" target="_blank">seal</a> 2010-08-13 14:42 <a href="http://www.aygfsteel.com/sealyu/archive/2010/08/13/328781.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Drupal专业开发指?Drupal6?(?http://www.aygfsteel.com/sealyu/archive/2010/08/13/328738.htmlsealsealFri, 13 Aug 2010 01:30:00 GMThttp://www.aygfsteel.com/sealyu/archive/2010/08/13/328738.htmlhttp://www.aygfsteel.com/sealyu/comments/328738.htmlhttp://www.aygfsteel.com/sealyu/archive/2010/08/13/328738.html#Feedback0http://www.aygfsteel.com/sealyu/comments/commentRss/328738.htmlhttp://www.aygfsteel.com/sealyu/services/trackbacks/328738.html阅读全文

seal 2010-08-13 09:30 发表评论
]]>
HowTo: Create a local environment using MAMPhttp://www.aygfsteel.com/sealyu/archive/2010/08/12/328711.htmlsealsealThu, 12 Aug 2010 12:35:00 GMThttp://www.aygfsteel.com/sealyu/archive/2010/08/12/328711.htmlhttp://www.aygfsteel.com/sealyu/comments/328711.htmlhttp://www.aygfsteel.com/sealyu/archive/2010/08/12/328711.html#Feedback0http://www.aygfsteel.com/sealyu/comments/commentRss/328711.htmlhttp://www.aygfsteel.com/sealyu/services/trackbacks/328711.htmlMAMP creates a local server environment on Mac OS X by installing PHP, MySQL, and Apache right out of the box. This will make Drupal much easier to install because the components don't have to be installed separately. This page is to be used in conjunction with the installation instructions for Drupal on Mac OS X.

Also you may want to check out this video in the Videocasts section of the handbook: Installing a Local Web Server on Mac OS X.

Download MAMP

(This will install Apache, MySQL, and PHP in one step.)
Find the latest version here: http://www.mamp.info/
Download and drag to Applications folder to install. Open MAMP and click "start servers," then "Open start page."

Download Drupal

Find the latest Drupal release here: http://drupal.org/.

Move the directory containing the Drupal files into the MAMP htdocs directory:

mv drupal-x.x.x/* drupal-x.x.x/.htaccess /Applications/MAMP/htdocs/yourdrupaldir

where yourdrupaldir is whatever you want the directory to be called.

Note: if you use Finder you may miss moving the .htaccess file which is necessary for clean URLs to work. It is generally best to download and unzip Drupal directly in the document root (default is htdocs) so you don't miss the .htaccess.

Create the Drupal database

To create a database for Drupal

  1. Go to the MAMP start page
  2. Click "phpMyAdmin"
  3. On the next page click "Databases"
  4. On the "Databases" page enter a name for your Drupal database in the "Create new database" field at the bottom of the page
  5. Select "utf8_general_ci" under the "Collation" drop-down (must be utf8!)
  6. Click "Create"
  7. Next you must create a user name with the privileges Drupal requires to use the new database
  8. Go back to the main phpMyAdmin page and click "Privileges"
  9. On the next page click "Add a new User".
  10. Fill out the "Login Information" form, making sure to change the "Host" field to "Local" and not leave it as "Any host" (for some reason Drupal will not be able to connect to your local database if you select "Any host")
  11. Leave the "None" radio button selected under the "Database for user" section, and under the "Global privileges" section leave everything unchecked
  12. Click "Go"
  13. On the next page scroll down to the "Database-specific privileges" section and select the new Drupal database you created from the dropdown
  14. Check the SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX and ALTER checkboxes and then click "Go".

You can also use a GUI such as Sequel Pro, just remember to use this as your Socket:

/Applications/MAMP/tmp/mysql/mysql.sock

Changing your password

The default username/password for your MySQL install is now root/root! For security purposes, it's always best to change this. If you're connected to the internet, this is a must.

When you are changing the default user/password from root/root, you need to do two things. Only the first is documented in the MAMP start page FAQ, but if you don't do the second then you get an error message when you try to access anything from the MAMP start page.

  1. Use command line to change the password (as documented in the MAMP start page FAQ)

    Open the terminal and type the following:
    /Applications/MAMP/Library/bin/mysqladmin -u root -p password [NEWPASSWORD]

    It will ask for the current password after you hit enter. Once you have entered that, the MySQL password is changed.

  2. Open a text editor and change the password in the three following files:
    • /Applications/MAMP/bin/phpMyAdmin-X.X.X/config.inc.php

      Find the line that reads...
      $cfg['Servers'][$i]['password']      = 'root';
      ...and change the value 'root' to your new password, retaining the quotes.

    • /Applications/MAMP/bin/mamp/index.php

      Find the line that reads...
      $link = @mysql_connect(':/Applications/MAMP/tmp/mysql/mysql.sock', 'root', 'root');
      ...and change the last parameter to your new password.

    • /Applications/MAMP/bin/stopMysql.sh

      Replace the -proot with your password. (If you don't change this one you can have zombie mysqld's running after you thought you stopped the server)

Optional: Adjust PHP's memory limit for scripts

By default, MAMP has the memory limit that a script can use set at 8MB, which is the PHP default. Looking at PHP's php.ini-recommended file, this memory limit is normally set at 128MB. To adjust this amount, open the php.ini file in a text editor and change the following line (approximately on line 232):

memory_limit = 8M      ; Maximum amount of memory a script may consume (8MB)

PHP.ini file locations:

  • /Applications/MAMP/conf/php4/php.ini
  • /Applications/MAMP/conf/php5/php.ini

In MAMP PRO, don't alter the file directly since it will be recreated at each server start. Please edit the appropriate template (menu File > Edit template > ...) instead.

Even with larger PHP memory limits you can get timeout errors trying to import large Drupal databases into MySQL. These issues are discussed at length elsewhere with regards to the cache and views cache. Generally the solution is to empty the Drupal cache before importing/exporting databases to/from MySQL.

Connect Drupal

Navigate to http://localhost:8888/yourdrupaldir/install.php and fill in the installation fields using the information provided on the MAMP start page and the name you used for the database you created in step 3.

Start configuring Drupal!

Go to http://localhost:8888/yourdrupaldir/ and create the first account.
Continue with instructions in INSTALL.txt.

If you changed your MySQL username and password you will need to modify that in your local Drupal settings.php file as well.

Temporary Files Note:

By default the File System settings (admin/settings/file-system) will place the temporary files directory inside /Applications/MAMP/tmp/php which should be changed to something like files/tmp or sites/files/tmp to avoid later confusion.

Clean up your Localhost URL

If you would like to shorten your URL from "http://localhost:8888" to "http://localhost" follow these instructions:

  • Open the MAMP application
  • Click on "Preferences" and then "Ports"
  • Change the Apache Port to 80 (the standard web server port)
In MAMP PRO, change the port of apache to 80 and click on apply.

seal 2010-08-12 20:35 发表评论
]]>
վ֩ģ壺 ǭ| ԭ| Դ| ޭ| ˮ| | | | ˮ| | ҽ| | | ʯ¥| | ¬| | ױ| | Ͼ| ԭ| | ƽ| | ͤ| | ΢ɽ| | | | | ӥ̶| ȷ| ƽ̶| ƺ| | Ұ| | ˲| ʯ| |