xref: /webtrees/README.md (revision 6ccdf4f0fd1b65a5d54259c969912382ce49629d)
1[![Latest Stable Version](https://poser.pugx.org/fisharebest/webtrees/v/stable.svg)](https://packagist.org/packages/fisharebest/webtrees)
2[![Latest Unstable Version](https://poser.pugx.org/fisharebest/webtrees/v/unstable.svg)](https://packagist.org/packages/fisharebest/webtrees)
3[![License](https://poser.pugx.org/fisharebest/webtrees/license)](https://packagist.org/packages/fisharebest/webtrees)
4[![Build Status](https://travis-ci.org/fisharebest/webtrees.svg?branch=master)](https://travis-ci.org/fisharebest/webtrees)
5[![Coverage Status](https://coveralls.io/repos/github/fisharebest/webtrees/badge.svg?branch=master)](https://coveralls.io/github/fisharebest/webtrees?branch=master)
6[![Translation status](http://weblate.iet.open.ac.uk/widgets/webtrees/-/shields-badge.svg)](http://weblate.iet.open.ac.uk/engage/webtrees/?utm_source=widget)
7[![SensioLabsInsight](https://insight.sensiolabs.com/projects/78a5ba19-7ddf-4a58-8262-1c8a149f38de/mini.png)](https://insight.sensiolabs.com/projects/78a5ba19-7ddf-4a58-8262-1c8a149f38de)
8[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/fisharebest/webtrees/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/fisharebest/webtrees/?branch=master)
9[![Code Climate](https://codeclimate.com/github/fisharebest/webtrees/badges/gpa.svg)](https://codeclimate.com/github/fisharebest/webtrees)
10[![StyleCI](https://github.styleci.io/repos/11836349/shield?branch=master)](https://github.styleci.io/repos/11836349)
11
12# webtrees - online collaborative genealogy
13
14The project’s website is [www.webtrees.net](https://www.webtrees.net).
15Further documentation is available at [wiki.webtrees.net](https://wiki.webtrees.net) and [webtrees.github.io](https://webtrees.github.io).
16
17## Contents
18
19* [License](#license)
20* [Coding styles and standards](#coding-styles-and-standards)
21* [Introduction](#introduction)
22* [System requirements](#system-requirements)
23* [Internet browser compatibility](#internet-browser-compatibility)
24* [Installation](#installation)
25* [Upgrading](#upgrading)
26* [Building and developing](#building-and-developing)
27* [Gedcom (family tree) files](#gedcom-family-tree-files)
28* [Security](#security)
29* [Backup](#backup)
30
31
32## License
33
34* **webtrees: online genealogy**
35* Copyright 2019 webtrees development team
36
37This program is free software: you can redistribute it and/or modify
38it under the terms of the GNU General Public License as published by
39the Free Software Foundation, either version 3 of the License, or
40(at your option) any later version.
41
42This program is distributed in the hope that it will be useful,
43but WITHOUT ANY WARRANTY; without even the implied warranty of
44MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
45GNU General Public License for more details.
46
47You should have received a copy of the GNU General Public License
48along with this program. If not, see <http://www.gnu.org/licenses/>.
49
50## Coding styles and standards
51
52webtrees follows the [PHP Standards Recommendations](https://www.php-fig.org/psr).
53
54* [PSR-1](https://www.php-fig.org/psr/psr-1) - Basic Coding Standard
55* [PSR-2](https://www.php-fig.org/psr/psr-2) - Coding Style Guide
56* [PSR-4](https://www.php-fig.org/psr/psr-4) - Autoloading Stardard
57* [PSR-7](https://www.php-fig.org/psr/psr-7) - HTTP Message Interface
58* [PSR-11](https://www.php-fig.org/psr/psr-11) - Container Interface
59* [PSR-12](https://github.com/php-fig/fig-standards/blob/master/proposed/extended-coding-style-guide.md) - Extended Coding Style Guide
60* [PSR-15](https://www.php-fig.org/psr/psr-15) - HTTP Handlers
61* [PSR-17](https://www.php-fig.org/psr/psr-17) - HTTP Factories
62
63We do not currently use [PSR-3 (logging)](https://www.php-fig.org/psr/psr-3) or [PSR-6 (caching)](https://www.php-fig.org/psr/psr-6) - but we plan to do so in the future.
64
65## Introduction
66
67**webtrees** is the web's leading online collaborative genealogy application.
68
69* It works from standard GEDCOM files, and is therefore compatible with every
70major desktop application.
71* It aims to to be efficient and effective by using the right combination of
72third-party tools, design techniques and open standards.
73
74**webtrees** allows you to view and edit your genealogy on your website. It has
75full editing capabilities, full privacy functions, and supports imedia such as
76photos and document images. As an online program, it fosters extended family
77participation and good ancestral recording habits, as it simplifies the process
78of collaborating with others working on your family lines. Your latest information
79is always on your web site and available for others to see, defined by viewing
80rules you set. For more information and to see working demos, visit
81[webtrees.net](https://webtrees.net/).
82
83**webtrees** is Open Source software that has been produced by people from many
84countries freely donating their time and talents to the project. All service,
85support, and future development is dependent on the time developers are willing
86to donate to the project, often at the expense of work, recreation, and family.
87Beyond the few donations received from users, developers receive no compensation
88for the time they spend working on the project. There is also no outside source
89of revenue to support the project. Please consider these circumstances when
90making support requests and consider volunteering your own time and skills to make
91the project even stronger and better.
92
93
94## System requirements
95
96To install **webtrees**, you need:
97
98* A webserver. Apache, NGINX and IIS are the most common types. There are no
99 requirements to use a specific type or version.
100* Approximately 65MB of disk space for the application files, plus whatever is
101  needed for your media files, GEDCOM files and database.
102* PHP 7.0 or later.  Servers with PHP 5.3 - 5.6 should use **webtrees** 1.7.
103  Servers with PHP 5.2 should use **webtrees** 1.4.
104   * PHP should be configured with the following libraries:
105     * PDO and pdo_mysql to enable access to MySQL. These are enabled by default
106     on most hosts. See [http://php.net/pdo](http://php.net/pdo),
107     * php\_gd(2) for images
108     * PHP_XML for reports.
109   * PHP should be configured to allow sufficient server resources (memory and
110     execution time) for the size of your system. Typical requirements are:
111      * Small systems (500 individuals): 16–32 MB, 10–20 seconds
112      * Medium systems (5,000 individuals): 32–64 MB, 20–40 seconds
113      * Large systems (50,000 individuals): 64–128 MB, 40–80 seconds
114* MySQL or MariaDB. Note that **webtrees** can share a single database
115  with other applications, by choosing a unique table prefix during setup.
116  If the number of databases is not restricted, you can set up a database purely
117  for use by **webtrees** and create a separate user and password for only
118  your genealogy.
119
120
121  ## Internet browser compatibility
122
123  **webtrees** supports the use of most current browsers such as Edge, Firefox,
124  Chrome, and Safari. We will do our best to support the current versions of others
125  such as Opera and Internet Explorer, however note that versions of Internet Explorer
126  prior to IE11 do not work with **webtrees**. We strongly recommend anyone using an
127  obsolete browser to upgrade as soon as possible. We are also aware that Internet
128  Explorer provides poor RTL language support generally, so cannot recommend it for
129  sites requiring RTL languages.
130* To view sites that contain both left-to-right and right-to-left text (e.g.
131  English data on Hebrew pages), you will need to use a browser that provides
132  support for the HTML5 **dir="auto"** attribute. At present, neither Edge
133  nor Internet Explorer support this.
134* HTML Frames. Note that **webtrees** uses cookies to track login sessions.
135  Internet Explorer users should review
136  ``Settings`` / ``Internet Options`` / ``Privacy`` / ``Advanced`` for more details.
137
138
139## Installation
140
141Once the system requirements are met, perform the following steps
142
1431. Download the latest stable version from [webtrees.net](https://webtrees.net/)
1442. Unzip the files and upload them to an empty folder on your web server.
1453. Open your web browser and type the URL for your **webtrees** site (for example,
146   ``http://www.yourserver.com/webtrees`` into the address bar.
1474. The **webtrees** setup wizard will start automatically. Simply follow the steps,
148   answering each question as you proceed.
149
150That's it!
151
152However, before you can use **webtrees**, you need at least one GEDCOM
153(family tree) file. If you have been doing your research using a desktop program
154such as Family Tree Maker, you can use it's “save as GEDCOM” function to create
155a GEDCOM file. If you are starting from scratch, then **webtrees** can create a
156GEDCOM file for you.
157
158On successful installation you will be taken to the
159 ``Control panel`` -> ``Manage family trees``  page where you can:
160 * UPLOAD a GEDCOM file from your local machine
161 * ADD a GEDCOM file from your server, (if your GEDCOM file is too large to upload,
162   you can copy it to the webtrees/data folder, and load it from there)
163 * CREATE a new, empty GEDCOM file
164
165There are *lots* of configuration options. You'll probably want to review the
166privacy settings first. Don't worry too much about all the other options - the
167defaults are good for most people. If you get stuck, there's lots of built-in
168help and you can get friendly advice from the [help](https://webtrees.net/forums)
169forum.
170
171
172## Upgrading
173
174Upgrading **webtrees** is quick and easy. It is strongly recommended that you
175upgrade your installation whenever a new version is made available. Even minor
176**webtrees** version updates usually contain a significant number of bug fixes
177as well as interface improvements and program enhancements.
178
179* **Automatic upgrade**
180
181  **webtrees** has an automatic upgrade facility. An administrator upon logging in
182will receive notification when a new version is available and an option to start
183the automatic upgrade. If for some reason the automatic upgrade should fail
184then a manual upgrade should be performed.
185
186* **Manual upgrade**
187
188  1. Now would be a good time to make a [backup](#backup).
189  2. Download the latest version of **webtrees** available from
190   [webtrees.net](https://webtrees.net/)
191  3. While you are in the middle of uploading the new files,
192   a visitor to your site would encounter a mixture of new and old files.  This
193   could cause unpredictable behaviour or errors.  To prevent this, create the
194   file **data/offline.txt**.  While this file exists, visitors will see a
195   “site unavailable - come back later” message.
196  4. Unzip the .ZIP file, and upload the files to your web server, overwriting the existing files.
197  5. Delete the file **data/offline.txt**
198
199
200### Note for Macintosh users
201
202Step 4 assumes you are using a copy tool that **merges** directories rather than
203replaces them. (**Merge** is standard behaviour on Windows and Linux.) If you use
204the Macintosh Finder or other similar tool to perform step 3, it will **replace**
205your configuration, media and other directories with the empty/default ones from
206the installation. This would be very bad (but you did take a backup in step 1,
207didn't you!). Further details and recommendations for suitable tools can be found
208by searching [google.com](http://google.com).
209
210
211### Note for anyone using custom code (modules, themes, etc.).
212
213It is **very likely** that your custom code will not work when you upgrade
214**webtrees**.
215
216**We recommend that you disable all custom code before you apply the upgrade.**
217
218Disable custom modules, switch over to a standard theme, and remove any code “hacks”.
219Once the upgrade is complete and you are satisfied that your site is fully operational contact
220the source of those modules or themes for a new version.
221
222
223### General note
224
225Depending on the changes in the new files, your browser configuration
226and possibly other factors, it is always wise to clear both the **webtrees** cache
227and your browser cache immediately after the upgrade is completed. The **webtrees**
228cache can be cleared simply by going to ``Control Panel`` -> ``Family Trees`` ->
229``Clean-up data folder`` and deleting the cache.
230
231If you have any problems or questions, help is available on the
232[webtrees forum](https://www.webtrees.net/index.php/en/forum).
233
234## Building and developing
235
236If you want to build webtrees from source, or modify the code, you'll need to install
237a couple of tools first.
238
239You will need [composer](https://getcomposer.org/) to install the PHP dependencies.
240Then run this command::
241
242* php composer.phar install
243
244You will need [npm](https://www.npmjs.com/get-npm) to install the Javascript dependencies.
245Then run the commands:
246
247* npm install
248* npm run production
249
250You will need to re-run the second of these any time you modify the file `webtrees.js`.
251
252## Gedcom (family tree) files
253
254When you ADD or IMPORT a family tree (GEDCOM) file in **webtrees** the
255data from the file is transferred to the database tables. The file itself
256remains in the **webtrees/data** folder and is no longer used or required
257by **webtrees**. Any subsequent editing of the **webtrees** data
258will not change this file
259
260When or if you change your genealogy data outside of **webtrees**, it is not
261necessary to delete your GEDCOM file or database from **webtrees** and start
262over. Follow these steps to update a GEDCOM that has already been imported:
263
264* Go to ``Control panel`` -> ``Manage family trees`` On the line relating to this particular family tree (GEDCOM)
265  file (or a new one) select IMPORT.
266* Take careful note of the media items option (_“If you have created media objects
267  in **webtrees**, and have edited your data off-line using software that
268  deletes media objects, then tick this box to merge the current media objects
269  with the new GEDCOM.”_) In most cases you should leave this box **UNCHECKED**.
270* Click “SAVE”. **webtrees** will validate the GEDCOM again before importing.
271  During this process, **webtrees** copies your entire family tree (GEDCOM file)
272  to a 'chunk' table within your database. Depending on the coding of your file,
273  its file size and the capabilities of your server and the supporting software,
274  this may take some time. **No progress bar will show while the data is being
275  copied** and should you navigate away from this page, the process is suspended.
276  It will start again when you return to the Family Tree management page.
277
278
279### Gedcom file Formats
280
281Every Family History program has its own method of creating GEDCOM files, and
282differing output format options to select from. **webtrees'** import routines
283can read many different formats, but not necessarily all. If your software has
284a “UTF8” option you should always use that. However, **webtrees** has been
285tested with these alternative formats:
286
287* ANSI
288   * imports OK, but is slow due to the translation into UTF8 as part
289     of the import process.
290* MAC
291   * imports OK, but is slow due to the translation into UTF8 as part
292     of the import process.
293* DOS
294   * imports OK, but is slow due to the translation into UTF8 as part
295     of the import process.
296* ANSEL
297   * currently will not import. Gives warning *Error: cannot convert
298     GEDCOM file from ANSEL encoding to UTF-8 encoding*. Later releases
299     of **webtrees** may include the facility to translate from ANSEL to UTF8,
300     but for now a standalone utility [is available here](https://dev.webtrees.net/ansel/)
301     and should be used to convert the format to UTF-8 prior to importing.
302
303
304## Security
305
306**Security** in _webtrees_ means ensuring your site is safe from unwanted
307intrusions, hacking, or access to data and configuration files. The developers
308of _webtrees_ regard security as an extremely important part of its development
309and have made every attempt to ensure your data is safe.
310
311The area most at risk of intrusion would be the **/data** folder that contains your
312config.ini.php file, and various temporary files. If you are concerned there
313may be a risk there is a very simple test you can do: try to fetch the file
314config.ini.php by typing **``url_to_your_server/data/config.ini.php``** in your web
315browser.
316
317The most likely result is an “access denied” message like this:
318
319    Forbidden
320
321    You don't have permission to access /data/config.ini.php on this server.
322
323This indicates that the protection built into **webtrees** is working, and no
324further action is required.
325
326In the unlikely event you do fetch the file (you will just see a semicolon),
327then that protection is not working on your site and you should take some further
328action.
329
330If your server runs PHP in CGI mode, then change the permission of the **/data**
331folder to 700 instead of 777. This will block access to the httpd process,
332while still allowing access to PHP scripts.
333
334This will work for perhaps 99% of all users. Only the remaining 1% should consider
335the most complex solution, moving the **/data** folder out of accessible web
336space. (**_Note:_** In many shared hosting environments this is not an option anyway.)
337
338If you do find it necessary, following is an example of the process required:
339
340If your home folder is something like **/home/username**,
341and the root folder for your web site is **/home/username/public_html**,
342and you have installed **webtrees** in the **public_html/webtrees** folder,
343then you would create a new **data** folder in your home folder at the same
344level as your public_html folder, such as **/home/username/private/data**,
345and place your GEDCOM (family tree) file there.
346
347Then change the **Data folder** setting on the ``Control panel`` ->
348``Website`` -> ``Website preferences`` page from the default **data/** to the new
349location **/home/username/private/data**
350
351You will have **two** data directories:
352
353* [path to webtrees]/data - just needs to contain config.ini.php
354* /home/username/private/data - contains everything else
355
356
357### Hypertext Transfer Protocol Secure (HTTPS)
358
359**webtrees** supports https access. If your website is configured with mandatory
360or optional https support **webtrees** will operate correctly in either mode.
361
362If your website is configured with optional https support, **webtrees** can be
363configured to switch to https at login. To enable https at login, set the Sign-in
364URL setting on the ``Control panel`` -> ``Website`` ->
365``Sign-in and registration`` to your https login URL, which is often in the form
366**``url_to_your_server/data/admin.php``**
367
368**Warning:** Misconfiguration can disable your login links. If this occurs,
369access the login by typing the correct URL directly into your browser's address input.
370
371
372## Backup
373
374Backups are good. Whatever problem you have, it can always be fixed from a good
375backup.
376
377To make a backup of **webtrees**, you need to make a copy of the following
378
3791. The files in the *webtrees/data* folder.
3802. The files in the *webtrees/media* folder.
3813. The tables in the database. Freely available tools such as
382   [phpMyAdmin](http://www.phpmyadmin.net) allow you to do this in one click.
383
384Remember that most web hosting services do NOT backup your data, and this is
385your responsibility.
386