friendica-directory/INSTALL.md

81 lines
2.7 KiB
Markdown
Raw Normal View History

2018-11-12 20:15:26 +01:00
# Friendica Directory Install Instructions
2018-11-12 05:27:25 +01:00
2018-11-12 20:15:26 +01:00
## 1. Get the source code
2018-11-12 05:27:25 +01:00
2018-11-12 20:15:26 +01:00
For a planned install of Friendica Directory in the `/path/to/friendica-directory` folder.
2018-11-12 05:27:25 +01:00
2018-11-12 20:15:26 +01:00
### Using Git and Composer
2018-11-12 05:27:25 +01:00
2018-11-12 20:15:26 +01:00
Git is a popular version control management tool.
[Getting Started with Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git).
2018-11-12 05:27:25 +01:00
You'll also need Composer to grab the project dependencies.
2018-11-12 20:15:26 +01:00
Composer is a popular dependency management tool for PHP projects.
[Getting Started with Composer](https://getcomposer.org/doc/00-intro.md).
2018-11-12 05:27:25 +01:00
```
cd /path/to
2018-11-12 20:15:26 +01:00
git clone https://github.com/friendica/friendica-directory friendica-directory
2018-11-12 05:27:25 +01:00
cd friendica-directory
composer install
```
2018-11-12 20:15:26 +01:00
### Using a stable release archive
2018-11-12 05:27:25 +01:00
2018-11-12 06:09:36 +01:00
On the [Friendica Directory Github Releases page](https://github.com/friendica/friendica-directory/releases), you can find the latest source archive named `friendica-directory-<version>.zip`.
2018-11-12 05:27:25 +01:00
2018-11-12 20:15:26 +01:00
Simply unpack the archive in `/path/to/friendica-directory`, the dependencies are already included.
2018-11-12 05:27:25 +01:00
## Set up a database and a user
Friendica Directory supports MariaDB as a database provider. [Getting started with MariaDB](https://mariadb.com/get-started-with-mariadb/).
Once you have MariaDB installed on a given host, you need to create a database structure and a user with privileges on it.
Sample commands from the MariaDB console for a local install:
```sql
> CREATE DATABASE `friendica-directory`;
> GRANT ALL ON `friendica-directory`.* TO 'friendica-directory'@'localhost' IDENTIFIED BY "password";
```
2018-11-12 20:15:26 +01:00
## 2. Initialize database schema
2018-11-12 05:27:25 +01:00
Using the details gathered from the previous step, follow the instructions in the Friendica Directory Install Wizard.
```
cd /path/to/friendica-directory
bin/console install
```
2018-11-12 20:15:26 +01:00
## 3. Configure your web server
2018-11-12 05:27:25 +01:00
The document root of Friendica Directory is `/public`.
### Apache
Friendica Directory requires `mod_rewrite` to be enabled.
In your Virtual Host file, set your document root as follow:
```
DocumentRoot /path/to/friendica-directory/public/
```
2018-11-12 20:15:26 +01:00
## 4. Set up the background task
2018-11-12 05:27:25 +01:00
Friendica Directory relies on a background task running every minute to keep the directory up to date.
On Linux, you can set it up with Crontab, a popular background task scheduler. [Getting started with Crontab](http://www.adminschoice.com/crontab-quick-reference).
Add this line to your crontab:
```
* * * * * cd /path/to/friendica-directory && php bin/cron.php
```
2018-11-12 20:15:26 +01:00
## 5. Seed your directory
2018-11-12 05:27:25 +01:00
Your directory is ready, but empty. To start filling it, you can:
2018-11-12 20:15:26 +01:00
- Set your host name as the main directory in [Friendica](https://github.com/friendica/friendica)'s admin settings.
- Add existing directories in your polling queue: `bin/console directory-add https://dir.friendica.social`.