You are here

INSTALL.txt in Domain Access 5

Same filename in this branch
  1. 5 INSTALL.txt
  2. 5 domain_conf/INSTALL.txt
  3. 5 domain_prefix/INSTALL.txt
Same filename and directory in other branches
  1. 6.2 INSTALL.txt
  2. 7.3 INSTALL.txt
  3. 7.2 INSTALL.txt

INSTALL file for Domain Access.

File

INSTALL.txt
View source
  1. /**
  2. * @file
  3. * INSTALL file for Domain Access.
  4. */
  5. Domain Access
  6. A domain-based access control system.
  7. CONTENTS
  8. --------
  9. 1. Introduction
  10. 2. Installation
  11. 2.1 Before Installing
  12. 2.2 Server Configuration
  13. 2.3 Setting DOMAIN_INSTALL_RULE
  14. 2.4 Setting DOMAIN_EDITOR_RULE
  15. 2.5 Setting DOMAIN_SITE_GRANT
  16. 3. Patches to Drupal Core
  17. 3.1 multiple_node_access.patch
  18. 3.2 custom_url_rewrite_outbound.patch
  19. 4. Configuring settings.php
  20. 4.1 $base_url
  21. 4.2 $db_prefix
  22. 4.3 $cookie_domain
  23. 4.4 custom_url_rewrite_outbound()
  24. 4.4.1 Installation
  25. 4.4.2 Option 1
  26. 4.4.3 Option 2
  27. 4.4.4 Testing Your Configuration
  28. 4.4.5 Additional Resources
  29. 5. Additional Module Installation
  30. 5.1 Domain Configuration
  31. 5.2 Domain Prefix
  32. 5.3 Domain Strict
  33. 6. Uninstalling
  34. ----
  35. 1. Introduction
  36. The Domain Access module is a Node Access module. It is designed to
  37. restrict access to content.
  38. WARNINGS:
  39. - Failure to install or uninstall this module according to instructions
  40. may cause errors in your site.
  41. - Node Access rules never apply to user 1 (the site admin) or to users
  42. with the 'administer nodes' permission. As such, these users will always
  43. be able to see all content on your site(s). To verify that Domain Access
  44. is working correctly, you will need to turn on its debug mode or view the
  45. site as a user without this permission. You may also enable the 'Enforce
  46. rules on adminstrators' setting, which will apply Domain Access
  47. restrcitions to all users. (See section 4.2.4 of README.txt for more
  48. details on this feature.)
  49. ----
  50. 2. Installation
  51. This module requires some advanced understanding of Drupal and of
  52. how DNS servers behave. If you simply untar the download and
  53. activate the module, it may not work correctly.
  54. Domain Access works by reading the inbound HTTP_HOST request
  55. and serving content appropriate to the requested domain. For this to
  56. work properly, all domains for your site must be routed to the same
  57. Drupal installation on your webserver.
  58. Domain Access was not designed to run on shared hosts, and you may need
  59. assistance from your provider to make it work correctly.
  60. For more background on DNS and virtual host configuration, please try the
  61. following documentation:
  62. For a general overview:
  63. - http://en.wikipedia.org/wiki/Virtual_hosting
  64. In-depth documentation with many examples for specific situations:
  65. - http://httpd.apache.org/docs/2.0/vhosts/
  66. - http://httpd.apache.org/docs/2.0/vhosts/examples.html
  67. When you enable the module, it will create a {domain} table in your Drupal
  68. database.
  69. All existing nodes on your site will be assigned to the default domain for your
  70. web site and to all affiliates. If you wish to alter this behavior, see sections
  71. 2.4 through 2.6 of README.txt
  72. ----
  73. 2.1 Before Installing
  74. You will need to do the following before you install the module.
  75. - Read this document
  76. - Configure your web server DNS records appropriately
  77. - Read the supplied README.txt
  78. - Install and configure Drupal normally.
  79. WARNING: The Domain Access module series instructs you to add several
  80. file includes to your settings.php file. Do not add these commands until
  81. after you have installed Drupal.
  82. ----
  83. 2.2 Server Configuration
  84. For the module to work correctly, the DNS record of your server must accept
  85. multiple DNS entries [most servers do]. Your new virtual host(s) must then
  86. be correctly configured for your server. In general, this involves small
  87. additions to the hosts file and the httpd.conf file.
  88. In order for the Apache server to find your virtual host(s), it absolutely
  89. needs two pieces of information: the ServerName (hostname & port the server
  90. uses to identify itself) and an IP address.
  91. The two basic methods for doing this are to either:
  92. - Set up WildCard DNS, so that *.example.com resolves to your Drupal site.
  93. (The asterisk indicates any and all names carrying the < example.com >
  94. suffix)
  95. - Set up each VirtualHost specifically, so that one.example.com,
  96. two.example.com, (and so on) all resolve to your Drupal site.
  97. For example, on a local testing machine, VirtualHosts in my hosts file could be
  98. configured in the following way:
  99. - ken.test => 127.0.0.1
  100. - one.ken.test => 127.0.0.1
  101. - two.ken.test => 127.0.0.1
  102. - foo.test => 127.0.0.1
  103. With their port and document root defined (WildCard set up) in the httpd.conf
  104. file:
  105. DocumentRoot /path/to/drupal/install
  106. ServerName ken.test
  107. ServerAlias *.ken.test foo.test
  108. In this case any subdomain (*.ken.test) and another domain foo.test resolve to
  109. the same location. When configuring DNS for Domain Access, the document root is
  110. the same for all the VirtualHosts. The documentRoot directive sets the directory
  111. from which httpd will serve files. For DA, there is one Drupal installation and
  112. it is this installation built on a single database that is serving the files.
  113. This becomes even clearer when the VirtualHosts are set up specifically,
  114. each with its own VirtualHost block in the httpd.conf file, for example:
  115. DocumentRoot /path/to/drupal/install
  116. ServerName ken.test
  117. DocumentRoot /path/to/drupal/install
  118. ServerName two.ken.test
  119. DocumentRoot /path/to/drupal/install
  120. ServerName foo.test
  121. This example gives a general idea of what is involved, but it is beyond the
  122. scope of this document to explain how to configure your specific DNS server
  123. situation, which may involve considerable research, trial & error or a call for
  124. help. Shared server situations can be particularly complicated and you should
  125. contact their administration for help with configuration if their online help
  126. files do not make things clear enough.
  127. After you have enabled multiple DNS entries to resolve to your single,
  128. default Drupal installation, you may activate the module and configure its
  129. settings at Admin > Build > Domains.
  130. ----
  131. 2.3 Setting DOMAIN_INSTALL_RULE
  132. This is an advanced instruction, and may be ignored.
  133. At the top of the domain.module file, you will find this line:
  134. define('DOMAIN_INSTALL_RULE', TRUE);
  135. This setting controls the default behavior of the module when installing over
  136. an existing installation. If set to TRUE, the Domain Access module will assign
  137. all existing nodes to be viewable by your primary domain.
  138. If you set this value to FALSE, existing content will not be visible on your
  139. primary domain unless DOMAIN_SITE_GRANT is set to TRUE.
  140. For more details, see section 5 of README.txt.
  141. ----
  142. 2.4 Setting DOMAIN_EDITOR_RULE
  143. This is an advanced instruction, and may be ignored.
  144. At the top of the domain.module file, you will find this line:
  145. define('DOMAIN_EDITOR_RULE', FALSE);
  146. This setting controls the default behavior for affiliate editors. If
  147. DOMAIN_INSTALL_RULE is set to FALSE, you may change this value to TRUE if you
  148. intend to use editing controls.
  149. If this is set to TRUE, all existing nodes on your site will be editable by
  150. users who are assigned as editors of your root domain.
  151. See section 3 and section 5 of README.txt for more information.
  152. ----
  153. 2.5 Setting DOMAIN_SITE_GRANT
  154. At the top of the domain.module file, you will find this line:
  155. define('DOMAIN_SITE_GRANT', TRUE);
  156. This setting controls the default behavior for viewing affiliate content.
  157. By design, the Domain Access module allows site administrators to assign
  158. content to 'all affiliates.' If this value is set to TRUE, then content
  159. assigned to all affiliates can be seen by all users on all current domains.
  160. On install, setting this value to TRUE will assign all current content to
  161. be viewable on all domains.
  162. Normally, you will not need to edit this value.
  163. ----
  164. 3. Patches to Drupal Core (optional)
  165. The following patches are optional. They affect advanced behavior of the
  166. Domain Access module.
  167. Patches are distributed in the 'patches' folder of the download.
  168. To apply these patches, place them in your root Drupal folder.
  169. Then follow the instructions at: http://drupal.org/patch/apply
  170. ----
  171. 3.1 multiple_node_access.patch
  172. You should apply this patch only if you use Domain Access along with
  173. another Node Access module, such as Organic Groups (OG).
  174. The multiple_node_access.patch allows Drupal to run more than one
  175. node access control scheme in parallel. Instead of using OR logic to
  176. determine node access, this patch uses subselects to enable AND logic
  177. for multiple node access rules.
  178. WARNING: This patch uses subselect statements and requires pgSQL or
  179. MySQL 4.1 or higher.
  180. To apply to patch, find the file:
  181. domain > patches > multiple_node_access.patch
  182. Copy the file to your root Drupal directory.
  183. From the command line, go to the Drupal root directory and run the command:
  184. patch -p0 < multiple_node_access.patch
  185. For more information, see http://drupal.org/patch/apply
  186. Developers: see http://drupal.org/node/191375 for more information.
  187. This patch is being submitted to Drupal core for version 7.
  188. ----
  189. 3.2 custom_url_rewrite_outbound.patch
  190. This patch is only needed if:
  191. -- You wish to allow searching of all domains from any domain.
  192. -- You use a content aggregation module such as MySite.
  193. -- You get "access denied" errors when linking to items on a
  194. user's Track page.
  195. -- You want to turn on the advanced setting "Search Engine
  196. Optimization" to avoid content from being indexed on multiple
  197. domains.
  198. This patch allows modules to edit the path to a Drupal object. In the
  199. above cases, some content can only be viewed from certain domains, so
  200. we must write absolute links to that content.
  201. This patch introduces backports custom_url_rewrite_outbound() to Drupal 5.
  202. To apply to patch, find the file:
  203. domain > patches > custom_url_rewrite_outbound.patch
  204. Copy the file to your root Drupal directory.
  205. From the command line, go to the Drupal root directory and run the command:
  206. patch -p0 < custom_url_rewrite_outbound.patch
  207. For more information, see http://drupal.org/patch/apply
  208. After you install this patch, you must edit your settings.php file. See
  209. section 4.4 for detailed instructions.
  210. Developers: see http://drupal.org/node/207330 for more information.
  211. ----
  212. 4. Configuring settings.php
  213. Remember, the Domain Access module lets you run multiple sites
  214. from a single installation. You only need one settings.php file.
  215. As a result, some options in your settings.php file need to be
  216. considered carefully.
  217. ----
  218. 4.1 $base_url
  219. The $base_url setting is normally not set. With Domain Access, you
  220. cannot set this value manually.
  221. Since mutliple domains are involved, Drupal needs to be allowed to
  222. set this value. (For the technical, this happens in the conf_init()
  223. function).
  224. ----
  225. 4.2 $db_prefix
  226. The $db_prefix value allows for table prefixing of your Drupal database
  227. in the event that you run more than one site from a single database.
  228. $db_prefix can be used normally with Domain Access.
  229. However, the Domain Prefix module provides for dynamic table prefixing
  230. based on the currently active domain. If you use the Domain Prefix module
  231. you can only set $db_prefix as a string value, not an array.
  232. For more detail, see INSTALL.txt in the domain_prefix folder.
  233. ----
  234. 4.3 $cookie_domain
  235. By design, Drupal cookies are set for the current website on login. That is, if
  236. you login from www.example.com, the cookie will be set from the domain
  237. 'www.example.com.'
  238. However, a cookie from www.example.com is not valid on one.example.com.
  239. In order to provide for login across your active domains, you must set the
  240. $cookie_domain value to the string indicating your root domain.
  241. Typically, this value is '.example.com'.
  242. If your domains do not share the top-level, then you may need to login to
  243. each site separately or use a module such as Single SignOn.
  244. ----
  245. 4.4 custom_url_rewrite_outbound()
  246. If you applied the custom_url_rewrite_outbound.patch, you must enable the
  247. function inside your settings.php file. The easiest way to do this is by using
  248. a PHP include to the file provided.
  249. If your site currently implements this function or its Drupal 5 equivalent,
  250. custom_url_rewrite(), you will need to make custom edits to your current file.
  251. Either move the function from domain/settings.inc into your current function,
  252. or vice versa.
  253. For more information, see
  254. http://api.drupal.org/api/function/custom_url_rewrite/5
  255. ----
  256. 4.4.1 Installation
  257. In the Domain Access download, find the following file:
  258. domain > settings_custom_url.inc
  259. You will need to load this file from inside your settings.php file. There
  260. are two methods for this.
  261. ----
  262. 4.4.2 Option 1 -- Preferred
  263. This method is preferred, since any updates to the module release
  264. will be reflected in this file.
  265. NOTE: the elements inside the ==== marks are php code that
  266. should be copied into your settings.php file. DO NOT COPY THE ==== MARKS.
  267. Add the following lines to the end of your settings.php file:
  268. ====
  269. /**
  270. * Add the custom_url_rewrite_outbound function.
  271. */
  272. include './path/to/modules/domain/settings_custom_url.inc';
  273. ====
  274. In this case, change 'path/to/modules' with the directory where your modules are
  275. stored. Typically this will be 'sites/all/modules', which makes the lines:
  276. ====
  277. /**
  278. * Add the custom_url_rewrite_outbound function.
  279. */
  280. include './sites/all/modules/domain/settings_custom_url.inc';
  281. ====
  282. ----
  283. 4.4.3 Option 2
  284. If you are having difficulty determining the correct path, copy the file
  285. into your settings folder.
  286. domain > settings_custom_url.inc
  287. The file should be in the same directory as your active settings.php file. Then
  288. add the following lines:
  289. ====
  290. /**
  291. * Add the custom_url_rewrite_outbound function.
  292. */
  293. include 'settings_custom_url.inc';
  294. ====
  295. ----
  296. 4.4.4 Testing Your Configuration
  297. After editing your settings.php file, go to Admin > Build > Domains. You may
  298. see a warning at the top of the page:
  299. "The custom_url_rewrite_outbound() patch is not installed..."
  300. This message means that your PHP server cannot find the include file. You
  301. may need to test other path options for the include code.
  302. ----
  303. 4.4.5 Additional Resources
  304. If you are having trouble configuring the include, you should check your
  305. PHP include path. You may need to use an absolute path to your server root.
  306. http://us3.php.net/manual/en/ini.core.php#ini.include-path
  307. You may also copy the entire function custom_url_rewrite_outbound() directly
  308. into your settings.php file.
  309. ----
  310. 5. Additional Module Installation
  311. The Domain Access module includes several sub-modules. Two of these
  312. have their own INSTALL.txt instructions.
  313. ----
  314. 5.1 Domain Configuration
  315. Refer to domain > domain_conf > INSTALL.txt
  316. ----
  317. 5.2 Domain Prefix
  318. Refer to domain > domain_prefix > INSTALL.txt
  319. ----
  320. 5.3 Domain Strict
  321. While this module requires no additional installation, it fundamentally
  322. changes the behavior of the Domain Access module.
  323. Under Domain Strict, only authenticated users (those who have registered)
  324. are given any domain-specific privileges.
  325. Anonymous users will only be able to view content that is assigned to "all
  326. affiliates."
  327. As a result, enabling this module may cause content to disappear from your
  328. site for users who are not logged in. This is by design.
  329. Refer to domain > domain_strict > README.txt
  330. ----
  331. 6. Uninstalling
  332. When you disable this module, it will reset your {node_access} tables and
  333. remove all records from the {domain_access} table. This will remove all
  334. access rules associated with this module.
  335. You may then uninstall the module normally.
  336. You should also revert the patches that you applied and remove
  337. any extra code from your settings.php file.
  338. To revert a patch, see http://drupal.org/patch/reverse