-
Notifications
You must be signed in to change notification settings - Fork 98
/
Copy pathINSTALL.txt
72 lines (45 loc) · 3.6 KB
/
INSTALL.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
INSTALLATION NOTES
Note: We make no guarantee of completeness or accuracy of these install notes. The most up-to-date notes on a basic
install setup is found through our docker-compose.yml setup we use for development. Please reference it before asking
questions.
Note: If overwhelmed by the these instructions, we urge you to NOT run a tracker in production. Doing such requires
more additional steps not covered here (setting up proxies, tunneling, LUKS encryption, TCP tuning, etc.) that messing
up would put the privacy / security of both yourself and your users at risk.
1. Install the PHP and JS dependencies to run / setup the site:
composer install
yarn install
2. First, you will need to setup the following services:
* MySQL
* memcached
* sphinxsearch
Depending on your OS, these may be available in the package manager. You can see
what versions of the above we support by looking at our [docker-compose.yml](../docker-compose.yml)
configuration.
For setting up memcached, we recommend giving it multiple threads and several GB of RAM, for example:
memcached -d -m 5120 -s /var/run/memcached.sock -a 0777 -t4 -C -u nobody
This will give memcached 4 threads and 5GB of RAM. Tune this accordingly depending on how large your server
is, and traffic you get, but a the more RAM you give memcached, the quicker Gazelle will run as it heavily
relies on caching.
For sphinxsearch, we recommend you use the included sphinx.conf which can be found under .docker/sphinxsearch/sphinx.conf.
You can copy this to /etc/sphinx/sphinx.conf. You need to fill in the details of the SQL server though!
You might also need to create the /var/lib/sphinx folder.
For documentation, read http://www.sphinxsearch.com/docs/current.html
After you've installed sphinx, create the indices:
/usr/bin/indexer -c /etc/sphinx/sphinx.conf --all
3. Configure config variables. First, you will want to copy over the template file ([classes/config.template.php](../classes/config.template.php))
to `classes/config.php`, and then go through and configure to your needs. See the comments within that file on what you will need to change.
4. After configuring the config.php file in the step above (or minimially the SQL* variables), you can use phinx to setup your DB by running:
vendor/bin/phinx migrate
5. Generate stylesheets and their previews by running the following:
yarn build
Note, to generate the previews requires a chrome instance to be installed onto the computer.
6. Setup your web server. We recommend using nginx (https://www.nginx.com/). A sample configuration for nginx can be found in .docker/web/nginx.conf.
7. Sign up. The first user is made a SysOp!
8. Set up cron jobs. You need a cron job for the schedule, a cron job for the peerupdate (all groups are cached, but the peer counts change often,
so peerupdate is a script to update them), and the two Sphinx indices. These are our cron jobs. SCHEDULE_KEY is the same as in classes/config.php:
0,15,30,45 * * * * /usr/bin/php /var/www/vhosts/what/schedule.php SCHEDULE_KEY >> /root/schedule.log
10,25,40,55 * * * * /usr/bin/php /var/www/vhosts/what/peerupdate.php SCHEDULE_KEY >> /root/peerupdate.log
* * * * * /usr/bin/indexer -c /etc/sphinx/sphinx.conf --rotate delta requests_delta log_delta >/dev/null
5 0,12 * * * /usr/bin/indexer -c /etc/sphinx/sphinx.conf --rotate --all >>/root/sphinx-indexer.log
An example cron script can be seen in .docker/web/crontab
9. Start modifying stuff. Hopefully, everything will have gone smoothly so far and nothing will have exploded (ha ha ha)