install.rst 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373
  1. Installation
  2. ############
  3. Get your own instance of Elgg running in no time.
  4. .. contents:: Contents
  5. :local:
  6. :depth: 1
  7. Requirements
  8. ============
  9. - MySQL 5+
  10. - PHP 5.4+ with the following extensions:
  11. - GD (for graphics processing)
  12. - `Multibyte String support`_ (for i18n)
  13. - Proper configuration and ability to send email through an MTA
  14. - Web server with support for URL rewriting
  15. Official support is provided for the following configurations:
  16. - Apache server
  17. - Apache with the `rewrite module`_ enabled
  18. - PHP running as an Apache module
  19. - Nginx server
  20. - Nginx with PHP-FPM using FastCGI
  21. By "official support", we mean that:
  22. - Most development and testing is performed with these configurations
  23. - Much of the installation documentation is written assuming Apache or Nginx is used
  24. - Priority on bug reports is given to Apache and Nginx users if the bug is web server specific
  25. (but those are rare).
  26. .. _Multibyte String support: http://www.php.net/mbstring
  27. .. _rewrite module: http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html
  28. Browser support policy
  29. ----------------------
  30. Feature branches support the latest 2 versions of all major browsers
  31. as were available at the time of the first stable release on that branch.
  32. Bugfix release will not alter browser support,
  33. even if a new version of the browser has since been released.
  34. Major browsers here means all of the following, plus their mobile counterparts:
  35. * Android Browser
  36. * Chrome
  37. * Firefox
  38. * IE
  39. * Safari
  40. "Support" may mean that we take advantage of newer, unimplemented technologies
  41. but provide a JavaScript polyfill for the browsers that need it.
  42. You may find that Elgg happens to work on unsupported browsers,
  43. but compatibility may break at any time, even during a bugfix release.
  44. Overview
  45. ========
  46. Upload Elgg
  47. -----------
  48. - Download the `latest version of Elgg`_
  49. - Upload the ZIP file with an FTP client to your server
  50. - Unzip the files in your domain's document root (/home/username/www).
  51. .. _latest version of Elgg: http://elgg.org/download.php
  52. Create a data folder
  53. --------------------
  54. Elgg needs a special folder to store uploaded files including profile
  55. icons and photos. You will need to create this directory.
  56. .. warning::
  57. For security reasons, this folder MUST be stored outside of your
  58. document root. If you created it under /www/ or /public_html/, you're
  59. doing it wrong.
  60. Once this folder has been created, you'll need to make sure the web
  61. server Elgg is running on has permission to write to and create
  62. directories in it. This shouldn't be a problem on Windows-based servers,
  63. but if your server runs Linux, Mac OS X or a UNIX variant, you'll need
  64. to `set the permissions on the directory`_.
  65. .. _set the permissions on the directory: http://en.wikipedia.org/wiki/Filesystem_permissions#Traditional_Unix_permissions
  66. If you are using a graphical FTP client to upload files, you can
  67. usually set permissions by right clicking on the folder and
  68. selecting 'properties' or 'Get Info'.
  69. .. note::
  70. Directories must be executable to be read and written to. The
  71. suggested permissions depend upon the exact server and user
  72. configuration. If the data directory is owned by the web server
  73. user, the recommended permissions are 770.
  74. Setting your data directory to 777 will work, but it is insecure
  75. and is not recommended. If you are unsure how to correctly set
  76. permissions, contact your host for more information.
  77. Create a MySQL database
  78. -----------------------
  79. Using your database administration tool of choice (if you're unsure
  80. about this, ask your system administrator), create a new MySQL database
  81. for Elgg. You can create a MySQL database with any of the following
  82. tools:
  83. Make sure you add a user to the database with all privileges and record
  84. the database name, username and password. You will need this information
  85. when installing Elgg.
  86. Visit your Elgg site
  87. --------------------
  88. Once you've performed these steps, visit your Elgg site in your web
  89. browser. Elgg will take you through the rest of the installation process
  90. from there. The first account that you create at the end of the
  91. installation process will be an administrator account.
  92. A note on settings.php and .htaccess
  93. ------------------------------------
  94. The Elgg installer will try to create two files for you:
  95. - engine/settings.php, which contains the database settings for your
  96. installation
  97. - .htaccess, which allows Elgg to generate dynamic URLs
  98. If these files can't be automatically generated, for example because the
  99. web server doesn't have write permissions in the directories, Elgg will
  100. tell you how to create them. You could also temporarily change the
  101. permissions on the root directory and the engine directory. Set the
  102. permissions on those two directories so that the web server can write
  103. those two files, complete the install process, and them change the
  104. permissions back to their original settings. If, for some reason, this
  105. won't work, you will need to:
  106. - Copy engine/settings.example.php to engine/settings.php, open it up
  107. in a text editor and fill in your database details
  108. - On Apache server, copy ``install/config/htaccess.dist`` to ``.htaccess``
  109. - On Nginx server copy ``install/config/nginx.dist`` to ``/etc/nginx/sites-enabled`` and adjust it's contents
  110. Other Configurations
  111. ====================
  112. * :doc:`Cloud9 <./install/cloud9>`
  113. * :doc:`EasyPHP <./install/easyphp>`
  114. * :doc:`IIS <./install/iis>`
  115. * :doc:`MAMP <./install/mamp>`
  116. * :doc:`MariaDB <./install/mariadb>`
  117. * :doc:`Nginx <./install/nginx>`
  118. * :doc:`Ubuntu <./install/ubuntu>`
  119. * :doc:`Virtual hosts <./install/virtual>`
  120. * :doc:`XAMPP <./install/xampp>`
  121. Troubleshooting
  122. ===============
  123. Help! I'm having trouble installing Elgg
  124. ----------------------------------------
  125. First:
  126. - Recheck that your server meets the technical requirements for Elgg.
  127. - Follow the environment-specific instructions if need be
  128. - Have you verified that ``mod_rewrite`` is being loaded?
  129. - Is the mysql apache being loaded?
  130. Keep notes on steps that you take to fix the install. Sometimes changing
  131. some setting or file to try to fix a problem may cause some other
  132. problem later on. If you need to start over, just delete all the files,
  133. drop your database, and begin again.
  134. I can't save my settings on installation (I get a 404 error when saving settings)
  135. ---------------------------------------------------------------------------------
  136. Elgg relies on the ``mod_rewrite`` Apache extension in order to simulate
  137. certain URLs. For example, whenever you perform an action in Elgg, or
  138. when you visit a user's profile, the URL is translated by the server
  139. into something Elgg understands internally. This is done using rules
  140. defined in an ``.htaccess`` file, which is Apache's standard way of
  141. defining extra configuration for a site.
  142. This error suggests that the ``mod_rewrite`` rules aren't being picked
  143. up correctly. This may be for several reasons. If you're not comfortable
  144. implementing the solutions provided below, we strongly recommend that
  145. you contact your system administrator or technical support and forward
  146. this page to them.
  147. The ``.htaccess``, if not generated automatically (that happens when you
  148. have problem with ``mod_rewrite``), you can create it by renaming
  149. ``install/config/htaccess.dist`` file you find with elgg package to ``.htaccess``. Also
  150. if you find a ``.htaccess`` file inside the installation path, but you
  151. are still getting 404 error, make sure the contents of ``.htaccess`` are
  152. same as that of ``install/config/htaccess.dist``.
  153. **``mod_rewrite`` isn't installed.**
  154. Check your ``httpd.conf`` to make sure that this module is being loaded
  155. by Apache. You may have to restart Apache to get it to pick up any
  156. changes in configuration. You can also use `PHP info`_ to check to see
  157. if the module is being loaded.
  158. **The rules in ``.htaccess`` aren't being obeyed.**
  159. .. _PHP info: http://uk.php.net/manual/en/function.phpinfo.php
  160. In your virtual host configuration settings (which may be contained
  161. within ``httpd.conf``), change the AllowOverride setting so that it
  162. reads:
  163. ``AllowOverride all``
  164. This will tell Apache to pick up the ``mod_rewrite`` rules from
  165. ``.htaccess``.
  166. **Elgg is not installed in the root of your web directory (ex:
  167. http://example.org/elgg/ instead of http://example.org/)**
  168. The install script redirects me to "action" when it should be "actions"
  169. -----------------------------------------------------------------------
  170. This is a problem with your ``mod_rewrite`` setup.
  171. DO NOT, REPEAT, DO NOT change any directory names!
  172. I installed in a subdirectory and my install action isn't working!
  173. ------------------------------------------------------------------
  174. If you installed Elgg so that it is reached with an address like
  175. http://example.org/mysite/ rather than http://example.org/, there is a
  176. small chance that the rewrite rules in .htaccess will not be processed
  177. correctly. This is usually due to using an alias with Apache. You may
  178. need to give mod\_rewrite a pointer to where your Elgg installation is.
  179. - Open up .htaccess in a text editor
  180. - Where prompted, add a line like
  181. ``RewriteBase /path/to/your/elgg/installation/`` (Don't forget the
  182. trailing slash)
  183. - Save the file and refresh your browser.
  184. Please note that the path you are using is the **web** path, minus the
  185. host.
  186. For example, if you reach your elgg install at http://example.org/elgg/,
  187. you would set the base like this:
  188. ``RewriteBase /elgg/``
  189. Please note that installing in a subdirectory does not require using
  190. RewriteBase. There are only some rare circumstances when it is needed
  191. due to the set up of the server.
  192. I did everything! mod\_rewrite is working fine, but still the 404 error
  193. -----------------------------------------------------------------------
  194. Maybe there is a problem with the file .htaccess. Sometimes the elgg
  195. install routine is unable to create one and unable to tell you that. If
  196. you are on this point and tried everything that is written above:
  197. - check if it is really the elgg-created .htaccess (not only a dummy
  198. provided from the server provider)
  199. - if it is not the elgg provided htaccess file, use the htaccess\_dist
  200. (rename it to .htaccess)
  201. I get an error message that the rewrite test failed after the requirements check page
  202. -------------------------------------------------------------------------------------
  203. I get the following messages after the requirements check step (step 2) of the install:
  204. We think your server is running the Apache web server.
  205. The rewrite test failed and the most likely cause is that AllowOverride is not set to All for Elgg's directory. This prevents
  206. Apache from processing the .htaccess file which contains the rewrite rules.
  207. A less likely cause is Apache is configured with an alias for your Elgg directory and you need to set the RewriteBase in
  208. your .htaccess. There are further instructions in the .htaccess file in your Elgg directory.
  209. After this error, everinteraction with the web interface results in a error 500 (Internal Server Error)
  210. This is likely caused by not loading the "filter module by un-commenting the
  211. #LoadModule filter_module modules/mod_filter.so
  212. line in the "httpd.conf" file.
  213. the Apache "error.log" file will contain an entry similar to:
  214. ... .htaccess: Invalid command 'AddOutputFilterByType', perhaps misspelled or defined by a module not included in the server configuration
  215. There is a white page after I submit my database settings
  216. ---------------------------------------------------------
  217. Check that the Apache mysql module is installed and is being loaded.
  218. I'm getting a 404 error with a really long url
  219. ----------------------------------------------
  220. If you see a 404 error during the install or on the creation of the
  221. first user with a url like:
  222. ``http://example.com/homepages/26/d147515119/htdocs/elgg/action/register``
  223. that means your site url is incorrect in your sites\_entity table in
  224. your database. This was set by you on the second page of the install.
  225. Elgg tries to guess the correct value but has difficulty with shared
  226. hosting sites. Use phpMyAdmin to edit this value to the correct base
  227. url.
  228. I am having trouble setting my data path
  229. ----------------------------------------
  230. This is highly server specific so it is difficult to give specific
  231. advice. If you have created a directory for uploading data, make sure
  232. your http server can access it. The easiest (but least secure) way to do
  233. this is give it permissions 777. It is better to give the web server
  234. ownership of the directory and limit the permissions.
  235. The top cause of this issue is PHP configured to prevent access to most
  236. directories using `open\_basedir`_. You may want to check with your
  237. hosting provider on this.
  238. Make sure the path is correct and ends with a /. You can check the path
  239. in your database in the datalists table.
  240. If you only have ftp access to your server and created a directory but
  241. do not know the path of it, you might be able to figure it out from the
  242. www file path set in your datalists database table. Asking for help from
  243. your hosting help team is recommended at this stage.
  244. .. _open\_basedir: http://www.php.net/manual/en/ini.core.php#ini.open-basedir
  245. I can't validate my admin account because I don't have an email server!
  246. -----------------------------------------------------------------------
  247. While it's true that normal accounts (aside from those created from the
  248. admin panel) require their email address to be authenticated before they
  249. can log in, the admin account does not.
  250. Once you have registered your first account you will be able to log in
  251. using the credentials you have provided!
  252. I have tried all of these suggestions and I still cannot install Elgg
  253. ---------------------------------------------------------------------
  254. It is possible that during the process of debugging your install you
  255. have broken something else. Try doing a clean install:
  256. - drop your elgg database
  257. - delete your data directory
  258. - delete the Elgg source files
  259. - start over
  260. If that fails, seek the help of the `Elgg community`_.
  261. Be sure to mention what version of Elgg you are installing, details of
  262. your server platform, and any error messages that you may have received
  263. including ones in the error log of your server.
  264. .. _Elgg community: http://community.elgg.org/