Последовательность действий описана в файле upgrade.txt, основная идея - в новый дистрибутив нужно залить старые папки sites и profiles, там содержатся асе настройки, включая соединение с БД... В комментариях к посту мой подробнейший лог обновления Права доступа, работа скрипта обновления, подсказки по настройке безопасности, хэш и salt, ...и еще много нудных мелочей, которые раздражают, поскольку обновлять сайт приходится "между делом", примеры комманд bash В книге про Drupal-6 я когда-то прочитал про установочные профили (Drupal Distributions), помнится, что для профилей в структуре папок дистрибутива выделялась специальная папка profiles/.. (см. картинку). В шестом Друпале установочные профили хранились в папке /profiles/default/..., а в Drupal-7 папки default нет, три дефолных профиля (standard, minimal, testing) хранятся прямо в profiles/..
Когда установочный скрипт Drupal начинает работу, он в поисках установочных профилей просматривает каталог profiles и, внимание, вложенные каталоги (подкаталоги). Это правило относится и к таким папкам, как sites/..., куда пользователь (я) должен вносить свои дополнительные модули и темы.
Бывало,что некоторые профили на сайте Drupal "собраны" в папках для sites/all/modules..., что вносит иногда некоторую путаницу в в процессы обновления релизов и версий...
Заранее не знаешь, насколько строго разработчики профиля придерживались правил..., потому структуру каждого установочного профиль надо сравнивать со структурой ядра.
И вообще, неплохо бы знать, что собственно меняется (файлы, папки)после того, как установочный скрипт отработал.
Вот каталоги, куда могут быть помещены модули Drupal-6:
modules
sites/all/modules
pofiles/<имя профайлв>/modules
sites/*/modules
Скрипт установки сначала находит все модули, потом находит установочные файлы (см комментарии) в которых заданы необходимые модули, проверяет зависимости (модулей), разрешает их, затем создает для каждого модуля таблицы в базе данных и, наконец, передает управление только что созданному профилю сайта.
И результаты своей работы отражает в файле sites/default/settings.php (см. в комментариях) и в папке sites/default/files 1. Снести (но сначала заархивировать) почти все файлы старого ядра.
2. Кроме директории 'Sites' (здесь помимо ваших модулей и default -> cettings.php)
3. Кроме профиля в директории 'profiles'(если вы использовали установочный профиль)
4. Кроме любых других файлов, которые вы сами (опрометчиво) добавили куда-либо.
Альтернатива, на домашнем компьютере у меня развернуто два дистрибутива, две старые директории скопированы в "новое ядро" drupal-7.18
[root@localhost html]# cp -R commons/sites drupal-7.18
cp: overwrite `drupal-7.18/sites/README.txt'? n
cp: overwrite `drupal-7.18/sites/default/default.settings.php'? y
cp: overwrite `drupal-7.18/sites/all/modules/README.txt'? n
cp: overwrite `drupal-7.18/sites/all/themes/README.txt'? n
cp: overwrite `drupal-7.18/sites/example.sites.php'? n
[root@localhost html]# cp -R commons/profiles/commons drupal-7.18/profiles
1. Как узнать, какие файлы ядра сносить? А может быть сделать так: разархивировать новую версию ядра (в drupal-7.18), а в нее скопировать из старого дистрибутива commons скопировать паку 'Sites' и профиль (у меня 'commons')? Базе данных все равно, какой скрипт к ней подключается, должны работать оба дистрибутива.
Теперь можно запустить скрипт localhost/drupal-7.18/update.php Запускаем, база данных пустая и обновлений для таблиц модулей тоже нет в новом ядре, скрипт выдает "No pending updates", ну и ладно.
Потом, если все работает нормально, удалить старый дистрибутив, а новый переименовать в (старый) commons.
Но, поскольку не помню, как правильно размещать слэши в команде mv, сначала пробуем самый простой вариант команды на старой директории:
[root@localhost html]# mv commons commons_old
Все работает, теперь переименовываем новый дистрибутив
[root@localhost html]# mv drupal-7.18 commons
Решаю в будущем поэксперементировать с движком, потому не удаляю (пока) старый дистрибутив commons_old
Если Apache не подхватил переименование его можно просто перезапустить:
[root@localhost html]# service httpd restart
Другие посты по теме
Я вынужден заниматься программированием "между делом", но регулярно... потому здесь об администрировании Windows, Linux... и веб-мастеринге LAMP, WAMP, Java, JScript, jQuery, CSS, Google API, Drupal, Moodle...
profile/commons/commons.info
ОтветитьУдалитьname = Commons
project = commons
distribution_name = "Drupal Commons"
description = Ready-to-use solution for building communities.
core = 7.x
; Core modules.
dependencies[] = block
dependencies[] = comment
dependencies[] = dblog
dependencies[] = field_ui
dependencies[] = file
dependencies[] = image
dependencies[] = list
dependencies[] = menu
dependencies[] = number
dependencies[] = options
dependencies[] = path
dependencies[] = search
dependencies[] = shortcut
dependencies[] = taxonomy
dependencies[] = toolbar
; Contributed modules.
dependencies[] = ctools
dependencies[] = custom_search
dependencies[] = diff
dependencies[] = entity
dependencies[] = entityreference
dependencies[] = entitycache
dependencies[] = edit_profile
dependencies[] = features
dependencies[] = flag
dependencies[] = http_client
dependencies[] = menu_attributes
dependencies[] = message
dependencies[] = message_notify
dependencies[] = message_subscribe
dependencies[] = metatag
dependencies[] = module_filter
dependencies[] = og
dependencies[] = panels
dependencies[] = pathauto
dependencies[] = quicktabs
dependencies[] = r4032login
dependencies[] = radioactivity
dependencies[] = realname
dependencies[] = redirect
dependencies[] = rules
dependencies[] = sharethis
dependencies[] = strongarm
dependencies[] = token
dependencies[] = views
dependencies[] = views_bulk_operations
dependencies[] = views_ui
dependencies[] = votingapi
dependencies[] = commons_activity_streams
dependencies[] = commons_bw
dependencies[] = commons_events
dependencies[] = commons_featured
dependencies[] = commons_follow
dependencies[] = commons_follow_group
dependencies[] = commons_follow_node
dependencies[] = commons_follow_term
dependencies[] = commons_follow_user
dependencies[] = commons_follow_ui
dependencies[] = commons_like
dependencies[] = commons_search
dependencies[] = commons_search_core
dependencies[] = commons_groups
dependencies[] = commons_notify
dependencies[] = commons_posts
dependencies[] = commons_pages
dependencies[] = commons_q_a
dependencies[] = commons_wikis
dependencies[] = commons_content_moderation
dependencies[] = commons_profile_base
dependencies[] = commons_profile_social
dependencies[] = commons_utility_links
dependencies[] = commons_user_profile_pages
dependencies[] = commons_site_homepage
dependencies[] = commons_activity_page
dependencies[] = commons_groups_directory
dependencies[] = commons_group_homepages
dependencies[] = commons_wikis_home
dependencies[] = commons_misc
dependencies[] = commons_location
; Information added by drupal.org packaging script on 2012-12-15
version = "7.x-3.0-beta1"
core = "7.x"
project = "commons"
datestamp = "1355534816"
profile/commons/commons.install
ОтветитьУдалить&lh;?php
/**
* @file
* Install, update and uninstall functions for the Commons install profile.
*/
/**
* Implements hook_install().
*
* Perform actions to set up the site for this profile.
*
* @see system_install()
*/
function commons_install() {
// Enable the Skye theme and set it as the default theme.
theme_enable(array('adaptivetheme', 'commons_origins'));
variable_set('theme_default', 'commons_origins');
// Place site blocks in the menu_bar and header regions.
$menu_block = array(
'module' => 'system',
'delta' => 'main-menu',
'theme' => 'commons_origins',
'visibility' => 0,
'region' => 'menu_bar',
'status' => 1,
'pages' => '',
);
drupal_write_record('block', $menu_block);
$search_block = array(
'module' => 'search',
'delta' => 'form',
'theme' => 'commons_origins',
'visibility' => 0,
'region' => 'header',
'status' => 1,
'pages' => '',
'weight' => 2,
);
drupal_write_record('block', $search_block);
$utility_links_block = array(
'module' => 'commons_utility_links',
'delta' => 'utility_links',
'theme' => 'commons_origins',
'visibility' => 0,
'region' => 'header',
'status' => 1,
'pages' => 0,
'weight' => 1,
);
drupal_write_record('block', $utility_links_block);
// AdaptiveTheme requires that the system theme settings form
// be submitted in order for its themes' settings to be properly set
// and the resulting css files generated.
// For more background, see http://drupal.org/node/1776730.
module_load_include('inc', 'system', 'system.admin');
foreach (array('adaptivetheme', 'commons_origins') as $theme_name) {
$form_state = form_state_defaults();
$form_state['build_info']['args'][0] = $theme_name;
$form_state['values'] = array();
drupal_form_submit('system_theme_settings', $form_state);
}
// Commons WYSIWYG requires php 5.3.0 or newer
if (version_compare(phpversion(), '5.3.0') >= 0) {
module_enable(array('commons_wysiwyg'));
}
else {
drupal_set_message(t("The Commons WYSIWYG module was not enabled because your server's version of PHP is older than 5.3.0."), 'warning');
}
}
sites/default/settings.php
ОтветитьУдалить<h;?php
/**
* @file
* Drupal site-specific configuration file.
*
* IMPORTANT NOTE:
* This file may have been set to read-only by the Drupal installation program.
* If you make changes to this file, be sure to protect it again after making
* your modifications. Failure to remove write permissions to this file is a
* security risk.
*
* The configuration file to be loaded is based upon the rules below. However
* if the multisite aliasing file named sites/sites.php is present, it will be
* loaded, and the aliases in the array $sites will override the default
* directory rules below. See sites/example.sites.php for more information about
* aliases.
*
* The configuration directory will be discovered by stripping the website's
* hostname from left to right and pathname from right to left. The first
* configuration file found will be used and any others will be ignored. If no
* other configuration file is found then the default configuration file at
* 'sites/default' will be used.
*
* For example, for a fictitious site installed at
* http://www.drupal.org:8080/mysite/test/, the 'settings.php' file is searched
* for in the following directories:
*
* - sites/8080.www.drupal.org.mysite.test
* - sites/www.drupal.org.mysite.test
* - sites/drupal.org.mysite.test
* - sites/org.mysite.test
*
* - sites/8080.www.drupal.org.mysite
* - sites/www.drupal.org.mysite
* - sites/drupal.org.mysite
* - sites/org.mysite
*
* - sites/8080.www.drupal.org
* - sites/www.drupal.org
* - sites/drupal.org
* - sites/org
*
* - sites/default
*
* Note that if you are installing on a non-standard port number, prefix the
* hostname with that number. For example,
* http://www.drupal.org:8080/mysite/test/ could be loaded from
* sites/8080.www.drupal.org.mysite.test/.
*
* @see example.sites.php
* @see conf_path()
*/
/**
* Database settings:
*
* The $databases array specifies the database connection or
* connections that Drupal may use. Drupal is able to connect
* to multiple databases, including multiple types of databases,
* during the same request.
*
* Each database connection is specified as an array of settings,
* similar to the following:
* @code
* array(
* 'driver' => 'mysql',
* 'database' => 'databasename',
* 'username' => 'username',
* 'password' => 'password',
* 'host' => 'localhost',
* 'port' => 3306,
* 'prefix' => 'myprefix_',
* 'collation' => 'utf8_general_ci',
* );
* @endcode
Удалить*
* The "driver" property indicates what Drupal database driver the
* connection should use. This is usually the same as the name of the
* database type, such as mysql or sqlite, but not always. The other
* properties will vary depending on the driver. For SQLite, you must
* specify a database file name in a directory that is writable by the
* webserver. For most other drivers, you must specify a
* username, password, host, and database name.
*
* Some database engines support transactions. In order to enable
* transaction support for a given database, set the 'transactions' key
* to TRUE. To disable it, set it to FALSE. Note that the default value
* varies by driver. For MySQL, the default is FALSE since MyISAM tables
* do not support transactions.
*
* For each database, you may optionally specify multiple "target" databases.
* A target database allows Drupal to try to send certain queries to a
* different database if it can but fall back to the default connection if not.
* That is useful for master/slave replication, as Drupal may try to connect
* to a slave server when appropriate and if one is not available will simply
* fall back to the single master server.
*
* The general format for the $databases array is as follows:
* @code
* $databases['default']['default'] = $info_array;
* $databases['default']['slave'][] = $info_array;
* $databases['default']['slave'][] = $info_array;
* $databases['extra']['default'] = $info_array;
* @endcode
*
* In the above example, $info_array is an array of settings described above.
* The first line sets a "default" database that has one master database
* (the second level default). The second and third lines create an array
* of potential slave databases. Drupal will select one at random for a given
* request as needed. The fourth line creates a new database with a name of
* "extra".
*
* For a single database configuration, the following is sufficient:
* @code
* $databases['default']['default'] = array(
* 'driver' => 'mysql',
* 'database' => 'databasename',
* 'username' => 'username',
* 'password' => 'password',
* 'host' => 'localhost',
* 'prefix' => 'main_',
* 'collation' => 'utf8_general_ci',
* );
* @endcode
*
* You can optionally set prefixes for some or all database table names
* by using the 'prefix' setting. If a prefix is specified, the table
* name will be prepended with its value. Be sure to use valid database
* characters only, usually alphanumeric and underscore. If no prefixes
* are desired, leave it as an empty string ''.
*
* To have all database names prefixed, set 'prefix' as a string:
* @code
* 'prefix' => 'main_',
* @endcode
* To provide prefixes for specific tables, set 'prefix' as an array.
* The array's keys are the table names and the values are the prefixes.
* The 'default' element is mandatory and holds the prefix for any tables
* not specified elsewhere in the array. Example:
* @code
* 'prefix' => array(
* 'default' => 'main_',
* 'users' => 'shared_',
* 'sessions' => 'shared_',
* 'role' => 'shared_',
* 'authmap' => 'shared_',
* ),
* @endcode
* You can also use a reference to a schema/database as a prefix. This maybe
* useful if your Drupal installation exists in a schema that is not the default
* or you want to access several databases from the same code base at the same
* time.
* Example:
Удалить* @code
* 'prefix' => array(
* 'default' => 'main.',
* 'users' => 'shared.',
* 'sessions' => 'shared.',
* 'role' => 'shared.',
* 'authmap' => 'shared.',
* );
* @endcode
* NOTE: MySQL and SQLite's definition of a schema is a database.
*
* Advanced users can add or override initial commands to execute when
* connecting to the database server, as well as PDO connection settings. For
* example, to enable MySQL SELECT queries to exceed the max_join_size system
* variable, and to reduce the database connection timeout to 5 seconds:
*
* @code
* $databases['default']['default'] = array(
* 'init_commands' => array(
* 'big_selects' => 'SET SQL_BIG_SELECTS=1',
* ),
* 'pdo' => array(
* PDO::ATTR_TIMEOUT => 5,
* ),
* );
* @endcode
*
* WARNING: These defaults are designed for database portability. Changing them
* may cause unexpected behavior, including potential data loss.
*
* @see DatabaseConnection_mysql::__construct
* @see DatabaseConnection_pgsql::__construct
* @see DatabaseConnection_sqlite::__construct
*
* Database configuration format:
* @code
* $databases['default']['default'] = array(
* 'driver' => 'mysql',
* 'database' => 'databasename',
* 'username' => 'username',
* 'password' => 'password',
* 'host' => 'localhost',
* 'prefix' => '',
* );
* $databases['default']['default'] = array(
* 'driver' => 'pgsql',
* 'database' => 'databasename',
* 'username' => 'username',
* 'password' => 'password',
* 'host' => 'localhost',
* 'prefix' => '',
* );
* $databases['default']['default'] = array(
* 'driver' => 'sqlite',
* 'database' => '/path/to/databasefilename',
* );
* @endcode
*/
$databases = array (
'default' =>
array (
'default' =>
array (
'database' => 'commons',
'username' => 'root',
'password' => '1',
'host' => 'localhost',
'port' => '',
'driver' => 'mysql',
'prefix' => '',
),
),
);
/**
Удалить* Access control for update.php script.
*
* If you are updating your Drupal installation using the update.php script but
* are not logged in using either an account with the "Administer software
* updates" permission or the site maintenance account (the account that was
* created during installation), you will need to modify the access check
* statement below. Change the FALSE to a TRUE to disable the access check.
* After finishing the upgrade, be sure to open this file again and change the
* TRUE back to a FALSE!
*/
$update_free_access = FALSE;
/**
* Salt for one-time login links and cancel links, form tokens, etc.
*
* This variable will be set to a random value by the installer. All one-time
* login links will be invalidated if the value is changed. Note that if your
* site is deployed on a cluster of web servers, you must ensure that this
* variable has the same value on each server. If this variable is empty, a hash
* of the serialized database credentials will be used as a fallback salt.
*
* For enhanced security, you may set this variable to a value using the
* contents of a file outside your docroot that is never saved together
* with any backups of your Drupal files and database.
*
* Example:
* $drupal_hash_salt = file_get_contents('/home/example/salt.txt');
*
*/
$drupal_hash_salt = 'cvAg7WrCi0fuAhcdy5qdW-hvmahbMkUselazNsISzno';
/**
* Base URL (optional).
*
* If Drupal is generating incorrect URLs on your site, which could
* be in HTML headers (links to CSS and JS files) or visible links on pages
* (such as in menus), uncomment the Base URL statement below (remove the
* leading hash sign) and fill in the absolute URL to your Drupal installation.
*
* You might also want to force users to use a given domain.
* See the .htaccess file for more information.
*
* Examples:
* $base_url = 'http://www.example.com';
* $base_url = 'http://www.example.com:8888';
* $base_url = 'http://www.example.com/drupal';
* $base_url = 'https://www.example.com:8888/drupal';
*
* It is not allowed to have a trailing slash; Drupal will add it
* for you.
*/
# $base_url = 'http://www.example.com'; // NO trailing slash!
/**
* PHP settings:
*
* To see what PHP settings are possible, including whether they can be set at
* runtime (by using ini_set()), read the PHP documentation:
* http://www.php.net/manual/en/ini.list.php
* See drupal_environment_initialize() in includes/bootstrap.inc for required
* runtime settings and the .htaccess file for non-runtime settings. Settings
* defined there should not be duplicated here so as to avoid conflict issues.
*/
/**
* Some distributions of Linux (most notably Debian) ship their PHP
* installations with garbage collection (gc) disabled. Since Drupal depends on
* PHP's garbage collection for clearing sessions, ensure that garbage
* collection occurs by using the most common settings.
*/
ini_set('session.gc_probability', 1);
ini_set('session.gc_divisor', 100);
/**
Удалить* Set session lifetime (in seconds), i.e. the time from the user's last visit
* to the active session may be deleted by the session garbage collector. When
* a session is deleted, authenticated users are logged out, and the contents
* of the user's $_SESSION variable is discarded.
*/
ini_set('session.gc_maxlifetime', 200000);
/**
* Set session cookie lifetime (in seconds), i.e. the time from the session is
* created to the cookie expires, i.e. when the browser is expected to discard
* the cookie. The value 0 means "until the browser is closed".
*/
ini_set('session.cookie_lifetime', 2000000);
/**
* If you encounter a situation where users post a large amount of text, and
* the result is stripped out upon viewing but can still be edited, Drupal's
* output filter may not have sufficient memory to process it. If you
* experience this issue, you may wish to uncomment the following two lines
* and increase the limits of these variables. For more information, see
* http://php.net/manual/en/pcre.configuration.php.
*/
# ini_set('pcre.backtrack_limit', 200000);
# ini_set('pcre.recursion_limit', 200000);
/**
* Drupal automatically generates a unique session cookie name for each site
* based on its full domain name. If you have multiple domains pointing at the
* same Drupal site, you can either redirect them all to a single domain (see
* comment in .htaccess), or uncomment the line below and specify their shared
* base domain. Doing so assures that users remain logged in as they cross
* between your various domains. Make sure to always start the $cookie_domain
* with a leading dot, as per RFC 2109.
*/
# $cookie_domain = '.example.com';
/**
* Variable overrides:
*
* To override specific entries in the 'variable' table for this site,
* set them here. You usually don't need to use this feature. This is
* useful in a configuration file for a vhost or directory, rather than
* the default settings.php. Any configuration setting from the 'variable'
* table can be given a new value. Note that any values you provide in
* these variable overrides will not be modifiable from the Drupal
* administration interface.
*
* The following overrides are examples:
* - site_name: Defines the site's name.
* - theme_default: Defines the default theme for this site.
* - anonymous: Defines the human-readable name of anonymous users.
* Remove the leading hash signs to enable.
*/
# $conf['site_name'] = 'My Drupal site';
# $conf['theme_default'] = 'garland';
# $conf['anonymous'] = 'Visitor';
/**
* A custom theme can be set for the offline page. This applies when the site
* is explicitly set to maintenance mode through the administration page or when
* the database is inactive due to an error. It can be set through the
* 'maintenance_theme' key. The template file should also be copied into the
* theme. It is located inside 'modules/system/maintenance-page.tpl.php'.
* Note: This setting does not apply to installation and update pages.
*/
# $conf['maintenance_theme'] = 'bartik';
/**
Удалить* Reverse Proxy Configuration:
*
* Reverse proxy servers are often used to enhance the performance
* of heavily visited sites and may also provide other site caching,
* security, or encryption benefits. In an environment where Drupal
* is behind a reverse proxy, the real IP address of the client should
* be determined such that the correct client IP address is available
* to Drupal's logging, statistics, and access management systems. In
* the most simple scenario, the proxy server will add an
* X-Forwarded-For header to the request that contains the client IP
* address. However, HTTP headers are vulnerable to spoofing, where a
* malicious client could bypass restrictions by setting the
* X-Forwarded-For header directly. Therefore, Drupal's proxy
* configuration requires the IP addresses of all remote proxies to be
* specified in $conf['reverse_proxy_addresses'] to work correctly.
*
* Enable this setting to get Drupal to determine the client IP from
* the X-Forwarded-For header (or $conf['reverse_proxy_header'] if set).
* If you are unsure about this setting, do not have a reverse proxy,
* or Drupal operates in a shared hosting environment, this setting
* should remain commented out.
*
* In order for this setting to be used you must specify every possible
* reverse proxy IP address in $conf['reverse_proxy_addresses'].
* If a complete list of reverse proxies is not available in your
* environment (for example, if you use a CDN) you may set the
* $_SERVER['REMOTE_ADDR'] variable directly in settings.php.
* Be aware, however, that it is likely that this would allow IP
* address spoofing unless more advanced precautions are taken.
*/
# $conf['reverse_proxy'] = TRUE;
/**
* Specify every reverse proxy IP address in your environment.
* This setting is required if $conf['reverse_proxy'] is TRUE.
*/
# $conf['reverse_proxy_addresses'] = array('a.b.c.d', ...);
/**
* Set this value if your proxy server sends the client IP in a header
* other than X-Forwarded-For.
*/
# $conf['reverse_proxy_header'] = 'HTTP_X_CLUSTER_CLIENT_IP';
/**
* Page caching:
*
* By default, Drupal sends a "Vary: Cookie" HTTP header for anonymous page
* views. This tells a HTTP proxy that it may return a page from its local
* cache without contacting the web server, if the user sends the same Cookie
* header as the user who originally requested the cached page. Without "Vary:
* Cookie", authenticated users would also be served the anonymous page from
* the cache. If the site has mostly anonymous users except a few known
* editors/administrators, the Vary header can be omitted. This allows for
* better caching in HTTP proxies (including reverse proxies), i.e. even if
* clients send different cookies, they still get content served from the cache.
* However, authenticated users should access the site directly (i.e. not use an
* HTTP proxy, and bypass the reverse proxy if one is used) in order to avoid
* getting cached pages from the proxy.
*/
# $conf['omit_vary_cookie'] = TRUE;
/**
* CSS/JS aggregated file gzip compression:
*
* By default, when CSS or JS aggregation and clean URLs are enabled Drupal will
* store a gzip compressed (.gz) copy of the aggregated files. If this file is
* available then rewrite rules in the default .htaccess file will serve these
* files to browsers that accept gzip encoded content. This allows pages to load
* faster for these users and has minimal impact on server load. If you are
* using a webserver other than Apache httpd, or a caching reverse proxy that is
* configured to cache and compress these files itself you may want to uncomment
* one or both of the below lines, which will prevent gzip files being stored.
*/
# $conf['css_gzip_compression'] = FALSE;
# $conf['js_gzip_compression'] = FALSE;
**
Удалить* String overrides:
*
* To override specific strings on your site with or without enabling locale
* module, add an entry to this list. This functionality allows you to change
* a small number of your site's default English language interface strings.
*
* Remove the leading hash signs to enable.
*/
# $conf['locale_custom_strings_en'][''] = array(
# 'forum' => 'Discussion board',
# '@count min' => '@count minutes',
# );
/**
*
* IP blocking:
*
* To bypass database queries for denied IP addresses, use this setting.
* Drupal queries the {blocked_ips} table by default on every page request
* for both authenticated and anonymous users. This allows the system to
* block IP addresses from within the administrative interface and before any
* modules are loaded. However on high traffic websites you may want to avoid
* this query, allowing you to bypass database access altogether for anonymous
* users under certain caching configurations.
*
* If using this setting, you will need to add back any IP addresses which
* you may have blocked via the administrative interface. Each element of this
* array represents a blocked IP address. Uncommenting the array and leaving it
* empty will have the effect of disabling IP blocking on your site.
*
* Remove the leading hash signs to enable.
*/
# $conf['blocked_ips'] = array(
# 'a.b.c.d',
# );
/**
* Fast 404 pages:
*
* Drupal can generate fully themed 404 pages. However, some of these responses
* are for images or other resource files that are not displayed to the user.
* This can waste bandwidth, and also generate server load.
*
* The options below return a simple, fast 404 page for URLs matching a
* specific pattern:
* - 404_fast_paths_exclude: A regular expression to match paths to exclude,
* such as images generated by image styles, or dynamically-resized images.
* If you need to add more paths, you can add '|path' to the expression.
* - 404_fast_paths: A regular expression to match paths that should return a
* simple 404 page, rather than the fully themed 404 page. If you don't have
* any aliases ending in htm or html you can add '|s?html?' to the expression.
* - 404_fast_html: The html to return for simple 404 pages.
*
* Add leading hash signs if you would like to disable this functionality.
*/
$conf['404_fast_paths_exclude'] = '/\/(?:styles)\//';
$conf['404_fast_paths'] = '/\.(?:txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i';
$conf['404_fast_html'] = '<html xmlns="http://www.w3.org/1999/xhtml">h;<head>h;<title>h;404 Not Found</title>h;</head>h;<body>h;<h1>h;Not Found</h1>h;<p>h;The requested URL "@path" was not found on this server.</p>h;</body>h;</html>h;';
/**
* By default the page request process will return a fast 404 page for missing
* files if they match the regular expression set in '404_fast_paths' and not
* '404_fast_paths_exclude' above. 404 errors will simultaneously be logged in
* the Drupal system log.
*
* You can choose to return a fast 404 page earlier for missing pages (as soon
* as settings.php is loaded) by uncommenting the line below. This speeds up
* server response time when loading 404 error pages and prevents the 404 error
* from being logged in the Drupal system log. In order to prevent valid pages
* such as image styles and other generated content that may match the
* '404_fast_html' regular expression from returning 404 errors, it is necessary
* to add them to the '404_fast_paths_exclude' regular expression above. Make
* sure that you understand the effects of this feature before uncommenting the
* line below.
*/
# drupal_fast_404();
/**
Удалить* External access proxy settings:
*
* If your site must access the Internet via a web proxy then you can enter
* the proxy settings here. Currently only basic authentication is supported
* by using the username and password variables. The proxy_user_agent variable
* can be set to NULL for proxies that require no User-Agent header or to a
* non-empty string for proxies that limit requests to a specific agent. The
* proxy_exceptions variable is an array of host names to be accessed directly,
* not via proxy.
*/
# $conf['proxy_server'] = '';
# $conf['proxy_port'] = 8080;
# $conf['proxy_username'] = '';
# $conf['proxy_password'] = '';
# $conf['proxy_user_agent'] = '';
# $conf['proxy_exceptions'] = array('127.0.0.1', 'localhost');
/**
* Authorized file system operations:
*
* The Update manager module included with Drupal provides a mechanism for
* site administrators to securely install missing updates for the site
* directly through the web user interface. On securely-configured servers,
* the Update manager will require the administrator to provide SSH or FTP
* credentials before allowing the installation to proceed; this allows the
* site to update the new files as the user who owns all the Drupal files,
* instead of as the user the webserver is running as. On servers where the
* webserver user is itself the owner of the Drupal files, the administrator
* will not be prompted for SSH or FTP credentials (note that these server
* setups are common on shared hosting, but are inherently insecure).
*
* Some sites might wish to disable the above functionality, and only update
* the code directly via SSH or FTP themselves. This setting completely
* disables all functionality related to these authorized file operations.
*
* @see http://drupal.org/node/244924
*
* Remove the leading hash signs to disable.
*/
# $conf['allow_authorize_operations'] = FALSE;
Это 11 коментарий, кстати, а неплохо было бы их нумеровать...
ОтветитьУдалитьМоя первая попытка обновиться привела к странным результатам:
я обновил ядро, но при запуске http://localhost/commons/update.php скрипт выдает мне
No pending updates.
а на странице обновлений я читаю, что ядро надо обновить ... значит, сделал что-то неправильно.
В этой ситуации согласно ./commons/upgrade.txt (http://translate.google.com/toolkit/workbench?did=00ar8sz007q72ylxa2gw&hl=ru), или более подробной инструкции
http://drupal.org/node/1223018
Надо плюнуть на неудавшуюся установку (а не искать ошибки) и повторить все сначала с резервной копией !!!
У меня другой навык - искать ошибки. Это грубейший методический промах. Надо, наоборот, выстраивать всю работу так, чтобы можно было быстро вернуться к началу - "откатить" ситуацию...
В данном случае ситуация "правильная", поскольку раньше я не поленился и сделал предварительно копию - commons_old
...Однако, честно говоря, backup базы данных не делал..., оправдал себя тем, что она новая и пустая..., что по гамбургскому счету - халтура...
Тем не менее, сначала поменял в /var/www/html/commons/sites/default/settings.php
УдалитьChange it into:
$update_free_access = TRUE;
запустил http://localhost/commons/update.php снова - не помогло, опять No pending updates.
Потом повторил попытку после
[root@localhost conf]# service httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]
- не помогло, опять No pending updates
Ну и ладно, начнем все сначала
1. Сначала создаем резервную копию директории
Удалить[root@localhost conf]# cd /var/www/html
[root@localhost html]# cp -R commons_old commons_old_2
2. Затем (согласно http://drupal.org/node/1223018)
УдалитьGo to Administration > Configuration > Development > Maintenance mode. Enable the "Put site into maintenance mode" checkbox and save the configuration.
Не уверен, что предыдущий шаг был необходим (на localhost), но делаем все по инструкции..., далее нужно было удалить все файлы и директории, кроме
Удалитьsites и profiles
из commons_old
Эта операция оказалась трудоемкой, поскольку я сначала запустил ее только с опцией -R, на каждом шаге удаления файла или папки оболочка спрашивала, удалять или пропустить..., в конце концов нажимать на кнопки надоело, закрыл сессию, м в новой
[root@localhost html]# rm -Rf commons_old
снес без шума и пыли всю директорию, а потом создал новую директорию
[root@localhost html]# mkdir c_old
и скопировал туда старые папки
[root@localhost html]# cd commons_old_2
[root@localhost commons_old_2]# cp -r sites profiles /var/www/html/c_old
Потом пришлось менять владельца (поскольку сессия была открыта с правами root)
[root@localhost html]# chown -R Altersego c_old
Потом в папку нужно было залить новый дистрибутив, при этом я уже догадывался, почему две старые папки не надо затирать новыми
Удалить[root@localhost Desktop]# cp -R drupal-7.19/* drupal-7.19/.htaccess /var/www/html/c_old
cp: overwrite `/var/www/html/c_old/profiles/testing/testing.install'? n
cp: overwrite `/var/www/html/c_old/profiles/testing/modules/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.info'? n
cp: overwrite `/var/www/html/c_old/profiles/testing/modules/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.module'? n
cp: overwrite `/var/www/html/c_old/profiles/testing/modules/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.info'? n
cp: overwrite `/var/www/html/c_old/profiles/testing/modules/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.test'? n
cp: overwrite `/var/www/html/c_old/profiles/testing/modules/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.module'? n
cp: overwrite `/var/www/html/c_old/profiles/testing/testing.profile'? n
cp: overwrite `/var/www/html/c_old/profiles/testing/testing.info'? n
cp: overwrite `/var/www/html/c_old/profiles/standard/translations/README.txt'? n
cp: overwrite `/var/www/html/c_old/profiles/standard/standard.install'? n
cp: overwrite `/var/www/html/c_old/profiles/standard/standard.profile'? n
cp: overwrite `/var/www/html/c_old/profiles/standard/standard.info'? n
cp: overwrite `/var/www/html/c_old/profiles/minimal/translations/README.txt'? n
cp: overwrite `/var/www/html/c_old/profiles/minimal/minimal.info'? n
cp: overwrite `/var/www/html/c_old/profiles/minimal/minimal.profile'? n
cp: overwrite `/var/www/html/c_old/profiles/minimal/minimal.install'? n
cp: overwrite `/var/www/html/c_old/sites/README.txt'? n
cp: overwrite `/var/www/html/c_old/sites/default/default.settings.php'? n
cp: overwrite `/var/www/html/c_old/sites/all/modules/README.txt'? n
cp: overwrite `/var/www/html/c_old/sites/all/themes/README.txt'? n
cp: overwrite `/var/www/html/c_old/sites/example.sites.php'? n
После всех упражнений с копированием получил на странице http://localhost/c_old/update.php
ОтветитьУдалить(все, как и положено)
Access denied. You are not authorized to access this page. Log in using either an account with the administer software updates permission or the site maintenance account (the account you created during installation). If you cannot log in, you will have to edit settings.php to bypass this access check. To do this:
With a text editor find the settings.php file on your system. From the main Drupal directory that you installed all the files into, go to sites/your_site_name if such directory exists, or else to sites/default which applies otherwise.
There is a line inside your settings.php file that says $update_free_access = FALSE;. Change it to $update_free_access = TRUE;.
As soon as the update.php script is done, you must change the settings.php file back to its original form with $update_free_access = FALSE;.
To avoid having this problem in the future, remember to log in to your website using either an account with the administer software updates permission or the site maintenance account (the account you created during installation) before you backup your database at the beginning of the update process.
Проделал вышепредписанную операцию $update_free_access = TRUE;
ОтветитьУдалитьПолучил доступ к следующей странице, на ней первичная диагностика
Web server Apache/2.2.23 (CentOS) OK
PHP 5.3.20 OK
PHP register globals Disabled OK
PHP extensions Enabled OK
Database support Enabled OK
PHP memory limit 1024M OK
File system Writable (public download method) OK
Unicode library PHP Mbstring Extension
И предупреждение:
Timeago library 0.11.4
The Timeago library is installed, but a newer version is available. You may wish to download the latest version from http://timeago.yarp.com/jquery.timeago.js and overwrite the current version located at profiles/commons/modules/contrib/timeago/jquery.timeago.js.
Решил попробовать для скачивания js бибилиотеки комманду
ОтветитьУдалить[root@localhost sites]# wget http://timeago.yarp.com/jquery.timeago.js
--2013-02-05 21:51:01-- http://timeago.yarp.com/jquery.timeago.js
Resolving timeago.yarp.com... 204.232.175.78
Connecting to timeago.yarp.com|204.232.175.78|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5006 (4.9K) [application/x-javascript]
Saving to: `jquery.timeago.js'
100%[======================================>] 5,006 24.3K/s in 0.2s
2013-02-05 21:51:02 (24.3 KB/s) - `jquery.timeago.js' saved [5006/5006]
куда файл сохранился?
Сохранился в текущую директорию, надо было сначала в нее войти, а потом уже качать файл...
УдалитьТеперь пришлось все это передвигать
[root@localhost sites]# pwd
/var/www/html/c_old/sites
[root@localhost sites]# cd ..
[root@localhost c_old]# mv sites/jquery.timeago.js profiles/commons/modules/contrib/timeago
mv: overwrite `profiles/commons/modules/contrib/timeago/jquery.timeago.js'? y
Раз был вопрос о перезаписи, значит все правильно - в директории должен быть старый файл с тем же именем...
На следующем шаге попадаем на страницу начинающуюся с интересного призыва
ОтветитьУдалитьUse this utility to update your database whenever a new release of Drupal or a module is installed.
Получается, что мы этот скрипт рекомендуется использовать для любых апдейтов для обновления базы данных...
А я уже знаю, что если БД не надо менять, то скрипт так и скажет...
Так и есть, скрипт опять выдает
УдалитьNo pending updates.
На странице No pending updates нажимае на ссылочку
ОтветитьУдалитьи попадаем на страницу
http://localhost/c_old/
Site under maintenance
Altersego community is currently under maintenance. We should be back shortly. Thank you for your patience.
и чешем репу... Как залогинится? А очень просто, надо добавить в строку
http://localhost/c_old/user
и сайт выбросит вас на страницу ввода пароля:
http://localhost/c_old/?q=user/login
И вот, свершилось, ядро обновилено, http://localhost/c_old/?q=admin/reports/status
ОтветитьУдалитьно система выдает изрядное количество предупреждений:
Access to update.php Not protected
The update.php script is accessible to everyone without authentication check, which is a security risk. You must change the $update_free_access value in your settings.php back to FALSE.
Сделано
Apache Solr Your site was unable to contact the Apache Solr server.
УдалитьDefault environment url:
http://localhost:8983/solr
Зачем мне вообще этот Apache Solr?
Впрочем в БД (из 198 таблиц... многовато... гм гм) штук 8 с префиксом "ApacheSolr_", так что надо разбираться...
В Википедии http://en.wikipedia.org/wiki/Apache_Solr можно узнать, что это отдеьный поисковый корпоративный сервер...
an open source enterprise search platform from the Apache Lucene project
...
Solr is written in Java and runs as a standalone full-text search server within a servlet container such as Apache Tomcat or Jetty. Solr uses the Lucene Java search library at its core for full-text indexing and search, and has REST-like HTTP/XML and JSON APIs that make it easy to use from virtually any programming language.
Solr's powerful external configuration allows it to be tailored to almost any type of application without Java coding, and it has an extensive plugin architecture when more advanced customization is required.
Еще одна проблемка:
УдалитьCTools CSS Cache Unable to create
The CTools CSS cache directory, ctools/css could not be created due to a misconfigured files directory. Please ensure that the files directory is correctly configured and that the webserver has permission to create directories.
Ага, дело, по-видимому в разрешениях..., но что делают эти CTools CSS Cache, наверное, то, что надо - из десятков разных файлов CSS создают один...?
Вот здесь http://drupal.org/node/1511426
в самом конце не очень грамотный совет (... 777 - это слишком круто)
Check you file system path
if its like "sites/default/files"
go to files directory and give 777 permission to files/ctools
run CRON check status report.
If error still exist just create files/ctools/css and give permission 777
CHEERS!!!
Впрочем, 777 для папки - это возможность открывать, читать и записывавть..., так что, просто сменю разрешение, как выше и советуется...
Удалить[root@localhost Desktop]# cd /var/www/html/c_old/sites/default
[root@localhost default]# ls -Z
-rwxr-xr-x Altersego root user_u:object_r:httpd_sys_content_t default.settings.php
drwxr-xr-x Altersego root user_u:object_r:httpd_sys_content_t files
-rwxr-xr-x Altersego root user_u:object_r:httpd_sys_content_t settings.php
-rw-r--r-- Altersego root user_u:object_r:httpd_sys_content_t settings.php~
Не надо забывать и про SELinux context (пользователь не ограничен, объект тоже, а тип, как и положено -httpd...)
Попробуем просто
[root@localhost default]# chmod 777 files
[root@localhost default]# ls -l
...
drwxrwxrwx 5 Altersego root 4096 Feb 5 21:03 files
...
Все записи выше со страницы после обновления ядра были с иконкой белого креста (умножить) в красном кружке..., т.е., это были ошибки...
ОтветитьУдалитьА вот предупреждение (желтый треугольник):
Drupal core update status No available releases found
There was a problem checking available updates for Drupal. See the available updates page for more information and to install your missing updates.
Т.е., надо посмотреть обновления модулей потом... (вольный перевод, в котором я не уверен...)
При попытке перегрузить страницу после всех вышеописанных изменнений...
ОтветитьУдалитьвсе страницы сайта http://localhost/c_old/ выдавали
Parse error: syntax error, unexpected T_VARIABLE in /var/www/html/c_old/sites/default/settings.php on line 259
Собственно, строчка 259 - это
* Example:
* $drupal_hash_salt = file_get_contents('/home/example/salt.txt');
*
*/
$drupal_hash_salt = 'cvAg7WrCi0fuAhcdy5qdW-hvmahbMkUselazNsISzno';
по-видимому эта строка была вставлена не при обновлении БД, а после изменений в settings.php
Но кроме "You must change the $update_free_access value in your settings.php back to FALSE"
я ничего здесь не изменял...
попробуем откатить назад... не помогает...
Надо разбираться со всеми этими солями и хэшами...
Вот здесь хороший набор ссылок по вопросу
http://drupal.stackexchange.com/questions/15772/how-to-set-up-salt-hash-while-installing-drupal-7
Вот хорошее описание для DRupal
http://translate.google.com/toolkit/workbench?did=005uffq007tee3qs9wcg&hl=en
Ошибка оказалась простым следствием "случайного движения"
ОтветитьУдалитьЯ редактировал файл settings.php вручную, и (не знаю, как) умудрился "добавить" в
$update_free_access = TRUE;
/**
* Salt for one-time login links and cancel links, form tokens, etc.
*
* This variable will be set to a random value by the installer. All one-time
* login links will be invalidated if the value is changed. Note that if your
* site is deployed on a cluster of web servers, you must ensure that this
* variable has the same value on each server. If this variable is empty, a hash
* of the serialized database credentials will be used as a fallback salt.
*
* For enhanced security, you may set this variable to a value using the
* contents of a file outside your docroot that is never saved together
* with any backups of your Drupal files and database.
*
* Example:
* $drupal_hash_salt = file_get_contents('/home/example/salt.txt');
*
*/
$drupal_hash_salt = 'cvAg7WrCi0fuAhcdy5qdW-hvmahbMkUselazNsISzno';
---------------
слово find ..., получилось вот так:
/**
$update_free_access = FALSE;
find/**
---------------
Обнаружил это дело почти случайно - решил сравнить хэши в файлах settings.php
для новой папки c_old и действующе неудачной commons...
Не следует пренебрегать тупым сравнением файлов...
Это следствие идеологии - откатить (а не думать), а я опять наступил на любимые грабли
УдалитьНо все=таки... не мешало бы знать, как работает механизм
ОтветитьУдалитьhttp://api.drupal.org/api/drupal/includes!common.inc/function/drupal_get_hash_salt/7
drupal_get_hash_salt
7 common.inc drupal_get_hash_salt()
8 bootstrap.inc drupal_get_hash_salt()
Gets a salt useful for hardening against SQL injection.
Return value
A salt based on information in settings.php, not in the database.
3 calls to drupal_get_hash_salt()
File
includes/common.inc, line 5023
Common functions that many Drupal modules will need to reference.
Code
function drupal_get_hash_salt() {
global $drupal_hash_salt, $databases;
// If the $drupal_hash_salt variable is empty, a hash of the serialized
// database credentials is used as a fallback salt.
return empty($drupal_hash_salt) ? hash('sha256', serialize($databases)) : $drupal_hash_salt;
}
Чтобы найти все файлы, содержащие хэш..., я попробовал вот эту комманду:
Удалить[root@localhost c_old]# grep -R salt *
Вывалило всего изрядно...
Пробую скопировать НЕКОТОРЫЕ результатв работы комманы:
ОтветитьУдалить[root@localhost c_old]# grep -R salt *
includes/password.inc: * Generates a random base 64-encoded salt prefixed with settings for the hash.
includes/password.inc: * Proper use of salts may defeat a number of attacks, including:
includes/password.inc: * A 12 character string containing the iteration count and a random salt.
includes/password.inc:function _password_generate_salt($count_log2) {
includes/password.inc: // 6 bytes is the standard salt for a portable phpass hash.
includes/password.inc: * By using a salt and repeated hashing the password is "stretched". Its
includes/password.inc: * An existing hash or the output of _password_generate_salt(). Must be
includes/password.inc: * at least 12 characters (the settings and salt).
includes/password.inc: * A string containing the hashed password (and salt) or FALSE on failure.
includes/password.inc: $salt = substr($setting, 4, 8);
includes/password.inc: // Hashes must have an 8 character salt.
includes/password.inc: if (strlen($salt) != 8) {
includes/password.inc: $hash = hash($algo, $salt . $password, TRUE);
includes/password.inc: * A string containing the hashed password (and a salt), or FALSE on failure.
includes/password.inc: return _password_crypt('sha512', $password, _password_generate_salt($count_log2));
Итак, исправили "опечатку", все работет, опять на странице
ОтветитьУдалитьполучаем
CTools CSS Cache Unable to create
The CTools CSS cache directory, ctools/css could not be created due to a misconfigured files directory. Please ensure that the files directory is correctly configured and that the webserver has permission to create directories.
Гуглим, и находим на http://drupal.org/node/1236770
the directory refer to sites/default/files/ctools, not the sites/all/modules/ctools. chmod 777 sites/default/files/ctools
Пробуем:
hmod 777 sites/default/files/ctools
Не получается, снова гуглим,
Пробуем
chmod 777 -R sites/default/files/
Вот теперь CTools CSS Cache Exists
И остается одно предупреждение:
ОтветитьУдалитьTokens Problems detected
The following token types are not defined but have tokens:
$info['types']['taxonomy_term']
---------
Пока забудем про него, нам еще модули обновлять
И последняя ошибка (на странице статуса http://localhost/c_old/?q=admin/reports/status)
ОтветитьУдалитьModule and theme update status Unsupported release
The installed version of at least one of your modules or themes is no longer supported. Upgrading or disabling is strongly recommended. See the project homepage for more details. See the available updates page for more information and to install your missing updates.
Ну мы и собирались обновялть модули...
На странице обновлений всего 16 новых модулей Commons, причем все .dev
ОтветитьУдалитьГружу не глядя (в документацию релизов)...
Все грузится хорошо (скачивается), получаю вот такую страницу (http://localhost/c_old/?q=admin/update/ready)
Updates downloaded successfully.
Ready to update
Updating modules and themes requires FTP access to your server. See the handbook for other update methods.
Back up your database and site before you continue. Learn how.
Perform updates with site in maintenance mode (strongly recommended)
Надо все это проделать (вспомнить про vsftpd, прочитать на сайте про альтернативы загрузки, и сделать бэкап)... но так все это обрыдло, что лучше посмотреть, где скачанные обновления и (чтобы не потерять до завтра) и выключить компьютер...
Вспомнил vsftpd (см. выше), без "подглядок"
ОтветитьУдалить[root@localhost c_old]# service vsftpd status
vsftpd (pid 3176) is running...
[root@localhost c_old]# ftp localhost
Connected to localhost.localdomain.
220 Welcome to blah FTP service.
530 Please login with USER and PASS.
530 Please login with USER and PASS.
KERBEROS_V4 rejected as an authentication type
ftp> user
(username) Altersego
331 Please specify the password.
Password:
230 Login successful.
ftp> ls
227 Entering Passive Mode (127,0,0,1,68,162)
150 Here comes the directory listing.
drwxr-xr-x 3 0 0 4096 Feb 03 2011 0SE-new
drwxr-xr-x 3 0 0 4096 Nov 24 2011 Centos
drwxr-xr-x 3 0 0 4096 Nov 24 2011 Mymirror,Centos5updates
226 Directory send OK.
ftp>
И здесь вспомнил, что в листинге директории так мало файлов и много нулей из-за SELinux, нашел на http://win-lamp-altersego.blogspot.ru/2013/01/vsftpd.html
в комментариях, что можно просто отключить сервис:
[root@localhost vsftpd]# getenforce
Enforcing
[root@localhost vsftpd]# setenforce 0
[root@localhost vsftpd]# getenforce
Permissive
Импортировал , бэкап БВ commons phpMySql (настройки сфотографировл..., надо бы не забыть про них), они почти не отличаются от тех, что в книге Д. Колесниченко "Drupal-7"
УдалитьДамп получился более 8МБ (12), потому phpMySql не хочет его импортировать в новую БД, которую я назвал
c_old
Но об этом потом (сделаю о коммандах и работе с mysql отдельный пост).
Пока ограничимся тем, что дамп БД есть на рабочем столе Centos моего ноутбука...
Теперь есть достуа ко всем файлам, и можно даже перейти в любую папку на сервере:
ОтветитьУдалитьftp> ls
227 Entering Passive Mode (127,0,0,1,91,128)
150 Here comes the directory listing.
drwxr-xr-x 3 0 0 4096 Feb 03 2011 0SE-new
drwxr-xr-x 3 0 0 4096 Nov 24 2011 Centos
drwxr-xr-x 9 500 500 4096 Feb 06 17:04 Desktop
-rw-rw-r-- 1 500 500 1066716 Nov 03 2011 Magnolia.mpg
drwxr-xr-x 3 0 0 4096 Nov 24 2011 Mymirror,Centos5updates
-rw-rw-r-- 1 0 0 2 Jan 31 2011 Text File
-rw-rw-r-- 1 500 500 10581117 Jan 10 16:30 commons.tar.gz
-rw-rw-r-- 1 500 500 745385 Aug 01 2009 cssed-0.4.0-0.i386.rpm
-rw-rw-r-- 1 500 500 2 Dec 12 2011 fonts.dir
-rw-rw-r-- 1 500 500 635117 Jan 13 17:56 out-1.ogv
-rw-rw-r-- 1 500 500 4329510 Jan 13 17:55 out.ogv
226 Directory send OK.
ftp> cd /
250 Directory successfully changed.
.....
250 Directory successfully changed.
ftp> pwd
257 "/var/www/html/c_old/profiles/commons"
ftp> ls
227 Entering Passive Mode (127,0,0,1,75,200)
150 Here comes the directory listing.
-rwxr-xr-x 1 500 0 18092 Feb 05 17:03 LICENSE.txt
-rwxr-xr-x 1 500 0 427 Feb 05 17:03 build-commons.make
-rwxr-xr-x 1 500 0 2669 Feb 05 17:03 commons.info
-rwxr-xr-x 1 500 0 2185 Feb 05 17:03 commons.install
-rwxr-xr-x 1 500 0 17634 Feb 05 17:03 commons.profile
-rwxr-xr-x 1 500 0 938 Feb 05 17:03 drupal-org-core.make
-rwxr-xr-x 1 500 0 17642 Feb 05 17:03 drupal-org.make
drwxr-xr-x 2 500 0 4096 Feb 05 17:03 images
drwxr-xr-x 3 500 0 4096 Feb 05 17:03 modules
drwxr-xr-x 3 500 0 4096 Feb 05 17:03 themes
226 Directory send OK.
Не могу найти, аналог ls -all в ftp, потому делаю распечатку во втором (соседнем) окне терминала
Удалить[root@localhost commons]# ls -all
total 144
drwxr-xr-x 5 Altersego root 4096 Feb 5 21:03 .
drwxr-xr-x 6 Altersego root 4096 Feb 5 21:03 ..
-rwxr-xr-x 1 Altersego root 427 Feb 5 21:03 build-commons.make
-rwxr-xr-x 1 Altersego root 2669 Feb 5 21:03 commons.info
-rwxr-xr-x 1 Altersego root 2185 Feb 5 21:03 commons.install
-rwxr-xr-x 1 Altersego root 17634 Feb 5 21:03 commons.profile
-rwxr-xr-x 1 Altersego root 938 Feb 5 21:03 drupal-org-core.make
-rwxr-xr-x 1 Altersego root 17642 Feb 5 21:03 drupal-org.make
drwxr-xr-x 2 Altersego root 4096 Feb 5 21:03 images
-rwxr-xr-x 1 Altersego root 18092 Feb 5 21:03 LICENSE.txt
drwxr-xr-x 3 Altersego root 4096 Feb 5 21:03 modules
drwxr-xr-x 3 Altersego root 4096 Feb 5 21:03 themes
Ага, вроде бы владелец всех каталогов Altersego, как и пользователь ftp...
Теперь продолжим обновление модулей Drupal (см. выше)
ОтветитьУдалитьСделав все Бэкапы..., стоп, а папки я скопировал? Нет!
Старый склеротик должен бороться с собственной ленью и по памяти набрать комманды
[root@localhost c_old]# cd ..
[root@localhost html]# ls
c_old commons commons_old_2 drupal-7.18.zip drupal-7.9 op6 op622 openpublish79 tattler test.php test.php~ thebuggenie touch
[root@localhost html]# cp -R c_old c_old_core
Не забыть потом снести эти промежуточные бэкапы...
Вот теперь продолжим
ОтветитьУдалитьДавим на кнопку "продолжить" и попадаем на http://localhost/c_old/authorize.php, которая начинается с предупреждения
WARNING: You are not using an encrypted connection, so your password will be sent in plain text. Learn more.
Игнорируем его два раза, и вводим ниже логин
Altersego
и пароль ***** (секрктный)
В advanced settings оставляем умолчания
localhost
port 21
Получаем в ответ
ОтветитьУдалитьWarning: ftp_login() [function.ftp-login]: Login incorrect. in FileTransferFTPExtension->connect() (line 59 of /var/www/html/c_old/includes/filetransfer/ftp.inc).
Failed to connect to the server. The server reports the following message:
Cannot log in to FTP server. Check username and password
For more help installing or updating code on your server, see the handbook.
Идем по указанному адресу /var/www/html/c_old/includes/filetransfer/ftp.inc
и видим, что перед выданной ошибкой есть еще и ошибка соединения с сервером
if (!$this->connection) {
throw new FileTransferException("Cannot connect to FTP Server, check settings");
}
if (!ftp_login($this->connection, $this->username, $this->password)) {
throw new FileTransferException("Cannot log in to FTP server. Check username and password");
Получается, что дело именно в пароле...
действительно, в строке логина altersego вместо Altersego
Оказалось, что Firefox c включенной опцией запоминания паролей перед отправкой формы исправлял
УдалитьAltersego на altersego
Пришлось в параметрах Firefox найти вкладку сохраненные пароли и удалить пароль для localhost...
Кругом враги, хорошо, что сразу догадался...
Теперь соединение по ftp было установлено, пошло обновление, но оидн модуль не захотел обновляться:
ОтветитьУдалитьUpdate failed! See the log below for more information. Your site is still in maintenance mode.
commons_activity_streams Installed commons_activity_streams successfully
commons_posts Installed commons_posts successfully
commons_profile_social Installed commons_profile_social successfully
commons_follow Installed commons_follow successfully
commons_groups Installed commons_groups successfully
commons_body Installed commons_body successfully
commons_bw Error installing / updating
File Transfer failed, reason: Unable to remove to directory /var/www/html/c_old/profiles/commons/modules/contrib/commons_bw
commons_content_moderation Installed commons_content_moderation successfully
commons_events Installed commons_events successfully
commons_featured Installed commons_featured successfully
commons_like Installed commons_like successfully
commons_location Installed commons_location successfully
****** Installed commons_misc successfully
commons_notify Installed commons_notify successfully
commons_pages Installed commons_pages successfully
commons_profile_base Installed commons_profile_base successfully
Next steps
Your modules have been downloaded and updated.
Run database updates
Смотрим папки обновлений
ОтветитьУдалить[root@localhost contrib]# ls -all
total 704
drwxr-xr-x 88 Altersego root 4096 Feb 7 15:39 .
drwxr-xr-x 3 Altersego root 4096 Feb 5 21:03 ..
drwxr-xr-x 5 Altersego root 4096 Feb 5 21:03 acquia_connector
drwxr-xr-x 5 Altersego root 4096 Feb 5 21:03 addressfield
drwxr-xr-x 3 Altersego root 4096 Feb 5 21:03 admin_icons
drwxr-xr-x 8 Altersego root 4096 Feb 5 21:03 aloha
drwxr-xr-x 7 Altersego root 4096 Feb 5 21:03 apachesolr
drwxr-xr-x 2 Altersego root 4096 Feb 5 21:03 apachesolr_og
drwxr-xr-x 4 Altersego Altersego 4096 Feb 7 15:39 commons_activity_streams
drwxr-xr-x 2 Altersego Altersego 4096 Feb 7 15:39 commons_body
drwxr-xr-x 2 Altersego root 4096 Feb 7 15:39 commons_bw
drwxr-xr-x 2 Altersego Altersego 4096 Feb 7 15:39 commons_content_moderation
drwxr-xr-x 2 Altersego root 4096 Feb 5 21:03 commons_documents
drwxr-xr-x 6 Altersego Altersego 4096 Feb 7 15:39 commons_events
drwxr-xr-x 2 Altersego Altersego 4096 Feb 7 15:39 commons_featured
drwxr-xr-x 8 Altersego Altersego 4096 Feb 7 15:39 commons_follow
drwxr-xr-x 3 Altersego Altersego 4096 Feb 7 15:39 commons_groups
drwxr-xr-x 3 Altersego Altersego 4096 Feb 7 15:39 commons_like
drwxr-xr-x 2 Altersego Altersego 4096 Feb 7 15:39 commons_location
drwxr-xr-x 2 Altersego Altersego 4096 Feb 7 15:39 commons_misc
drwxr-xr-x 2 Altersego root 4096 Feb 5 21:03 commons_notices
drwxr-xr-x 2 Altersego Altersego 4096 Feb 7 15:39 commons_notify
drwxr-xr-x 2 Altersego Altersego 4096 Feb 7 15:39 commons_pages
drwxr-xr-x 2 Altersego Altersego 4096 Feb 7 15:39 commons_posts
drwxr-xr-x 2 Altersego Altersego 4096 Feb 7 15:39 commons_profile_base
drwxr-xr-x 2 Altersego Altersego 4096 Feb 7 15:39 commons_profile_social
drwxr-xr-x 3 Altersego root 4096 Feb 5 21:03 commons_q_a
drwxr-xr-x 4 Altersego root 4096 Feb 5 21:03 commons_radioactivity
drwxr-xr-x 4 Altersego root 4096 Feb 5 21:03 commons_search
drwxr-xr-x 2 Altersego root 4096 Feb 5 21:03 commons_site_homepage
drwxr-xr-x 2 Altersego root 4096 Feb 5 21:03 commons_topics
drwxr-xr-x 2 Altersego root 4096 Feb 5 21:03 commons_user_profile_pages
drwxr-xr-x 2 Altersego root 4096 Feb 5 21:03 commons_utility_links
drwxr-xr-x 3 Altersego root 4096 Feb 5 21:03 commons_wikis
drwxr-xr-x 2 Altersego root 4096 Feb 5 21:03 commons_wysiwyg
drwxr-xr-x 3 Altersego root 4096 Feb 5 21:03 connector
drwxr-xr-x 18 Altersego root 4096 Feb 5 21:03 ctools
drwxr-xr-x 6 Altersego root 4096 Feb 5 21:03 custom_search
drwxr-xr-x 12 Altersego root 4096 Feb 5 21:03 date
drwxr-xr-x 3 Altersego root 4096 Feb 5 21:03 date_facets
drwxr-xr-x 4 Altersego root 4096 Feb 5 21:03 devel
drwxr-xr-x 3 Altersego root 4096 Feb 5 21:03 diff
drwxr-xr-x 2 Altersego root 4096 Feb 5 21:03 edit_profile
drwxr-xr-x 2 Altersego root 4096 Feb 5 21:03 email_registration
drwxr-xr-x 7 Altersego root 4096 Feb 5 21:03 entity
drwxr-xr-x 2 Altersego root 4096 Feb 5 21:03 entitycache
drwxr-xr-x 6 Altersego root 4096 Feb 5 21:03 entityreference
drwxr-xr-x 3 Altersego root 4096 Feb 5 21:03 entityreference_prepopulate
drwxr-xr-x 5 Altersego root 4096 Feb 5 21:03 facetapi
drwxr-xr-x 5 Altersego root 4096 Feb 5 21:03 features
drwxr-xr-x 5 Altersego root 4096 Feb 5 21:03 flag
drwxr-xr-x 3 Altersego root 4096 Feb 5 21:03 flag_abuse
drwxr-xr-x 3 Altersego root 4096 Feb 5 21:03 http_client
drwxr-xr-x 3 Altersego root 4096 Feb 5 21:03 jquery_update
drwxr-xr-x 4 Altersego root 4096 Feb 5 21:03 link
Продолжение:
Удалитьdrwxr-xr-x 5 Altersego root 4096 Feb 5 21:03 memcache
drwxr-xr-x 2 Altersego root 4096 Feb 5 21:03 menu_attributes
drwxr-xr-x 6 Altersego root 4096 Feb 5 21:03 message
drwxr-xr-x 6 Altersego root 4096 Feb 5 21:03 message_notify
drwxr-xr-x 4 Altersego root 4096 Feb 5 21:03 message_subscribe
drwxr-xr-x 8 Altersego root 4096 Feb 5 21:03 metatag
drwxr-xr-x 4 Altersego root 4096 Feb 5 21:03 module_filter
drwxr-xr-x 5 Altersego root 4096 Feb 5 21:03 oauth
drwxr-xr-x 3 Altersego root 4096 Feb 5 21:03 oauthconnector
drwxr-xr-x 12 Altersego root 4096 Feb 5 21:03 og
drwxr-xr-x 6 Altersego root 4096 Feb 5 21:03 panelizer
drwxr-xr-x 12 Altersego root 4096 Feb 5 21:03 panels
drwxr-xr-x 2 Altersego root 4096 Feb 5 21:03 pathauto
drwxr-xr-x 5 Altersego root 4096 Feb 5 21:03 pm_existing_pages
drwxr-xr-x 3 Altersego root 4096 Feb 5 21:03 queue_mail
drwxr-xr-x 8 Altersego root 4096 Feb 5 21:03 quicktabs
drwxr-xr-x 2 Altersego root 4096 Feb 5 21:03 r4032login
drwxr-xr-x 8 Altersego root 4096 Feb 5 21:03 radioactivity
drwxr-xr-x 5 Altersego root 4096 Feb 5 21:03 rate
drwxr-xr-x 2 Altersego root 4096 Feb 5 21:03 realname
drwxr-xr-x 3 Altersego root 4096 Feb 5 21:03 redirect
drwxr-xr-x 5 Altersego root 4096 Feb 5 21:03 registration
drwxr-xr-x 9 Altersego root 4096 Feb 5 21:03 rules
drwxr-xr-x 3 Altersego root 4096 Feb 5 21:03 search_facetapi
drwxr-xr-x 4 Altersego root 4096 Feb 5 21:03 sharethis
drwxr-xr-x 2 Altersego root 4096 Feb 5 21:03 strongarm
drwxr-xr-x 2 Altersego root 4096 Feb 5 21:03 timeago
drwxr-xr-x 3 Altersego root 4096 Feb 5 21:03 token
drwxr-xr-x 14 Altersego root 4096 Feb 5 21:03 views
drwxr-xr-x 7 Altersego root 4096 Feb 5 21:03 views_bulk_operations
drwxr-xr-x 3 Altersego root 4096 Feb 5 21:03 views_field_view
drwxr-xr-x 2 Altersego root 4096 Feb 5 21:03 views_load_more
drwxr-xr-x 4 Altersego root 4096 Feb 5 21:03 votingapi
в голову пришла мысль, что дело в том, что этот модуль в группе root, в то время, не как другие...
УдалитьПроверять дольше, чем исправить:
[root@localhost contrib]# chgrp -R Altersego *
[root@localhost contrib]# ls -all
total 704
drwxr-xr-x 88 Altersego root 4096 Feb 7 15:39 .
drwxr-xr-x 3 Altersego root 4096 Feb 5 21:03 ..
drwxr-xr-x 5 Altersego Altersego 4096 Feb 5 21:03 acquia_connector
drwxr-xr-x 5 Altersego Altersego 4096 Feb 5 21:03 addressfield
drwxr-xr-x 3 Altersego Altersego 4096 Feb 5 21:03 admin_icons
.......
.......
Дальше нужно было бы менять таблицы базы данных, но зачем же их менять, если модули не установлены..., потому вышел из процесса обновления и зашел на страницу статтуса
На странице обновлений доступно еще полтора десятка обновлений
ОтветитьУдалитьhttp://localhost/c_old/?q=batch&op=start&id=17
Но после загрузки постоянно выскакивает ошибка:
HTTP error -1 occurred when trying to fetch http://ftp.drupal.org/files/projects/commons-7.x-3.0-beta2-core.tar.gz.
Downloading updates failed:
Failed to download commons from http://ftp.drupal.org/files/projects/commons-7.x-3.0-beta2-core.tar.gz
1. Надо понять, как работает скрипт обновлений, почему он не может скачать файл, который я попробовал и сохранил браузером на рабочий стол ноутбука.
2. Еще я не понимаю, как быть с правами процессов и где посмотреть к какой группе (группам) принадлежит пользователь Altersego...
Ошибка
УдалитьHTTP error -1 occurred when trying to fetch http://ftp.drupal.org/files/projects/commons-7.x-3.0-beta2-core.tar.gz.
выскакивает потому, что это не обновление профиля, а обновление всей сборки вместе с ядром...
А еще вывалилось изрядное количество новых обновлений модулей. Полагаю, что зависимости модулей здесь не разрешаются...
Даже сайт заблокировался - ....
Потому "не откатываем" к старой версии, а ставим новую... и разбираемся с пп. 1,2
Совершенно неожиданно, пытаясь найти ответ на вопрос 1., обнаружил заметку о правах пользователей на странице http://drupal.org/documentation/modules/update
ОтветитьУдалитьLet apache own the default folder
Posted by robcornerstone on May 14, 2012 at 6:12pm
Not all server environments support FTP due to security issues with anonymous users, or sending passwords in the clear for registered accounts. So in order to bypass the FTP login for Update Manager, apache must own the default folder (but nothing more!).
chown apache sites/default/
Note: the settings.php file inside the default folder contains the database connection string in clear text. This needs to be locked down:
chown rob:nobody sites/default/settings.php
chmod 640 sites/default/settings.php
This way, I can still edit the file, apache's group can read it, and "other" is denied.
By the way, one way to determine the user and group apache is running under is to go to the appropriate apache conf file and look for this syntax:
User apache
Group nobody
And as you mentioned earlier, apache needs to be able to write to the themes and modules folders:
chown -R rob:nobody sites/all/themes/ && chmod -R 770 $_
chown -R rob:nobody sites/all/modules/ && chmod -R 770 $_
I've been banging my head against the wall for the past few days, and this is the best workaround I could come up with. If this violates any best practices, please let me know.
еще одно предложение по смене владельца каталога http://drupal.org/node/1036494
ОтветитьУдалитьSolution for unwanted question about credentials
Posted by TheOptimizer on July 4, 2011 at 2:30pm
I have been fighting this problem several times, without success.
Now I have been able to pin down the problem.
The wanted behaviour is:
You paste the url of the module or theme you want to install
You click install
Your module or theme gets installed
What I have seen on several installations, and this is what you don't want:
You paste the url of the module or theme you want to install
You click install
It asks for some FTP (or SSH) credentials. WTF??????
To avoid this, make sure the folder /sites/default is OWNED by the user that executes the drupal scripts. On most Ubuntu installations, this is the apache user: www-data.
Don't ask me why this works. I don't know if this is intended or not. It doesn't make so much sense to me, but there might be an explanation. For me it would be OK that the temporary directory is writable by the apache user and the themes or modules folder is writable as well.
So this should do the trick when the user is www-data:
chown www-data sites/default
I hope this works. Please let me know.