-
Notifications
You must be signed in to change notification settings - Fork 2
/
installation_on_freebsd.html
564 lines (527 loc) · 13.9 KB
/
installation_on_freebsd.html
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="../../favicon.ico">
<title>
Free Open-Source Hosting Platform «ClonOS»
</title>
<!-- Bootstrap core CSS -->
<link href="/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="/css/styles.css" rel="stylesheet">
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<link href="/bootstrap/docs/assets/css/ie10-viewport-bug-workaround.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="/bootstrap/docs/examples/sticky-footer-navbar/sticky-footer-navbar.css" rel="stylesheet">
<script src="/bootstrap/docs/assets/js/ie-emulation-modes-warning.js">
</script>
<style>
.jumbotron {background: url(/images/samson-back.jpg) no-repeat 50% 50%; overflow:hidden;color:white;text-shadow:0 0 4px black;}
</style>
<style>
.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}
</style>
<!-- Just for debugging purposes. Don't actually copy these 2 lines! -->
<!--[if lt IE 9]>
<script src="../../assets/js/ie8-responsive-file-warning.js">
</script>
<![endif]-->
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js">
</script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js">
</script>
<![endif]-->
</head>
<body>
<a href="https://github.com/clonos/control-pane" class="github-corner" aria-label="View source on GitHub">
<svg width="80" height="80" viewBox="0 0 250 250" style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true">
<path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z">
</path>
<path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm">
</path>
<path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body">
</path>
</svg>
</a>
<div class="container">
<div class="header clearfix">
<nav>
<ul class="nav nav-pills pull-right">
<li role="presentation">
<a href="/index.html">
About
</a>
</li>
<li role="presentation">
<a href="/errata.html">
Errata
</a>
</li>
<li role="presentation">
<a href="/roadmap.html">
RoadMap
</a>
</li>
<li role="presentation">
<a href="/installation_from_media.html">
Installation
</a>
</li>
<li role="presentation" class="active">
<a href="/installation_on_freebsd.html">
Installation on FreeBSD
</a>
</li>
<li role="presentation">
<a href="/download.html">
Download
</a>
</li>
<li role="presentation">
<a href="/contact.html">
Contact
</a>
</li>
<li role="presentation">
<a target="_blank" href="https://www.bsdstore.ru/en/donate.html">
Support the project
</a>
</li>
</ul>
</nav>
<h3 class="text-muted">
Installation on FreeBSD
</h3>
</div>
<div class="jumbotron">
<h1>
ClonOS
</h1>
<p class="lead">
FreeBSD based distro for virtual hosting platform and appliance
</p>
</div>
<div class="block black-text info">
<p>
2020-10 upd: we reached the first fundraising goal and rented a server in Hetzner for development! Thank you for
<a target="_blank" href="https://www.patreon.com/clonos">
donating
</a>
!
</p>
</div>
<div class="block black-text info">
<p>
2021-17 upd: NO-o-o, project is not stalled and not dead ;-) A large iteration is performed to implement and stabilize the API. The final version will be merged into ClonOS. See: <a target="_blank" href="https://www.bsdstore.ru/en/cbsd_api_ssi.html">one</a>,<a target="_blank" href="https://myb.convectix.com">two</a>, <a target="_blank" href="https://k8s-bhyve.convectix.com">three</a>.
</p>
</div>
<hr />
<div class="row marketing">
<h3 class="text-muted">
Installing ClonOS/CBSD WEB UI via PKG
</h3>
<p class="lead">
ClonOS in pkg packages
</p>
<p>
<strong>
Daniel Shafer
</strong>
<a target="_blank" href="https://jenkins.ircdriven.net/job/Update%20clonos%20packages./">
prepared
</a>
a Jenkins task to build ClonOS
<a target="_blank" href="https://pkg.ircdriven.net/packages/12amd64-clonos/">
pkg package repo
</a>
(at the moment <strong>FreeBSD 12</strong> only)
</p>
<p>
To enable repository, just put the following lines in
<strong>
/usr/local/etc/pkg/repos/clonos-pkg.ircdriven.net.conf
</strong>
:
</p>
<pre>
ClonOS-pkg.ircdriven.net: {
url: "https://pkg.ircdriven.net/packages/12amd64-clonos/",
mirror_type: "none",
enabled: yes
}
</pre>
<p>
Update pkg metafile and install it:
</p>
<pre>
pkg update -f
pkg install clonos
</pre>
</div>
<div class="row marketing">
<h3 class="text-muted">
Installing ClonOS/CBSD WEB UI on stock FreeBSD
</h3>
<p class="lead">
Install ClonOS and dependencies
</p>
<ul>
<li>
Update ports tree first:
<pre>
portsnap fetch extract
</pre>
</li>
<li>
Install ClonOS dependencies:
<pre>
pkg update -f
pkg install -y lang/python38 lang/php80 net/libvncserver security/gnutls databases/sqlite3 shells/bash www/npm \
www/nginx sysutils/cbsd security/ca_root_nss www/node security/sudo net/beanstalkd devel/git devel/pkgconf \
www/php80-session archivers/php80-zip databases/php80-sqlite3 databases/php80-pdo_sqlite www/php80-opcache lang/go
</pre>
</li>
<li>
Checkout ClonOS ports tree:
<pre>
git clone https://github.com/clonos/clonos-ports-wip.git /root/clonos-ports
</pre>
</li>
<li>
Create overlays vars for ClonOS ports
<pre>
echo 'OVERLAYS=/root/clonos-ports' >> /etc/make.conf
</pre>
</li>
<li>
Build and install ClonOS
<pre>
env BATCH=no make -C /root/clonos-ports/www/clonos install
</pre>
</li>
</ul>
<p>
Follow
<strong>
post-message
</strong>
instruction
</p>
<p>
You must merge or copy working configuration files
</p>
<ul>
<li>
Check for RACCT is enabled on the host, please add:
<pre>
kern.racct.enable="1"
</pre>
into
<strong>
/boot/loader.conf
</strong>
and reboot host
</li>
<li>
If
<strong>
CBSD
</strong>
still not initialized, do it first:
<pre>
env workdir=/usr/jails /usr/local/cbsd/sudoexec/initenv
</pre>
<p>
more about CBSD initialization:
<a href="https://www.bsdstore.ru/en/installing_cbsd.html#initenv">
https://www.bsdstore.ru/en/installing_cbsd.html#initenv
</a>
</p>
</li>
<li>
Ensure CBSD is started:
<pre>
sysrc cbsdd_enable=YES
service cbsdd status || service cbsdd start
</pre>
</li>
<li>
Configure and run beanstalkd:
<pre>
sysrc beanstalkd_flags="-l 127.0.0.1 -p 11300"
sysrc beanstalkd_enable=YES
service beanstalkd restart
</pre>
</li>
<li>
Change in /usr/local/etc/php-fpm.conf events mechanism to BSD-specific.
To do this, uncomment and edit the events.mechanism parameter to:
<pre>
…
events.mechanism = kqueue
…
</pre>
Or copy:
<pre>
cp /usr/local/etc/php-fpm.conf.clonos.sample /usr/local/etc/php-fpm.conf
</pre>
</li>
<li>
Uncomment and change in
<strong>
/usr/local/etc/php-fpm.d/www.conf
</strong>
port to Unix socket and set's correct access permission:
<pre>
…
listen = /tmp/php-fpm.sock
…
listen.backlog = -1
…
listen.owner = www
listen.group = www
listen.mode = 0660
…
</pre>
Or copy:
<pre>
cp /usr/local/etc/php-fpm.d/www-php-fpm.conf.clonos.sample /usr/local/etc/php-fpm.d/www.conf
</pre>
</li>
<li>
Add "www" user to "cbsd" group:
<pre>
pw groupmod cbsd -M www
</pre>
</li>
<li>
To execute CBSD commands, let the www user run CBSD through sudo:
edit
<strong>
/usr/local/etc/sudoers.d/10_www
</strong>
:
<pre>
Defaults env_keep += "workdir DIALOG NOCOLOR CBSD_RNODE"
Cmnd_Alias WEB_CMD = /usr/local/bin/cbsd
www ALL=(ALL) NOPASSWD:SETENV: WEB_CMD
</pre>
And make sure the file permissions are safe:
<pre>
chown root:wheel /usr/local/etc/sudoers.d/10_www
chmod 0440 /usr/local/etc/sudoers.d/10_www
</pre>
Or copy:
<pre>
cp /usr/local/etc/sudoers_10_www.clonos.sample /usr/local/etc/sudoers.d/10_www
</pre>
</li>
<li>
Enable and start websocket daemon:
<pre>
service clonos-ws enable
service clonos-ws restart
</pre>
</li>
<li>
Enable and start ClonOS node daemon:
<pre>
service clonos-node-ws enable
service clonos-node-ws restart
</pre>
</li>
<li>
Change
<strong>
/usr/local/etc/php.ini
</strong>
params:
<pre>
…
memory_limit = 256M
…
post_max_size = 12G
…
upload_tmp_dir = /tmp
…
upload_max_filesize = 16G
…
opcache.enable=1
</pre>
Or copy:
<pre>
cp /usr/local/etc/php.ini.clonos.sample /usr/local/etc/php.ini
</pre>
</li>
<li>
Configure NGINX: make sure/merge this settings into
<strong>
/usr/local/etc/nginx/nginx.conf
</strong>
:
<pre>
user www;
load_module /usr/local/libexec/nginx/ngx_stream_module.so;
events {
use kqueue;
}
http {
include /usr/local/etc/nginx/mime.types;
default_type application/octet-stream;
client_max_body_size 1m;
include /usr/local/etc/nginx/sites-enabled/*.conf;
}
stream {
include /usr/local/etc/nginx/conf.stream.d/*.conf;
include /usr/local/etc/nginx/streams-enabled/*;
}
</pre>
Or copy:
<pre>
cp /usr/local/etc/nginx/nginx.conf.clonos.sample /usr/local/etc/nginx/nginx.conf
</pre>
</li>
<li>
Enable nginx, php-fpm and clonos_vnc2wss to run at system startup:
<pre>
sysrc nginx_enable="YES"
sysrc php_fpm_enable="YES"
sysrc supervisord_enable="YES"
sysrc clonos_vnc2wss_enable="YES"
</pre>
</li>
<li>
Start nginx and php-fpm:
<pre>
service nginx restart
service php-fpm restart
</pre>
</li>
<li>
<p>
Configure CBSD:
</p>
<p>
1) Install and compile vncterm module:
<pre>
cbsd module mode=install vncterm
make -C /usr/local/cbsd/modules/vncterm.d
</pre>
</p>
<p>
2) Install additional ConvectIX scripts module:
<pre>
cbsd module mode=install convectix
</pre>
</p>
<p>
3) Install Puppet module
<pre>
cbsd module mode=install puppet
</pre>
</p>
<p>
4) Install ClonOS database module:
<pre>
cbsd module mode=install clonos-database
</pre>
</p>
<p>
5) Copy queue config file:
<pre>
cp -a /usr/local/cbsd/modules/cbsd_queue.d/etc-sample/cbsd_queue.conf ~cbsd/etc/
</pre>
</p>
<p>
6) Add additional module name into ~cbsd/etc/modules,
e.g. complete ~cbsd/etc/modules.conf must have:
<pre>
pkg.d
bsdconf.d
zfsinstall.d
puppet.d
convectix.d
cbsd_queue.d
vncterm.d
</pre>
Or copy:
<pre>
cp /usr/local/etc/cbsd-modules.conf.clonos.sample ~cbsd/etc/modules.conf
</pre>
</p>
<p>
7) Re-run CBSD initenv to init modules:
<pre>
cbsd initenv
</pre>
</p>
<p>
8) Init web user database:
<pre>
sh /usr/local/cbsd/modules/clonos_database/initforms.sh
</pre>
</p>
<p>
9) Configure and run CBSD RACCT stats daemon:
<pre>
sysrc cbsd_statsd_hoster_enable=YES
sysrc cbsd_statsd_jail_enable=YES
sysrc cbsd_statsd_bhyve_enable=YES
service cbsd-statsd-hoster restart
service cbsd-statsd-jail restart
service cbsd-statsd-bhyve restart
</pre>
</p>
<p>
10) Install/upgrade noVNC via npm:
<pre>
cd /usr/local/www/clonos/public/novnc
npm install .
</pre>
</p>
<p>
11) Create symlink from python3 to valid python bin:
<pre>
ln -sf /usr/local/bin/python3.8 /usr/local/bin/python3
</pre>
</p>
</li>
<li>
<p>
Open ClonOS UI in your web browser.
</p>
<pre>
Default login: 'admin'
Default password: 'admin'
</pre>
</li>
<li>
<p>
Enjoy the ClonOS !
</p>
</li>
</ul>
</div>
<hr />
</div>
<footer class="footer">
<div class="container">
<center>
<p class="navbar-text col-md-12 col-sm-12 col-xs-12">
© 2017-2021 ClonOS.
</p>
</center>
</div>
</footer>
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<script src="/bootstrap/assets/js/ie10-viewport-bug-workaround.js">
</script>
</body>
</html>