QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 5382|回复: 29

[文档]Drupal的零碎文档

[复制链接]
发表于 2006-4-15 18:34:34 | 显示全部楼层 |阅读模式
现在我能提供的文档就只有这些,确实不象话,但是现在专注作的事儿就是这样的。

SVN有所更新https://ako.3322.org/svn/repos/svn-LinuxFans/
添加了Word Press Multi-Users的模块支持,当然仅仅是添加了

我觉得没有必要翻译任何文档,包括INSTALL.txt,Drupal是世界的而且是透明的,我们还是看看它原本就能做到的,和我们到底对它作了哪些“手脚”

[code:1]
// $Id: INSTALL.txt,v 1.17.2.3 2006-04-15 05:07:49 涩兔子 Exp $

CONTENTS OF THIS FILE
---------------------

* Requirements
* Optional requirements
* Installation
    - Drupal administration
    - Customizing your theme(s)
* Upgrading
* More Information

REQUIREMENTS
------------

Drupal requires a web server, PHP4 (4.3.3 or greater) or PHP5
(http://www.php.net/) and either MySQL (http://www.mysql.com/)
or PostgreSQL (http://www.postgresql.org/).

NOTE: the Apache web server and MySQL database are strongly recommended;
other web server and database combinations such as IIS and PostgreSQL
are possible but tested to a lesser extent.

OPTIONAL REQUIREMENTS
---------------------

- To use XML-based services such as the Blogger API, Jabber, RSS
  syndication, you will need PHP's XML extension. This extension is
  enabled by default in standard PHP4 installations.

- If you want support for clean URLs, you'll need mod_rewrite and
  the ability to use local .htaccess files. (More information can
  be found in the Drupal handbook on drupal.org.)

INSTALLATION
------------

1. DOWNLOAD DRUPAL

   You can obtain the latest Drupal release from http://drupal.org/.
   The files are in .tar.gz format and can be extracted using most
   compression tools. On a typical Unix command line, use:

     wget http://drupal.org/files/projects/drupal-x.x.x.tar.gz
     tar -zxvf drupal-x.x.x.tar.gz

   This will create a new directory drupal-x.x.x/ containing all
   Drupal files and directories. Move the contents of that directory
   into a directory within your web server's document root or your
   public HTML directory:

     mv drupal-x.x.x/* drupal-x.x.x/.htaccess /var/www/html

2. CREATE THE DRUPAL DATABASE

   This step is only necessary if you don't already have a database
   set-up (e.g. by your host). If you control your databases through a
   web-based control panel, check its documentation for creating databases,
   as the following instructions are for the command-line only.

   These instructions are for MySQL. If you are using another database,
   check the database documentation. In the following examples,
   'dba_user' is an example MySQL user which has the CREATE and GRANT
   privileges. Use the appropriate user name for your system.

   First, you must create a new database for your Drupal site
   (here, 'drupal' is the name of the new database):

     mysqladmin -u dba_user -p create drupal

   MySQL will prompt for the 'dba_user' database password and then create
   the initial database files. Next you must login and set the access
   database rights:

     mysql -u dba_user -p

   Again, you will be asked for the 'dba_user' database password.
   At the MySQL prompt, enter following command:

     GRANT ALL PRIVILEGES ON drupal.*
        TO nobody@localhost IDENTIFIED BY 'password';

   where

    'drupal' is the name of your database
    'nobody@localhost' is the username of your webserver MySQL account
    'password' is the password required to log in as the MySQL user

   If successful, MySQL will reply with:

     Query OK, 0 rows affected

   To activate the new permissions you must enter the command:

     flush privileges;

   and then enter '\q' to exit MySQL.

3. LOAD THE DRUPAL DATABASE SCHEME

   Once you have a database, you must load the required tables into it.

   If you use a web-based control panel, you should be able
   to upload the file 'database.mysql' from Drupal's 'database'
   directory and run it directly as SQL commands.

   From the command line, use (again, replacing 'nobody' and
   'drupal' with your MySQL username and name of your database):

     mysql -u nobody -p drupal < database/database.mysql

4. CONNECTING DRUPAL

   The default configuration can be found in the
   'sites/default/settings.php' file within your Drupal installation.
   Before you can run Drupal, you must set the database URL and the
   base URL to the web site. Open the configuration file and edit the
   $db_url line to match the database defined in the previous steps:

     $db_url = "mysql://username:password@localhost/database";

   where 'username', 'password', 'localhost' and 'database' are the
   username, password, host and database name for your set up.

   Set $base_url to match the address to your Drupal site:

     $base_url = "http://www.example.com";
   
   /**
    * 这个是我们中国Linux公社采用的一个独立的Drupal安装程序支持多个站点
    */
   In addition, a single Drupal installation can host several
   Drupal-powered sites, each with its own individual configuration.
   If you don't need multiple Drupal sites, skip to the next section.

   Additional site configurations are created in subdirectories within
   the 'sites' directory. Each subdirectory must have a 'settings.php'
   file which specifies the configuration settings. The easiest way to
   create additional sites is to copy the 'default' directory and modify
   the 'settings.php' file as appropriate. The new directory name is
   constructed from the site's URL. The configuration for www.example.com
   could be in 'sites/example.com/settings.php' (note that 'www.' should
   be omitted if users can access your site at http://example.com/).
   在./sites目录下,我们可以定义多个站点,比如默认的Linuxfans站点就使用
   ./sites/default,涩兔子的Freesys.cn就使用./sites/freesys。
   比如,./sites/default/settings.php就用来界定哪些数据表是属于Linuxfans的。
   Drupal采用了DNS的数据源的格式:
   $db_url = '数据库类型://数据库用户名:数据库用户密码@数据库地址/数据库名称';
   $db_url = 'mysql://root:123456@localhost/linuxfans';
   $db_prefix = array(
    Linuxfans独有的数据表,使用default_表前缀
    'default'           => 'default_',
    和其他站点共享的数据表,使用shared_表前缀
    'users'             => 'shared_',
    'users_roles'         => 'shared_',
    'sessions'          => 'shared_',
    'role'              => 'shared_',
    'authmap'           => 'shared_',
    'sequences'         => 'shared_',
   );

   那么,针对其他的站点,如Freesys的,就可以在./sites/freesys/settings.php里面
   告诉Drupal:
   $db_prefix = array(
    Freesys独有的数据表,使用freesys_表前缀
    'default'           => 'freesys_',
    和其他站点共享的数据表,使用shared_表前缀
    'users'             => 'shared_',
    'users_roles'         => 'shared_',
    'sessions'          => 'shared_',
    'role'              => 'shared_',
    'authmap'           => 'shared_',
    'sequences'         => 'shared_',
   );
   
   当然,Drupal可以支持更多的站点,分享users, users_roles, sessions, role, authmap,
   sequences表,而独立一些需要各自站点单独存放信息的表。
   Sites do not each have to have a different domain. You can use
   subdomains and subdirectories for Drupal sites also. For example,
   example.com, sub.example.com, and sub.example.com/site3 can all be
   defined as independent Drupal sites. The setup for a configuration
   such as this would look like the following:

     sites/default/settings.php
     sites/example.com/settings.php
     sites/sub.example.com/settings.php
     sites/sub.example.com.site3/settings.php
   为了方便大家的使用,我在./database/中shared_database.mysql、default_database.mysql、
   freesys_database.mysql来作为例子,让大家可以方便导入到数据库里。
   当然,为了符合您的多站点需求,您需要自定义数据表前缀,比如linuxsir_、linuxsky_等。
   使用vi的 : %s/freesys_/linuxsir_/g 作群替换就可以。
   When searching for a site configuration (for example
   www.sub.example.com/site3), Drupal will search for configuration
   files in the following order, using the first configuration it finds:

     sites/www.sub.example.com.site3/settings.php
     sites/sub.example.com.site3/settings.php
     sites/example.com.site3/settings.php
     sites/www.sub.example.com/settings.php
     sites/sub.example.com/settings.php
     sites/example.com/settings.php
     sites/default/settings.php

   Each site configuration can have its own site-specific modules and
   themes that will be made available in addition to those installed
   in the standard 'modules' and 'themes' directories. To use
   site-specific modules or themes, simply create a 'modules' or
   'themes' directory within the site configuration directory. For
   example, if sub.example.dom has a custom theme and a custom module
   that should not be accessible to other sites, the setup would look
   like this:

     sites/sub.example.com/:
       settings.php
       themes/custom_theme
       modules/custom_module

   NOTE: for more information about multiple virtual hosts or the
   configuration settings, consult the Drupal handbook at drupal.org.

5. CONFIGURE DRUPAL

   You should consider creating a "files" subdirectory in your Drupal
   installation directory. This subdirectory stores files such as
   custom logos, user avatars, and other media associated with your
   new site. The sub-directory requires "read and write" permission
   by the Drupal server process. You can change the name of this
   subdirectory at "Administer > Settings > File system settings".

   You can now launch your browser and point it to your Drupal site.

   Create an account and login. The first account will automatically
   become the main administrator account with total control.

6. CRON TASKS

   Many Drupal modules (such as the search functionality) have periodic
   tasks that must be triggered by a cron job. To activate these tasks,
   call the cron page by visiting http://www.example.com/cron.php --
   this will pass control to the modules and the modules will decide if
   and what they must do.

   Most systems support the crontab utility for scheduling tasks like
   this. The following example crontab line will activate the cron
   tasks automatically on the hour:

   0   *   *   *   *   wget -O - -q http://www.example.com/cron.php

   More information about the cron scripts are available in the admin
   help pages and in the Drupal handbook at drupal.org. Example
   scripts can be found in the scripts/ directory.

DRUPAL ADMINISTRATION
---------------------
您肯定要用到Drupal的管理功能,因为我们需要把苗条的Drupal喂胖,在管理 > 模块里,
您可以添加discuz.module、download.module、linuxfans.module等,后面两个模块是
Drupal官方的猪友编写的即:fckeditor.module(所见即所得Web编辑器)、phpbb.module。
由于discuz.module、download.module、linuxfans.module需要作的工作不仅仅是安装好
模块就能跑的,比如discuz.module就需要借助./update/phpbb2discuz.php,并且您需要
已经安装好Discuz!并且打开了Discuz!的用户通行证接口,这些让我都觉得很像针线活的
事儿在这个INSTALL文档里肯定不能讲解得一清二楚。而download.module和linuxfans.module
属于把原有Linuxfans使用的phpnuke的相关模组模拟到Drupal里,在这里根本无法讲解Drupal
对模块的钩子函数的作用——如何调用download.module、linuxfans.module中的用户自定义API。
而且download.module、linuxfans.module模块的SQL文件,似乎我还没有纳入SVN版本控制,
我需要更专注的做好眼球前面的事儿,而不是被N多事儿围住,反而一件事儿都没有做好。
不过,您可以先体验fckeditor.module,这个模块不需要额外的数据库,而且很实用。或者您
可以到Drupal的官方站点下载几个带数据库的模块,安装体验一下。
您可以浏览http://drupal.org/node/508有关模块开发的Drupal提供的官方文档,我也是参照
这些文档,并对照Drupal现有的模块进行的二次开发。
很抱歉的是,我现在只能做到这么多先,还是那句老话:踏踏实实地把眼球前面的事儿做好先。

Upon a new installation, your Drupal website defaults to a very basic
configuration with only a few active modules, one theme, and no user
access rights.

Use your administration panel to enable and configure services. For
example, set some general settings for your site with "Administer >
Settings". Enable modules via "Administer > Modules". User permissions
can be set with "Administer > Users > Configure > Permissions".

For more information on configuration options, read through the
instructions which accompany the different configuration settings and
consult the various help pages available in the administration panel.

Community-contributed modules and themes are available at http://drupal.org/.

CUSTOMIZING YOUR THEME(S)
-------------------------

Now that your server is running, you will want to customize the look
of your site. Several sample themes are included in the Drupal
installation and more can be downloaded from drupal.org.

Customizing each theme depends on the theme engine. In general, each theme
contains a PHP file themename.theme which defines a function header()
that can be changed to reference your own logos.

Most themes also contain stylesheets to tune the colors and layouts;
check the themes/ directory for READMEs describing each alternate theme.

UPGRADING
---------

1. Backup your database and Drupal directory - especially your
   configuration file in 'sites/default/settings.php'.

2. Log on as the user with user ID 1.

3. Remove all the old Drupal files then unpack the new Drupal
   files into the directory that you run Drupal from.

4. Modify the new configuration file to make sure
   it has the latest and correct information.

5. Run update.php by visiting http://www.example.com/update.php.

MORE INFORMATION
----------------

For platform specific configuration issues and other installation and
administration assistance, please consult the Drupal handbook at
http://drupal.org/. You can also find support at the Drupal support
forum or through the Drupal mailing lists.


[/code:1]
发表于 2006-4-15 20:00:26 | 显示全部楼层
我最近也准备在做drupal的module扩展。
回复

使用道具 举报

发表于 2006-4-15 20:13:33 | 显示全部楼层


那我预定一个下载模块,最好和 skycn 下载的设计差不多,当然我不需要那么花的页面。
还有文章系统,就按照新闻网站那么设计。
还有图像系统,最好像 MSN space 那样子。

暂时先这么多。
回复

使用道具 举报

发表于 2006-4-15 22:30:04 | 显示全部楼层
支持兔子
马上看看,然后试

顺便问一下,安装的步骤和方法与Drupal官方版本没差别吧?
回复

使用道具 举报

 楼主| 发表于 2006-4-16 13:18:53 | 显示全部楼层
[quote:7ad34ca5da="mandrakechina"]我最近也准备在做drupal的module扩展。[/quote]

只用了解Drupal的钩子函数,就可以动手玩Drupal的模块了
http://drupal.org/node/55243
回复

使用道具 举报

 楼主| 发表于 2006-4-16 13:27:15 | 显示全部楼层
[quote:b20c15cf2c="cnhnln"]支持兔子
马上看看,然后试

顺便问一下,安装的步骤和方法与Drupal官方版本没差别吧?[/quote]

差别就在Multi-Sites的应用:
1. 在./sites/下建立多个和多站点应用对应的settings.php
2. 导入的数据库表前缀需要使用vi的 : %s/defalut_/other_/g进行群替换

现在SVN里的Drupal在公司内部就在使用,作为我们的IPTV中间件工作日志和技术讨论的地方。

昨晚您问我Drupal一片空白的原因,如果是Drupal cache的BUG,搜索一下吧http://drupal.org/search/node/cache
猪头的cache存在解决不同cache应用的BUG,这也是通用性和特殊性的悖论,我觉得没有解决的办法,唯一就是关掉Drupal自身的cache。

这个周末仅仅作了Drupal的零碎文档
回复

使用道具 举报

发表于 2006-4-16 18:44:21 | 显示全部楼层
[quote:97a446f72f="涩兔子"][quote:97a446f72f="mandrakechina"]我最近也准备在做drupal的module扩展。[/quote]

只用了解Drupal的钩子函数,就可以动手玩Drupal的模块了
http://drupal.org/node/55243[/quote]我知道。但我主要是想要把Drupal当成现成的B/S基础来用,有点背离drupal的CMS功能。p4a觉得很麻烦,而且表现层的东西比较少。用drupal的话,很多很流行的东西可以马上搞进来,比如ajax
回复

使用道具 举报

发表于 2006-4-16 20:24:58 | 显示全部楼层

猪跑是 CMS ??
我怎么从来没感觉到…………
回复

使用道具 举报

发表于 2006-4-16 22:07:19 | 显示全部楼层
多谢兔子!
能否在官方的基础上安装单独安装你写的dz和download模块阿?另外问下有无BT索引的模块?
麻烦兔子鸟
回复

使用道具 举报

 楼主| 发表于 2006-4-17 11:11:21 | 显示全部楼层
1.Discuz!论坛解压缩在./modules/discuz/下,安装Discuz!先

2.然后discuz.module直接在Drupal的模块管理里安装

3.参考Discuz!压缩包里docs介绍的用户通行证,在Discuz!中把通行证API打开

下载模块的SQL文件没有版本控制,还在我的本地作测试
回复

使用道具 举报

发表于 2006-4-17 22:01:19 | 显示全部楼层
好的,我马上试试看。4.7上能否跑?
赶快把下载和BT索引完成阿
催催你,呵呵
回复

使用道具 举报

发表于 2006-4-18 00:35:10 | 显示全部楼层
我不要散兵游勇
回复

使用道具 举报

发表于 2006-4-24 13:37:37 | 显示全部楼层
user error: Table 'discuz.blocks' doesn't exist
query: SELECT * FROM blocks WHERE status = 1 AND region IN (1) ORDER BY weight, module in /var/www/html/includes/database.mysql.inc on line 66.

安装dz有何要求阿?需要和drupal一个数据库?表的前缀需要改动吗?
回复

使用道具 举报

 楼主| 发表于 2006-4-24 17:32:54 | 显示全部楼层
是discuz_block这个钩子出现的提示

嗯,discuz解压缩到./modules/discuz下为好,也可以在drupal中设置的,discuz.module的discuz_settings就在作这个
嗯,把discuz的数据表安装在同drupal的数据库里,表前缀不需要修改_discuz_prefix已经把discuz的表前缀读取出来了

最近一直在忙我们美媒的IPTV运营系统,公社的程序放到我们美媒产品卖出去以后在好好的作
回复

使用道具 举报

发表于 2006-4-24 18:57:22 | 显示全部楼层
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-11-17 00:51 , Processed in 0.046374 second(s), 16 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表