Вы находитесь на странице: 1из 27

c 


 
c  
   

Effective Web design is driven by the need to balance flexibility and simplicity. If a system is
too simple, it can only be used for a single purpose - but if it is too flexible, it may be too
difficult for new users to learn.

Drupal strives to reconcile these conflicting goals by providing its users with the tools they need
to make their own content management solution, while still providing some prebuilt components
to help them get started. Thus, it can be described both as a content management system (CMS)
and a content management framework (CMF) - one system which strives to have the strengths of
both, without their deficiencies.

Most CMS's are like a toy boat or toy truck - specific assumptions have been made about their
use, assumptions it would be hard for you to override. Frameworks, on the other hand, provide
you with raw materials only - you need to know a programming language, and have a clear
design vision, to put them together.

Drupal is like a Lego kit. Skilled developers have already made the building blocks - in the form
of contributed modules - that you need to create a site that suits your needs, whether that is a
news site, an online store, a social network, blog, wiki, or something else altogether.

  

To make the contrast between Drupal and other CMS's more concrete, consider the example of a
news site. You want to be able to post news articles on the site, and you want the homepage to
have a section featuring the five most recent ones. Next, you decide that you want to add a blog
section, and put a list of links to the five most recent of blog entries on the homepage as well.

If you were using an ordinary CMS, first you would install a plugin that handled news articles
and could put short blurbs on the homepage. Next, you¶d install a plugin that would track the
latest blog posts and put a list of those on the homepage. Each plugin would only be responsible
for tracking and managing a particular kind of content, and would remain relatively isolated from
the others.

But, what happens when you have that brilliant middle-of-the-night idea, and want to blend these
two functions by showing a list of blog posts ?  the latest news items, ordered by most active
contributor first? If you¶re using a ³toy truck´ CMS, you may be out of luck, or need to hire a
developer to write you a custom plugin from scratch. But through the power of the Drupal way,
the way of manageable abstraction, you can whip out a kit full of parts and knock this together
pretty quickly. (Hint: just use Views.) Since Drupal's modules do things in a standard way, and
interface with a common underlying system, building all sorts of clever, customized features is
just a matter of snapping parts together.
ÿf course, this flexibility comes at a certain cost. While a toy truck is instantly understandable
and ready to use without much thought, a modular vehicle construction kit will by nature require
you to read the instruction manual first. The building blocks are out there, but you'll need to learn
how they fit together before you can take a paper prototype and turn it into a fully-featured
website.

Drupal core, and the thousands of contributed modules that build on it, require an initial
investment to learn, but mastering the Drupal way is immensely rewarding. Drupal's passionate
community is a testament to its power to liberate site builders from the simplicity/flexibility
dilemma. ÿnce you've tried Drupal, you'll likely leave your toy truck and boat in the closet
gathering dust.

£ 

Intrigued yet? Let's take a closer look at how Drupal works.

People often think of a website as a collection of static pages, with some functions (like a blog,
or a news engine) thrown in to round it out. When they go to manage their site, they are thinking
in terms of a tree-like hierarchy of pages that they will go in and edit.

Drupal, on the other hand, treats most content types as variations on the same concept: a 
(more on this in a moment). Static pages, blog posts, and news items (some possible node types)
are all stored in the same way, and the site's navigation structure is designed separately by
editing menus, views (lists of content), and blocks (side content which often have links to
different site sections).

It¶s a lot like the separation you find in standards-compliant page coding²XHTML provides the
meaningful structure of the information, while CSS arranges it for presentation. In Drupal, nodes
hold the structured information pertaining to a blog post (such as title, content, author, date) or a
news item (title, content, go-live date, take-down date), while the menu system, as well as
taxonomy (tagging of content) and views, create the information architecture. Finally, the theme
system, along with display modules like Panels, controls how all this looks to site visitors.

Since these layers are kept separate, you can provide a completely different navigation and
presentation of your content to different users based on their specific needs and roles. Pages can
be grouped differently, prioritized in a different order, and various functions and content can be
shown or hidden as needed.

ë c 


We don't talk about "nodes" every day, but since they are at the heart of Drupal's design, they
deserve further investigation. At its most basic, a node is a set of related information. When you
create a new blog post, you are not only defining its body text, but also its title, content, author
link, creation date, taxonomy (tags), etc. Some of these elements will be shown by the theme
layer when the node is displayed. ÿthers are meta-data that control when the node will show up
at all - such as taxonomy or publishing status.
Since each item of content is stored as a node, and contains the same basic information, each can
be handled in a standard way by both Drupal core and contributed modules. This allows site
builders to choose exactly where they want content to show up, and exactly how they want it to
look in each case. Most of a Drupal site builder's time is spent defining what kinds of
information you want to store in your nodes, and configuring the structures (menus, taxonomy
trees, views, panels) in which to display them.

As suggested before, you aren't limited to a single way of presenting your site's content. You can
define as many navigation schemes, custom themes ("skins" for the site), blocks (small bits of
content, such as the five most recent blog articles described earlier), and feature sets as there are
distinct audiences for your site.

Comments are second-class citizens in Drupal compared to nodes, but they also illustrate the
Drupal way. Comments aren¶t just part of the blog system, since there isn't a separate "blog
system." Comments can be enabled on any node type you choose - blog posts, news items, book
pages (which provide basic wiki features) and any other you may create.

3 

Creating an informational website that broadcasts from ³one to many´ is something that most
CMSs do right out of the box. However, where Drupal really shines is when you want to
empower site users to create content, and connect with each other - moving from "one to many"
to "many to many."

With some CMS's, you can set up a blog, and you can install plugins to handle having a
community of users, but what happens when you want to give individual blogs to each of your
users, sorting their contents so that they can be displayed individually with their own skins, while
also generating cross-blog topical digests, top five lists, and links out to elaborate, customized
user profiles? What if you want to also integrate that in with forums, a wiki-like environment,
and give each user their own gallery of taggable photos?

Drupal is designed from the ground up so site builders can delegate content creation, and even
site administration, to users. All you have to do is define who gets to do what on your site
(through user permissions), and then you can start collaborating.


  


Drupal's flexibility is incredible, but installing it is surprisingly easy. With a simple FTP upload
and a few short web-based configuration questions, you can connect with your database and have
your first Drupal site up and running within an hour.

Pick one of the included themes, and just start adding content. Do you want to have visitors log
in? Switch authentication on or off. Want to switch on some of the included tools? Turn on
forums; enable commenting on node types; turn on the book module for wiki-like collaboration;
create forums and polls; use taxonomy to give site content structured, hierarchical categorization
or free-form tagging.
Do you want your own skin applied to the site? Drupal's theme system uses tiny snippets of PHP
that you can insert into the appropriate spots in your design to replace your placeholder ½

 text with dynamic content. Drupal¶s generated markup is clean, standards-compliant
XHTML. No old-school tables. No cruft. No kidding.

 

If you want to go deeper with Drupal, you should understand how information flows between the
system's layers. There are five main layers to consider:

1.Ê At the base of the system is the collection of nodes²the data pool. Before anything can
be displayed on the site, it must be input as data.
2.Ê The next layer up is where modules live. Modules are functional plugins that are either
part of the Drupal core (they ship with Drupal) or they are contributed items that have
been created by members of the Drupal community. Modules build on Drupal's core
functionality, allowing you to customize the data items (fields) on your node types; set up
e-commerce; programmatically sorting and display of content (custom output controlled
by filters you define); and more. There are thousands of different options within the fast-
growing repository of contributed Drupal modules. They represent the innovation and
collaborative effort of everyone from individuals to large corporations.
3.Ê At the next layer, we find blocks and menus. Blocks often provide the output from a
module or can be created to display whatever you want, and then can be placed in various
spots in your template (theme) layout. Blocks can be configured to output in various
ways, as well as only showing on certain defined pages, or only for certain defined users.
4.Ê Next are user permissions. This is where settings are configured to determine what
different kinds of users are allow to do and see. Permissions are defined for various roles,
and in turn, users are assigned to these roles in order to grant them the defined
permissions.
5.Ê ÿn the top layer is the site theme (the "skin"). This is made up predominantly of XHTML
and CSS, with some PHP variables intermixed, so Drupal-generated content can go in the
appropriate spots. Also included with each theme is a set of functions that can be used to
override standard functions in the modules in order to provide complete control over how
the modules generate their markup at output time. Templates can also be assigned on-the-
fly based on user permissions.

This directional flow from bottom to top controls how Drupal works. Is some new functionality
you want not showing up? Perhaps you uploaded the module into the system but have not
activated it yet, and this is making everything downstream non-functional (as in "A" in the
diagram above).

Maybe the module is installed and activated, but you still don¶t see what you want on your site.
Did you forget to place the block, as in "B"? ÿr are your user permission settings conflicting
with what you want and your users are not set to see the output as in "C"?

Additionally²as mentioned earlier²getting the kind of granular control you want over the
details of the XHTML module outputs requires understanding this flow. Are you using a module
that does exactly what you want, only you wish the markup was just a little bit different? Maybe
you¶d like it to use different tags, or you¶d like to assign a CSS class to something? You
accomplish this by copying the output function from the module and pushing it up to the
functions document in your theme. Modify the code there, and when the system goes to output, it
will see your customized function and use that instead.

À    
Drupal provides an installation script that automatically populates database tables and configures
the correct settings in the settings.php file. This section covers preparing for installation, running
the installation script itself, and the steps that should be done after running the installation script
has completed. It also explains how to do a "multi site" installation, where a number of different
Drupal sites run off the same code base.
Before proceeding with your first Drupal installation, you should also review the best practices
section. For help with Drupal terms, see the terminology page.

ÿ 

Some of the steps in the installation process can be performed with tools such as graphical
applications for moving files and managing databases or tools that are provided by your hosting
service. This documentation focuses on performing tasks at the command line. For information
on using other tools, see the documentation that accompanies the application or is provided by
your hosting service.

3   

It is considered a good practice to do all development work on a separate test site before making
changes to a production site. A test site allows you to evaluate the impact of upgrades, new
modules, modifications to themes etc. without causing disruption to your live site. For
information about setting up a web server on a local computer, see the Local Server Setup
section of the Developing for Drupal guide.

     

Some web hosting companies offer "one-click" installations of Drupal, or specific Drupal
support. You may be able to locate one on the Drupal hosting handbook page.

There is also a handbook page listing Drupal distributions, which include installation profiles and
pre-packaged distributions of Drupal and modules. These may be of help as well.

a   


X

A minimum base installation requires at least 3MB of disk space but you should assume that
your actual disk space will be somewhat higher. For example, if you install many contributed
modules and contributed themes, the actual disk space for your installation could easily be 40
MB or more (exclusive of database content, media, backups and other files).

A useful FAQ (http://drupal.org/node/59680) explains how to use phpinfo to get the details of
your system. For example, phpinfo will tell you if you have a database already installed and what
version your system is running. Phpinfo will also tell you what php variables are set as well as
many other helpful things.

d

Drupal has been deployed successfully on both Apache and IIS.


Apache (Recommended)

aÊ Drupal will work on Apache 1.3 or Apache 2.x hosted on UNIX/Linux, OS X, or Windows. The
majority of Drupal development and deployment is done on Apache, so there is more
community experience and testing performed on Apache than on other web servers.
aÊ Ôou can use the Apache 'mod_rewrite' extension to allow for clean URLs.

Microsoft IIS

aÊ Drupal core will work using IIS 5, IIS 6, or IIS 7 if PHP is configured correctly.
aÊ To achieve clean URLs you may need to use a third party product. For IIS7 you can use the
Microsoft URL Rewrite Module or a third party solution.
aÊ When using Drupal on IIS 7 with fastcgi you must install Hotfix kb954946, or wait until the hotfix
appears in a package update (recommended). KB954946 was included in Windows 2008 Server
SP2

Drupal is being developed to be web server independent, but we have limited or no reports of
successful use on web servers not listed here.

The total file size of your Drupal installation will depend on what you add to your site, but
Drupal @ files alone will take up approximately 2 to 3 MB uncompressed. The exact size
depends on the version of Drupal you have installed.


X   
!"#$    %&

aÊ Drupal 5.x and earlier supports MySQL 3.23.17 or higher. MySQL 4.1 or higher is strongly
recommended.
aÊ Drupal 6 supports MySQL 4.1 or higher.
aÊ Drupal 7 will only support MySQL 5.0.15 or higher, and requires the PDO database extension for
PHP (see PHP section below).

There are several drop-in replacements for MySQL. Drupal has been extensively tested with
MariaDB, and version 5.1.44 (or greater) is recommended. It is also likely that other drop-in
replacements will work well with Drupal, but they have not specifically undergone testing.

ë cDrupal makes use of some features not available on some inexpensive hosting plans so
please check that your host allows database accounts with the following rights:
SELECT, INSERT, UPDATE, DELETE, CREATE, DRÿP, INDEX, ALTER.
These rights are sufficient to run Drupal core 6.x.

Some contributed modules, and also Drupal core 5.x (but not Drupal core 6.x), additionally
require the following rights:
cc ca,  ca.
ë  If your system/host is running MySQL 4.1 or newer and you receive the error "Client does
not support authentication protocol requested by server", address the problem by following the
instructions provided by MySQL AB. There is a minor ÿS issue with some MySQL 5+
installations primarily on Windows but affecting some versions of Unix/Linux as well.

ë  When using Drupal 5.x or later, particularly with contributed modules, it may be necessary
to set the system variable max_allowed_packet to at least 16M. Some inexpensive hosting plans
set this value too low (the MySQL default is only 1M). In that case, you may need to choose a
better hosting plan. A value of 1M may be sufficient for 5.x.

ë  Drupal supports MyISAM and InnoDB table types. NDB tables (MySQL Cluster) are not
supported.

Note that if your web hosting account is set up with a graphic control panel such as Plesk or
CPanel, it is very likely that you do not need to worry about installing a driver for MySQL -- it is
probably already installed on your server. You might wish to simply create your database and
proceed with installing Drupal, and then refer back to Drupal documentation for specific
troubleshooting help if you run into problems.

-!"#

Note: Some contributed modules are not as abstracted from MySQL-specific code as everyone
would like. If you are familiar with PostgreSQL please file issues with those contributed
modules as you find them.

aÊ Drupal 6 supports PostgreSQL 7.1 or higher


aÊ Drupal 7 will only support PostgreSQL 8.3 or higher
aÊ PHP 5.2.6 for Windows has a bug in its pgsql extension. Ôou will need to replace it with the
php_pgsql.dll from version 5.2.5.

!"#'()* 


Note: Some contributed modules are not as abstracted from MySQL-specific code as everyone
would like. If you are familiar with SQLite please file issues with those contributed modules as
you find them.

ÿ   

Microsoft SQL Server and ÿracle are supported by an additional module.

Please see discussions in the Enterprise Group if you are interested in working on database
support.
-£-

Recommended: PHP 5.2.x


Required: PHP version 4.4.0 or higher (Contributed modules may not support this version of
PHP)

aÊ PHP 5.3 is not yet supported by Drupal 5.x, but is supported by Drupal 6.14 core and higher (see
the release notes for 6.14) and also by Drupal 7.x. Note that some contributed modules may not
be compatible with PHP 5.3, and that some PHP 5.3 configurations still show warnings with
Drupal 6.14; work is ongoing to resolve the latter in #360605: PHP 5.3 Compatibility.
aÊ PHP 5.2 or higher will be a requirement for Drupal 7.
aÊ PHP memory requirements can vary significantly depending on the modules in use on your site.
Drupal 6 core requires PHP's Ô ÔÔ to be at least 16MB, and Drupal 7 core requires
32MB. Warning messages will be shown if the PHP configuration does not meet these
requirements. However, while these values may be sufficient for a default Drupal installation, a
production site with a number of commonly used modules enabled (CCK, Views etc.) could
require 64 MB or more. Some installations may require much more, especially with media-rich
implementations. If you are using a hosting service it is important to verify that your host can
provide sufficient memory for the set of modules you are deploying or may deploy in the future.
(See the Increase PHP memory limit page in the 
   for additional information
on modifying the PHP memory limit.)
aÊ The PHP extension for connecting to your chosen database must be installed and enabled.
Drupal's currently supported database connectors are: mysql (the original MySQL extension),
mysqli (an improved connector for newer MySQL installations), and pgsql (for PostgreSQL). Note:
PHP 5.x no longer enables the mysql extension by default. Please read the links above for
installing and enabling your chosen connector. Additionally, Drupal 6.x does not provide the
option to select the mysql connector if mysqli is enabled in your PHP configuration.
aÊ PHP XML extension (for Blog API, Drupal, and Ping modules). This extension is enabled by
default in a standard PHP installation; the Windows version of PHP has built-in support for this
extension.
aÊ An image library for PHP such as the GD library is needed for image manipulation (resizing user
pictures, image and imagecache modules). GD is included with PHP 4.3 and higher and usually
enabled by default. ImageMagick is also supported for basic image manipulations in Drupal core
but there is much less support from contributed modules.
If you have administrator rights on a Debian/Ubuntu server, and GD is  already available (see
your phpinfo) it can usually be installed by going:
sudo apt-get install php5-gd
or on Redhat/Centos:
sudo yum install php-gd
See the ImageMagick install instructions for your platform if you want that.
aÊ PHP  the following configuration directives for Drupal to work (only directives that differ
from the default php.ini-dist / php.ini-recommended):
oÊ register_globals: off; this is the default value, but some hosts have it enabled
oÊ error_reporting set to E_ALL & ~E_NOTICE. Work is ongoing to change this to E_ALL for
Drupal 6 and Drupal 7.
oÊ safe_mode: off. Safe mode may interfere with file and image uploads.
oÊ Php Data Objects (PDO) must be activated for Drupal 7 to install and run correctly. Look
in your php.ini. Uncomment (remove the leading semicolon) at line
extension=php_pdo.dll, extension=php_pdo_mysql.dll. If these lines are not there, you
will need to add them. The PECL version of PDO is not compatible with Drupal 7 and
cannot be used. More information can be found on the What is PDO page.
oÊ In addition, we  ÔÔ  the following setting: session.cache_limiter: nocache
aÊ Some of these settings are contained in the default .htaccess file that ships with Drupal, so you
shouldn't need to set them explicitly. Note, however, that setting PHP configuration options
from .htaccess only works under the following conditions:
oÊ With Apache (or a compatible web server)
oÊ If the .htaccess file is actually read, i.e. AllowOverride is not None
oÊ If PHP is installed as an Apache module
aÊ See the PHP manual for how to change configuration settings for other interfaces to PHP.
aÊ Drupal 7 may require the time parameter to be at least 30 seconds.
aÊ In some shared hosting environments, access to these settings is restricted. If you cannot make
these changes yourself, please ask your hosting provider to adjust them for you.

   


Websites built using just Drupal core (i.e. with no additional, contributed modules) are
compatible with, and fully functional, in all modern browsers that support CSS and JavaScript.
However, browsers have varying levels of compliance with Internet standards such as CSS 2, so
there may be minor variations in appearance.

Here is an incomplete list of browsers that are known to work well with Drupal core and support
all of its features:

aÊ Internet Explorer 6.x and later


aÊ Firefox 2.x and later
aÊ Opera 7 and later
aÊ Safari 1.x and later
aÊ Camino 1.x and later
aÊ Google Chrome

It is also possible to use a browser that does not support JavaScript with Drupal, although the
functionality will of course be slightly different. For instance, in Drupal 6 running in a browser
with JavaScript enabled, you can use a drag-and-drop interface to position blocks on the Blocks
administration page (admin >> site building >> blocks). If you don't have JavaScript, you will
still be able to position blocks, but you will use an interface more like Drupal 5, where you will
assign numerical weights to the blocks.

It is also possible to use a browser that does not support CSS with Drupal, but of course the site
will not look very similar to how it looks in a browser that does support CSS.

Some contributed modules and themes may not be compatible with all browsers. If you find a
problem with browser compatibility in a contributed module or theme, or some functionality in a
contributed module that does not work at all without JavaScript enabled, please submit an issue
to report it to the module or theme maintainer.
U  +

It's worth mentioning here that IE6 has an problem with loading more than 30 stylesheets, and
it's fairly easy to run into this problem once you start adding contrib modules.

   
There are no definite figures available for Drupal's resource requirements. They will vary
depending on what modules you have installed, how many users you have, and what proportion
log in rather than browse anonymously.

In the absence of definite information, here are some relevant discussions:

Need suggested baselines for Server Resource Requirements

It would help to know baseline requirements for Drupal and just the Core Modules:

- Simultaneous MySQL Connections


- Simultaneous PHP Connections
- CPU Thresholds

The following discussions state:

"Drupal regularly makes more than 100 queries per page load"
(Does 1 query = 1 connection?)

http://drupal.org/node/190070

Some combinations of modules and options have a big impact and would be worth measuring in
D7. Menu entries expanded for drop down menus + path aliases + logged in users in D6:
http://drupal.org/node/625898 Executed 595 queries in 207 milliseconds.

"Is it reasonable to expect 100s of simultaneous connections"

http://drupal.org/node/312868

 

The Devel module, http://drupal.org/project/devel, counts database calls and execution times.

Firefox Firebug measures and displays the download times within the browser. See the overhead
of adding Google analytics to a page. (for many sites, it is the slowest download.) See the
overhead of splitting a CSS file into two files for easier maintenance. See the time saved by
Drupal CSS and Javascript merging.
Measure your Drupal 6 configuration and modules to see what has the greatest impact on
performance then look in the issues to see if there are major changes for the D7 versions.

Measure for both anonymous users and logged in users. A feature might add hundreds or
thousands of database calls. That extra overhead might occur once every 5 minutes for
anonymous users and once every page for logged in users.

Remeasure after adding a module. When you add a cloud display module, you might add a read
of every node for every display. You might find an alternative module that performs the reads
less frequently and caches the result.

Remeasure after changing a setting. An example: Adding path aliases in Drupal 6 had the side
effect of adding a database call for every entry in the menu, a significant difference for logged in
users. Combine that with hidden entries behind drop down menus and you could have a big
overhead. Now do something as simple as listing your main menu and select 6
? for items
with a lot of children. You could be adding hundreds of menu entries to an otherwise small small
menu. A logged in user will get a fresh menu on every page view.

Remeasure after changing themes. Some themes add their own file and database accesses. Run
Firebug to compare the CSS and Javascript file downloads, especially if the theme creates
problems with CSS or Javascript merging.

Check known Drupal 6 performance problems in D7. Some parts of D7 are different and some
parts hardly changed. If you know of something that had a big impact in D6 then check it in D7.
Where the impact is similar, either document the problem or open an issue for possible
improvement.

Check the impact of Fields in your favourite add on modules. An add on module in D6 might
add a special table with one row per node. In D7 the same module might add a field to the
existing node fields. The change from separate tables to a single table might make things faster
by reducing accesses. The change might also slow things down because the separate table uses
an index for a lookup while the merged table uses a standard row by row search. It is worth
reporting the results, both positive and negative, to the module developers.

d   
PDÿ is an acronym for PHP Data ÿbjects. PDÿ is a lean, consistent way to access databases.
This means developers can write portable code much easier. PDÿ is not an abstraction layer like
PearDB. PDÿ is a more like a data access layer which uses a unified API (Application
Programming Interface).

£  -ÿ

To enable PDÿ configure --enable-pdo and --with-pdo_sqlite --with_pdo_mysql or whatever


database needs supporting by PDÿ.
d  

aÊ  , you will need to make sure php_pdo.dll and php_pdo_mysql.dll exist in the php/ext
directory, un-comment or add the appropriate lines in php.ini, and restart the web server.
aÊ  
, PDO DLLs are not enabled by default. The preferred method for enabling them is to go to
the Control Panel | Add/Remove Programs, highlight your PHP installation and click "Change"
(Change/Remove - XP). Specify "FastCGI", then modify the installed extensions to include these
two, then restart your server.

   
The following is a simple guide to create a Drupal site in a few easy steps. You can also skip to
the command line quick install guide for developers, read a more detailed version of these
instructions, or check out the installation troubleshooting guide.

To follow these steps, you will need a SFTP client such as WinSCP or FileZilla, and a web
server that meets a few basic requirements (e.g. a web server such as Apache, a database such as
MySQL, and PHP.)

First there are steps for Drupal 7, then for Drupal 6 below. They are very similar.

*
!,  

aÊ Download the latest version of Drupal 7.


aÊ Ôou will get a file called drupal-x.x.tar.gz. Extract the Drupal files.
aÊ Log into your server using your SFTP client and navigate to the web root directory. Upload all
the files inside your drupal folder into the web root folder.

!- 3

aÊ Create a new database through your hosting provider's control panel. Make a note of the
database name.
aÊ Create a user, add that user to the database, and grant the user full rights on the database.
Make a note of the username and password.

!'   .


 (

aÊ For example, on a Unix/Linux command line, use this command: @hmod a+w sites/default

!/ + 

aÊ Browse to your new Drupal site. This will take you to the Drupal installer, which starts with:
"Select an installation profile." Save and continue.
aÊ Choose "Standard." Save and continue.
aÊ Choose English or learn how to install Drupal in other languages. Save and continue.
aÊ Choose the type of database you created (e.g. MySQL or SQLite). Enter the name of the
database you created, the username, and password. Save and continue.
aÊ On the site information page, you can set the site name and email from which the site will send
out mail. Ôou also set the username, email, and password of the first administrator account.
Save and continue.
aÊ Log in to your new Drupal site.

a     


 

To run the install script point your browser to the base URL of your website.

The base URL is defined in your Web server configuration file and is specific to the document
root where you placed your Drupal files. If you have installed Drupal on a Web server this will
likely be a domain name such as http://example.com. If you have installed Drupal on your
desktop machine this URL might be http://localhost.

You will be guided through several screens to set up the database, create tables,
add the first user account and provide basic web site settings.
If you get any errors regarding the files directory and its permissions, see [#394704].

 

To run the Drupal install script, point your browser to the base URL of your web site.
The "base URL" means the document root (directory) where you placed your Drupal files (and is
defined in your web server configuration file). If you have installed Drupal on a web host this
will likely be a domain name such as http://www.example.@om. If you installed Drupal in a
subfolder, then you should point your browser to the subfolder (e.g.
http://example.@om/subfolder). If you have installed Drupal on your desktop machine this
URL might be http://lo@alhost/drupal.

If the installation process does not simply appear by entering the base URL of your site, add the
file name "install.php" (for example http://www.example.@om/install.php).

You will be guided through several screens:

1.Ê 3               
Most people should select the "standard" option. The standard option comes with default
content types already enabled, such as  and  , and with appropriate publishing
options already set. (Of course you can later edit these default content types and their settings,
or add additional ones.) The standard profile also has a useful collection of modules pre-enabled
for you.

The "minimal" option is targeted toward more experienced Drupal site creators who wish
to set up their own content types with associated publishing options. The minimal profile
has only three modules enabled: Block, Database logging, and Update status.

2.Ê

If you want to install using a language other than the default English, click the ½   
       link.
3.Ê Ñ  
If your installation directory is not yet configured properly, you will be informed at this step. Ôou
can correct the settings individually and either refresh the browser screen or click 'Try again' to
see whether there are any errors left.

Possible errors include:

oÊ J         


The installer will attempt to automatically set up a number of directories, but this may
fail due to permission settings. In this case you will find the missing directories listed.
±Ê sites/default/files
±Ê sites/default/private
±Ê sites/default/private/files

These directories should be set to the following permissions @hmod o+w


sites/default/files ÿR @hmod 777 sites/default/files

oÊ J        


If settings.php is missing or not accessible, follow the instructions in Step 2: Modify
file permission. Note that you will need
 the default.settings.php and settings.php
files.
4.Ê
 
Enter the database name as well as the username and password for the database that you
created in Step 3: Create Drupal's database. This username and password information allows
Drupal to access your database, so the install script can create tables. Note that this is  the
username and password for administering Drupal; these will be created in the next step.

The ‰ ?@
  will allow you to change the database host ('localhost' is usually
used in this entry: wamp/bin/apa@he/Apa@he2.2.11/bin/php.ini as an example of the
location on a Windows box running WAMP). You can also change the port and the table
prefix. You only need to change the port if you are using a non-standard port number.
The table prefix is useful if you are installing multiple instances of Drupal tables that
share the same database.

Click a? ?@  at the bottom of the page.

5.Ê    
A progress bar will appear and display notes from the installer regarding the progress of the
installation. If no errors are encountered, the next page will automatically load in your browser.
6.Ê 3   
Input the information for the first user account (which will be automatically assigned full
administration permissions) and provide basic web site settings.
oÊ In the a  Ô field enter the name you wish to use for the site. Ôou can also edit it
later through the administration interface.
oÊ In the a  Ô field, enter the e-mail address that will be used by Drupal
when it sends out notifications such as registration information.
oÊ In the a Ô      field, enter the   Ô , Ô , and
  for the main administration account.

Note that there is a distinction, as of Drupal 7, between the main administration


account that you set up on this page, and the "Administrator" ?  ?
user role that you will see when you visit the "Roles" and "Permissions" pages in
the administration interface. The account you set up in the a ? ?@
?@@ section during installation is a super-user who has overall control over
every aspect of the management and configuration of the site. (This will be
www.example.@om/user/1, for those of you familiar with that account from
earlier versions of Drupal.)

oÊ In the a     field, select your     and   Ô  .
oÊ In the    field leave both boxes checked if you want your Drupal
server to alert you when updates are required. Often updates relate to security issues
and are important to perform. However, if you have restricted Internet connectivity (for
example if you are behind a corporate firewall) you may want to leave these settings
unchecked and test them later.

Click "Save and continue". ÿn success you will see the 


?  ?? @

screen. If there are any error messages, review and correct them now.
!


After the installation is complete, remove write permissions for the settings.php file.

@hmod u=rw,o=r,a=r sites/default/settings.php ÿR @hmod 644


sites/default/settings.php

If you make manual changes to the settings.php file later, be sure to protect it again after making
your modifications.

Failure to remove write permissions to that file is a security risk. (Although the default location
for the settings.php file is at sites/default/settings.php, it may be in another location if you use the
multi-site setup.)

0
!,  

aÊ Download the latest stable version of Drupal 6.


aÊ Ôou will get a file called drupal-x.x.tar.gz. Extract the Drupal files.
aÊ Log into your server using your SFTP client and navigate to the web root directory. Upload all
the files inside your drupal folder into the web root folder.

!- 3

aÊ Create a new database through your hosting provider's control panel. Make a note of the
database name.
aÊ Create a user, add that user to the database, and grant the user full rights on the database.
Make a note of the username and password.

!' 3   

aÊ In your /sites/default folder, you will find the default.settings.php file. Make a copy of this
file and rename it to settings.php.
aÊ Change the permissions on the /sites/default folder and the settings.php file to be writable.
(On a Unix/Linux command line: @hmod a+w sites/default).

!/ + 

aÊ Browse to your new Drupal site. This will take you to the Drupal installer. Start filling out the
form.
aÊ When you get to the database screen, choose the type of database you created (e.g. MySQL or
SQLite). Enter the name of the database you created, the username, and password. Save and
continue.
aÊ Change the permissions on the settings.php file to remove write permissions. (On a Unix/Linux
command line: @hmod a-w sites/default).
aÊ On the site information page, you can set the site name and email from which the site will send
out mail. Ôou also set the username, email, and password of the first administrator account.
Save and continue.
aÊ Log in to your new Drupal site.

a!  
You must create a settings.php file and set some permissions.

! ( 

Your Drupal download comes with a sample configuration file at sites/default


/default.settings.php. The default file is not used by the installer. It must be copied and the
new file must be given the correct name.

1.Ê Copy the default.settings.php to settings.php.


Ôou can do this from the command line (working from the root of the directory containing your
Drupal installation) using @p sites/default/default.settings.php
sites/default/settings.php.
ë  Do not simply rename the file. The Drupal installer will need both files.
2.Ê Ôou should now have both a default.settings.php and settings.php file in your sites/default
directory.
3.Ê Make the settings file writeable, so that the installer can edit it, using
@hmod a+w sites/default/settings.php
or
@hmod 666 sites/default/settings.php
Both commands have the same effect.
Several FTP tools like Filezilla, Transmit, and Fetch allow you to change file permissions, using a
'file attribute' or 'get info' command. In this case the octal or numeric value file permission
should be set to 666. If your ftp client has checkboxes for setting permissions, check both the
Read and Write boxes for "Owner", "Group", and "Others" (leaving the Execute boxes
unchecked). ë  Do not forget to change permissions back after you have run the installation
script.
4.Ê To let the files directory be created automatically, give the web server write privileges to the
sites/default directory.
@hmod a+w sites/default ë  Do not forget to change permissions back after you have
run the installation script.

† " # $


This page provides a summary of the command line instructions for installing Drupal on a
typical UNIX/Linux web server. Every step contains a link to more detailed installation
instructions where you also can find information about installing Drupal on other systems.

If you have problems, read Troubleshooting common problems.


Read more about system requirements (among which detailed PHP-settings and browser
requirements).

,(  

Download Drupal from http://drupal.org/project/drupal and extract the download file to a folder
on your hard drive.

wget http://drupal.org/files/proje@ts/drupal-x.x.tar.gz
tar -zxvf drupal-x.x.tar.gz

Move the files to a directory within your web server's document root or your public HTML
directory using the following command, substituting drupal-x.x with the actual version number.
(ÿn many *nix computers the path from the server's root will be /var/www/.)

mv drupal-x.x /var/www/

You can install and use Drupal in other languages by downloading translations from
http://drupal.org/project/translations. Extract the files into the Drupal directory (e.g.
/var/www/drupal-x.x)

Read more about downloading and extracting Drupal (includes instructions for FTP, Windows
and Mac ÿS).

-(3       

In the sites/default directory, copy the default.settings.php file and name the copied file as
settings.php.

@p sites/default/default.settings.php sites/default/settings.php

Give the web server write privileges (666 or u=rw,g=rw,o=rw) to the configuration file.

@hmod a+w sites/default/settings.php

Give the web server write privileges to the sites/default directory.

@hmod a+w sites/default

Read more about preparing the configuration file.

'(3 

To complete the installation, you must create a empty database and a user with full access the
newly created database for Drupal to use. You can do this by command line or through
phpMyAdmin or another database clients.

mysqladmin -u username -p @reate databasename


Where 'username' is a MySQL user which has the CREATE and GRANT privileges. MySQL
will prompt for the 'username' database password. Next you must set the access database rights.
Log in to MySQL:

mysql -u username -p

At the MySQL prompt, enter:

GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE
TEMPORARY TABLES, LOCK TABLES
ON databasename.*
TO 'username'@'lo@alhost' IDENTIFIED BY 'password';

Where:

'databasename' is the name of your database


'username' is the username of your MySQL account
'localhost' is the server name used to access MySQL
'password' is the password required for that username

If successful, MySQL will reply with:

†uery OK, 0 rows affe@ted

Read more about creating the database (among which instructions on using phpMyAdmin, and
PostgreSQL and SQLite as database).

/(X    

You are now ready to run the installation script. Point your browser to the base URL of your
website (e.g. http://www.example.com, http://www.example.com/drupal or
http://localhost/drupal).

The installation wizard will guide you through several screens to set up the database, add the first
user account, and provide basic web site settings. Follow the wizard to finalize the installation
and start working with your Drupal website.

Read more about the installation script (along with a detailed description of all the available
options).

a%     


Drupal is available in several versions. The "recommended release" is the latest stable release.

To learn more about versions, see the Drupal version information page.
Information about Drupal translations is available at http://drupal.org/project/translations.

  

Before you begin, log in to your server and navigate to the directory from which you will be
serving your Drupal site. ÿn many *nix computers the path from the server's root will be
/var/www/html, so @d /var/www/html. ÿn a shared server, or a server that hosts multiple
domains, the path will be different -- perhaps the command @d ~/www or @d ~/publi@ html
will work. If you are unsure of the directory, ask your hosting provider for assistance.

Download Drupal using any download utility, the two most popular of which are à  and @.
Not every computer has both. The commands are:

wget http://ftp.drupal.org/files/proje@ts/drupal-x.x.tar.gz
or
@url -O http://drupal.org/files/proje@ts/drupal-x.x.tar.gz

(ë?
 @@? 

@? ???
? .)

(Replace the "http://drupal.org/files/projects/drupal-x.x.tar.gz" string with the link for the version
you will be installing.)

   

Type the following command (replacing "x.x" with your downloaded version):

tar -xzvf drupal-x.x.tar.gz

Remove the compressed file by typing rm drupal-x.x.tar.gz.

    

Now you need to move the contents of the 


?  directory one level "up" into the web
server's document root or your public HTML directory:

mv drupal-x.x/* drupal-x.x/.hta@@ess ./

The files from the directory you downloaded and decompressed have now been moved up a level
into your web directory, and you can delete the drupal-x.x directory (which is now empty):

rmdir drupal-x.x

%     (((

The base URL for your Drupal installation will be set in your Web server's configuration file.
You will need to know this URL before proceeding to the next steps of the installation. If you are
installing Drupal on your local machine the base URL may be: http://localhost. If you are
installing Drupal to a Web server your base URL may be a specific domain name (such as
http://example.com).

a& '
Before running the installation script, you must create an empty database and database user (a
user name assigned the rights to use the Drupal database).

This page offers guidance for creating your Drupal database using a Web browser-based control
panel (such as "CPanel" or "Plesk"), or by using phpMyAdmin (another browser-based database
utility), or by creating the database directly from the MySQL or PostgreSQL command prompt
(for more advanced users).

3  )  

Most web hosting accounts provide a Web-based control panel to help you administer your site.
These tools include easy-to-use features for creating a new database, and for creating a "user"
with rights to the database. To create a database using a browser-based control panel consult the
documentation or ask your web host service provider.

When you create the user for your database, you may see a page where you can specify the
privileges that user will have for various operations on the database. In most Web control panels'
"database wizard", if you simply check "All" privileges for the user you create (and then uncheck
"Grant" if it is listed as a privilege) your user will be set up correctly.

Take note of the username, password, database name and hostname (e.g., are you installing in
ààà ?
@, or in 
? ?
@, ààà ?
@  etc.) as you create the
database. You will enter these items into fields in your browser when running the install script
(see next page).

Note that in many cases when creating databases and users via a Web-based graphic interface,
the user name you use to log into your control panel is added as a prefix to the database name
and possibly to the database user name as well. For example, if you log into your Web site
control panel as "webadmin" and create a database named "drupal7db" and a user for that
database named "d7user", when running the Install script (see next page) the database and user
may need to be typed in as "webadmin_drupal7db" and "webadmin_d7user". (This is because
many hosting accounts are on shared servers, and on one server each database and user name
must be unique across all accounts on the server.)

If you have created your database and user via a Web-based interface, you can skip the
remainder of this page and continue with the install instructions on the next page.
3  -£-
  

This presumes you have root access to PHPMyAdmin

1.Ê Log in to PHPMyAdmin as the root user


2.Ê Click   &   
3.Ê In the   Ô field, enter the username you wish to use
4.Ê In the £  field, select ½ which is more secure, unless you will be accessing the database
with this user from another server
5.Ê Enter or generate a password for the user.
6.Ê In the Database for User list, select 3  
   Ô  Ô     and
click Go

You have now created a user that has all privileges only on the database with the same name.
This is more secure than using a general username & password for all your sites on the same
server, as it limits access to your databases if someone gets hold of your database logins.
If you want to have a different name for database and user, just select the created database, then
operations tab. You will find an option X??? ? . If you need more details about using
PHPMyAdmin, check out the official wiki.

Take note of the username, password, database name and hostname (e.g., are you installing in
ààà ?
@, or in 
? ?
@, ààà ?
@  etc.) as you create the
database. You will enter these items into fields in your browser when running the install script
(see next page).

Note that in many cases when creating databases and users using a web interface, the user name
you use to log in to your control panel is added as a prefix to the database name and possibly to
the database user name as well. For example, if you log into your Web site control panel as
"webadmin" and create a database named "drupal7db" and a user for that database named
"d7user", when running the Install script (see next page) the database and user may need to be
typed in as "webadmin_drupal7db" and "webadmin_d7user". (This is because many hosting
accounts are on shared servers, and on one server each database and user name must be unique
across all accounts on the server.)

If you have created your database and user via phpMyAdmin, you can skip the remainder of this
page and continue with the install instructions on the next page.

3     

If you do not use a Web control panel or are experienced with and prefer to use MySQL or
PostgreSQL commands, you can follow the information below.

Additional information about privileges, and instructions to create a database using the command
line are available in INSTALL.mysql.txt (for MySQL) or INSTALL.pgsql.txt (for PostgreSQL).
3 
!"#  

For information on installing and configuring MySQL see http://dev.mysql.com/tech-


resources/articles/mysql_intro.html

In the following examples, 'username' is an example MySQL user who will have the CREATE
and GRANT privileges and 'databasename' is the name of the new database Use the appropriate
names for your system.

1.Ê Create a new database for your site.

mysqladmin -u username -p @reate databasename

MySQL prompts for the 'username' database password, and creates the initial database
files.

2.Ê Log in and set the access database rights:

mysql -u username -p

MySQL prompts for the 'username' database password.

3.Ê At the MySQL prompt, set the permissions using the following command:

GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, LOCK
TABLES, CREATE TEMPORARY TABLES ON `databasename`.* TO
'username'@'lo@alhost' IDENTIFIED BY 'password';

In this case:

oÊ 'databasename' is the name of your database


oÊ 'username@localhost' is the username of your MySQL account
oÊ 'password' is the password required for that username

You will need the ` around the database name if you have used a MySQL escape
character in your schema name.

Eg: drupal_test_account.* should be drupal\_test\_account.* for security (underscore is a


wildcard). This requires the ` wrapper. `drupal\_test\_account`.*

ë   '  # 


  '
(   '
'  

4.Ê If successful, MySQL will reply with:

†uery OK, 0 rows affe@ted

5.Ê To activate the new permissions, enter the following command:


FLUSH PRIVILEGES;

The database should be created with UTF-8 (Unicode) encoding.

3 -!"#

The database must be created with UTF-8 (Unicode) encoding.

1.Ê 3  


This step is only necessary if you don't already have a user setup (e.g. by your host) or you want
to create new user for use with Drupal only. The following command creates a new user named
'username' (you should substitute this with the desired username), and prompts for a password
for that user:

@reateuser --pwprompt --en@rypted --no-adduser


--no-@reatedb username

If everything works correctly, you'll see a CREATE USER notice.

2.Ê 3 
This step is only necessary if you don't already have a database setup (e.g. by your host) or you
want to create new database for use with Drupal only. The following command creates a new
database named "databasename" (you should substitute this with the desired database name),
which is owned by previously created "username":

@reatedb --en@oding=UNICODE --owner=username databasename

If everything works correctly, you'll see a CREATE DATABASE notice.

Вам также может понравиться