-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathINSTALL
More file actions
97 lines (69 loc) · 3.46 KB
/
Copy pathINSTALL
File metadata and controls
97 lines (69 loc) · 3.46 KB
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
======================== Syncman - painless remote projects synchronization utility ========================
1) Unpack the archive, for example in directory /var/www/syncman
2) Make /var/www/syncman/var directory writable for web server:
$ mkdir /var/www/syncman/var #create it if it's missing
$ chmod 777 /var/www/syncman/var
3) Create syncman VirtualHost in Apache config file(httpd.conf), something like this:
<VirtualHost *>
DocumentRoot /var/www/syncman/www/
ServerName syncman
ErrorLog logs/syncman-error_log
CustomLog logs/syncman-access_log common
</VirtualHost>
4) Put "syncman" host name into /etc/hosts:
127.0.0.1 syncman
5) Restart Apache
6) Open http://syncman in your browser, you should see a couple of test projects
7) All projects settings are stored in "projects" directory of syncman application. You can copy "projects-examples"
directory into "projects" directory in order to try some sample projects.
8) Please note, in case you want to use passwordless ssh authentication based on public/private keys infrastructure
you most probably want to use Apache Suexec module with PHP FastCgi(OpenSSH requires the process using keys for
authentication to be owned by the very same user who owns the private key).
Here's a very quick howto(assuming you know how to obtain and install Suexec and FastCgi modules for Apache).
First let's configure global FastCgi settings(somewhere in the end of global httpd.conf configuration but before
any virtual hosts):
<IfModule !mod_fastcgi.c>
LoadModule fastcgi_module modules/mod_fastcgi.so
</IfModule>
<IfModule mod_fastcgi.c>
AddHandler fastcgi-script .fcg .fcgi
FastCgiConfig -maxProcesses 3 -processSlack 1 -singleThreshold 3 -killInterval 300 -autoUpdate -idle-timeout 240 -pass-header HTTP_AUTHORIZATION
FastCgiIpcDir /tmp/fastcgi_ipc/
FastCgiSuexec /usr/sbin/suexec
</IfModule>
<Location /php-fastcgi/>
Options ExecCGI
SetHandler fastcgi-script
</Location>
Now let's change syncman virtual host definition(please note, we're using 'syncman' user and 'users' group, which implies that 'syncman' user is
going to use its private key for passwordless authentication):
<VirtualHost *>
DocumentRoot /var/www/syncman/www/
ServerName syncman
ErrorLog logs/syncman-error_log
<Directory /var/www/fcgi-bin/syncman/>
Options ExecCGI
SetHandler cgi-script
</Directory>
User syncman
Group users
ScriptAlias /php-fastcgi/ /var/www/fcgi-bin/syncman/
AddType application/x-httpd-fastphp .php
Action application/x-httpd-fastphp /php-fastcgi/php5-fcgi
</VirtualHost>
Now we need to write php5-fcgi wrapper script in /var/www/fcgi-bin/syncman directory:
#!/bin/sh
PHPRC="/etc/php/cgi-php5/php.ini" #location of php.ini may differ on your server
export PHPRC
PHP_FCGI_CHILDREN=2
export PHP_FCGI_CHILDREN
PHP_FCGI_MAX_REQUESTS=5000
export PHP_FCGI_MAX_REQUESTS
exec /usr/lib/php5/bin/php-cgi #you may have different php cgi binary path
Don't forget to chmod +x on this script!
Try restarting apache and browsing syncman web interface. Now if you try running "ps aux | grep syncman" you should see something like follows:
$ ps aux | grep syncman
syncman 14740 0.2 0.4 24892 4480 ? Ss 15:36 0:00 /usr/lib/php5/bin/php-cgi
syncman 14741 8.3 1.1 28796 10312 ? S 15:36 0:00 /usr/lib/php5/bin/php-cgi
syncman 14742 0.0 0.2 24892 2252 ? S 15:36 0:00 /usr/lib/php5/bin/php-cgi
If it worked, congratulations, you did it ;)