浏览代码

Ongoing voip configuration

Bob Mottram 11 年前
父节点
当前提交
34102c1c23
共有 1 个文件被更改,包括 192 次插入21 次删除
  1. 192
    21
      beaglebone.txt

+ 192
- 21
beaglebone.txt 查看文件

@@ -913,7 +913,7 @@ mkdir /var/www/$HOSTNAME/htdocs
913 913
 emacs /etc/apache2/sites-available/$HOSTNAME
914 914
 #+END_SRC
915 915
 
916
-The Apache configuration for the site should look something like the following:
916
+The Apache configuration for the site should look something like the following.  Replaye mydonainname with the site domain name.
917 917
 
918 918
 #+BEGIN_SRC: bash
919 919
 <VirtualHost *:80>
@@ -932,6 +932,22 @@ The Apache configuration for the site should look something like the following:
932 932
 		allow from all
933 933
 	</Directory>
934 934
 
935
+	# Don't serve .php~ or .php# files created by emacs
936
+	<Files ~ "(^#.*#|~|\.sw[op])$">
937
+		Order allow,deny
938
+		Deny from all
939
+	</Files>
940
+
941
+	<IfModule headers_module>
942
+		Header set X-Content-Type-Options nosniff
943
+		Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate, private"
944
+		Header set Pragma no-cache
945
+	</IfModule>
946
+
947
+	<Files .htaccess>
948
+	  deny from all
949
+	</Files>
950
+
935 951
 	ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
936 952
 	<Directory "/usr/lib/cgi-bin">
937 953
 		AllowOverride All
@@ -966,6 +982,22 @@ The Apache configuration for the site should look something like the following:
966 982
 		allow from all
967 983
 	</Directory>
968 984
 
985
+	# Don't serve .php~ or .php# files created by emacs
986
+	<Files ~ "(^#.*#|~|\.sw[op])$">
987
+		Order allow,deny
988
+		Deny from all
989
+	</Files>
990
+
991
+	<IfModule headers_module>
992
+		Header set X-Content-Type-Options nosniff
993
+		Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate, private"
994
+		Header set Pragma no-cache
995
+	</IfModule>
996
+
997
+	<Files .htaccess>
998
+	  deny from all
999
+	</Files>
1000
+
969 1001
 	ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
970 1002
 	<Directory "/usr/lib/cgi-bin">
971 1003
 		AllowOverride All
@@ -1130,13 +1162,15 @@ chmod +x makecert
1130 1162
 ./makecert mydomainname.com
1131 1163
 #+END_SRC
1132 1164
 
1165
+Enter some trivial password for the key file.  The password will be removed as part of the makecert script.  Note that leaving a password on the key file would mean that after a power cycle the apache server will not be able to boot properly (it would wait indefinitely for a password to be manually entered) and would look as if it had crashed.
1166
+
1133 1167
 If all has gone well then there should be no warnings or errors after you run the service restart command.  After that you should enable ports 80 (HTTP) and 443 (HTTPS) on your internet router/firewall, such that they are redirected to the BBB.
1134 1168
 ** Social Networking
1135 1169
 
1136 1170
 #+BEGIN_VERSE
1137 1171
 /Facebook is not your friend, it is a surveillance engine./
1138 1172
 
1173
+-- Richard Stallman, Free Software Foundation
1139 1174
 #+END_VERSE
1140 1175
 
1141 1176
 *** Installation
@@ -1297,7 +1331,7 @@ Another way to access Friendica from a mobile device is to just use the web brow
1297 1331
 
1298 1332
 Wordpress is the most popular blogging platform, but in practice I found it to be high maintenance with frequent security updates and breakages.  More practical for a home server is Flatpress.  Flatpress doesn't use a MySql database, just text files, and so is easy to relocate or reinstall.
1299 1333
 
1300
-See the "/Setting up a web site/" section of this document for details of how to configure the web server for your blog's domain.
1334
+See the [[Setting up a web site]] section of this document for details of how to configure the web server for your blog's domain.
1301 1335
 
1302 1336
 Download flatpress.
1303 1337
 
@@ -1329,10 +1363,13 @@ Now visit your blog and follow the setup instructions, which are quite minimal.
1329 1363
 #+BEGIN_VERSE
1330 1364
 /Our core principles, whether in software or sovereignty, have always been about freedom and dignity, for all people, on an equal basis/
1331 1365
 
1366
+-- David Sugar, GNU Telephony
1332 1367
 #+END_VERSE
1333 1368
 
1334
-Packages for the GNU/Linux distribution Debian 7.x Wheezy are available by adding the line
1369
+*** The server
1370
+Sipwitch is like an introduction service or phone book for SIP VoIP clients.  Once introduced the clients can then talk directly, and this means that sipwitch is very lightweight and can run on low power systems such as the BBB.
1371
+
1372
+Edit your package sources:
1335 1373
 
1336 1374
 #+BEGIN_SRC: bash
1337 1375
 emacs /etc/apt/sources.list
@@ -1346,7 +1383,7 @@ deb http://dev.gnutelephony.org/archive/ wheezy/
1346 1383
 
1347 1384
 Save and exit.
1348 1385
 
1349
-to load the repository the first time after adding it to the sources.list, since you do not have the verification keys already installed yet. Then do
1386
+To load the repository the first time after adding it to the sources.list, since you do not have the verification keys already installed yet. Then do
1350 1387
 
1351 1388
 #+BEGIN_SRC: bash
1352 1389
 apt-get install gnutelephony-keyring
@@ -1376,7 +1413,7 @@ Before we install anything, let's inspect what is available to us by using
1376 1413
 dpkg -l sipwitch
1377 1414
 #+END_SRC
1378 1415
 
1379
-to see the main application. The columns will indicate if the package is installed, which version and a description of the package. Then do
1416
+To see the main application. The columns will indicate if the package is installed, which version and a description of the package. Then do
1380 1417
 
1381 1418
 #+BEGIN_SRC: bash
1382 1419
 dpkg -l sipwitch-*
@@ -1400,7 +1437,9 @@ Add your user into the sipwitch group
1400 1437
 
1401 1438
 #+BEGIN_SRC: bash
1402 1439
 groupadd sipwitch
1440
+groupadd sipusers
1403 1441
 usermod -aG sipwitch myusername
1442
+usermod -aG sipusers myusername
1404 1443
 #+END_SRC
1405 1444
 
1406 1445
 Then edit the configuration
@@ -1409,7 +1448,21 @@ Then edit the configuration
1409 1448
 emacs /etc/sipwitch.conf
1410 1449
 #+END_SRC
1411 1450
 
1412
-Change the *mapped* value from 200 to 4, since we don't want to be serving huge numbers of calls.
1451
+Change the *mapped* value from 200 to 20, since we don't want to be serving huge numbers of calls.
1452
+
1453
+Alter the *range* value to 10, since we don't need a large number of extensions.  This will mean that exension numbers 200 to 209 are available.
1454
+
1455
+Do not set the *realm* value, as doing so seems to prevent the server from working.
1456
+
1457
+Save and exit.
1458
+
1459
+Create a digest string for your username:
1460
+
1461
+#+BEGIN_SRC: bash
1462
+sipwitch digest myusername
1463
+#+END_SRC
1464
+
1465
+Make a note of the resulting string because you're going to use it in the users file you'll now create.
1413 1466
 
1414 1467
 #+BEGIN_SRC: bash
1415 1468
 export HOSTNAME=mydomainname.com
@@ -1421,28 +1474,72 @@ emacs /etc/sipwitch.d/$HOSTNAME.xml
1421 1474
 It should look something like the following:
1422 1475
 
1423 1476
 #+BEGIN_SRC: bash
1424
- <provision>
1425
-   <user id="myusername">
1426
-     <secret>yourpassword</secret> <extension>201</extension> <display>Your full name</display>
1427
-   </user>
1428
-   <user id="anotherusername">
1429
-     <secret>anotherpassword</secret> <extension>202</extension> <display>Another full name</display>
1430
-   </user>
1431
- </provision>
1477
+<provision>
1478
+    <user id="myusername">
1479
+        <digest>yourdigeststring</digest>
1480
+		<extension>201</extension>
1481
+		<display>Your full name</display>
1482
+    </user>
1483
+</provision>
1432 1484
 #+END_SRC
1433 1485
 
1434
-Save and exit.
1486
+Save and exit.  Now edit the configuration.
1435 1487
 
1436 1488
 #+BEGIN_SRC: bash
1437
-service sipwitch restart
1489
+emacs /etc/default/sipwitch
1438 1490
 #+END_SRC
1439 1491
 
1440
-To test:
1492
+Change "desktop" to "server", then save and exit.
1493
+
1494
+Update the IP settings:
1441 1495
 
1442 1496
 #+BEGIN_SRC: bash
1497
+iptables -A INPUT -p tcp --dport 5060 -j ACCEPT
1498
+iptables -A INPUT -p udp --dport 5060 -j ACCEPT
1499
+iptables -A INPUT -p tcp --dport 5061 -j ACCEPT
1500
+iptables -A INPUT -p udp --dport 5061 -j ACCEPT
1501
+iptables-save
1502
+#+END_SRC
1503
+
1504
+Test that it's working:
1505
+
1506
+#+BEGIN_SRC: bash
1507
+pkill -9 sipw
1443 1508
 sipw -x9 -f
1444 1509
 #+END_SRC
1445 1510
 
1511
+Then try to register with the server using a SIP client (such as Jitsi). If everything worked then use CTRL-C to exit.  Then start the service.
1512
+
1513
+#+BEGIN_SRC: bash
1514
+service sipwitch start
1515
+#+END_SRC
1516
+
1517
+*** Clients
1518
+**** Jitsi
1519
+Download the latst version from https://jitsi.org/index.php/Main/Download
1520
+
1521
+TODO
1522
+**** Twinkle client
1523
+
1524
+The client should have a user profile as following:
1525
+
1526
+The "user name" is the xxx id used in the <user id="xxx"> entry of /etc/sipwitch.conf
1527
+
1528
+The "domain" is the yyy domain in the main config <stack><domain>yyy entry of /etc/sipwitch.conf
1529
+
1530
+The SIP Authentication should have:
1531
+
1532
+realm = realm as set in <registry><realm> of /etc/sipwitch.conf
1533
+
1534
+authentication name = <user id="xx"> entry, same as "User Name" field.
1535
+
1536
+password = value of <secret>zzz in <user> entry of /etc/sipwitch.conf
1537
+
1538
+Under security tab, set "Enable ZRTP/SRTP encryption"
1539
+**** Android
1540
+TODO
1541
+
1542
+CSipSimple?
1446 1543
 ** Install an IRC server
1447 1544
 
1448 1545
 #+BEGIN_SRC: bash
@@ -1654,10 +1751,18 @@ now we need to restart the ircd and hybrid server to make things work:
1654 1751
 
1655 1752
 And that’s it you should have a Basic IRC server running with the NickServ and ChanServ bots running.
1656 1753
 
1657
-HERE is a Comparison of Internet Relay Chat services.
1658
-
1659 1754
 Try to connect to the IRC and identify yourself as an operator.
1660 1755
 
1756
+In irssi:
1757
+
1758
+#+BEGIN_SRC
1759
+/connect -ssl irc.example.com 6667 ircpassowrd YourNick
1760
+#+END_SRC
1761
+
1762
+/join #spatula
1763
+/msg -servername chanserv REGISTER #spatula channelpassword
1764
+/msg -servername chanserv set #spatula mlock +k channelpassword
1765
+
1661 1766
 ** Install Gopher
1662 1767
 Gopher is an old internet protocol which originated a few years before the web and is purely text based.  It can be quite fun to build a gopher site and browse the gopherverse.  One thing to keep in mind is that there is no security with gopher, so any text transmitted is trivially interceptable by systems such as [[https://en.wikipedia.org/wiki/XKeyscore][Xkeyscore]] or deep packet inspection.
1663 1768
 
@@ -2080,6 +2185,71 @@ Open a browser and visit http://$HOSTNAME/install.php, then fill out the details
2080 2185
 rm /var/www/$HOSTNAME/htdocs/install.php
2081 2186
 #+END_SRC
2082 2187
 
2188
+** Install Owncloud
2189
+
2190
+First create an apache configuration for your Owncloud site.  You will need to create a new subdomain via FreeDNS.  See the earlier section on [[Setting up a web site]] for details.
2191
+
2192
+#+BEGIN_SRC: bash
2193
+emacs /etc/php5/apache2filter/php.ini
2194
+#+END_SRC
2195
+
2196
+Set the following:
2197
+
2198
+#+BEGIN_SRC: bash
2199
+post_max_size = 32M
2200
+upload_max_filesize = 32M
2201
+#+END_SRC
2202
+
2203
+Restart apache.
2204
+
2205
+#+BEGIN_SRC: bash
2206
+service apache2 restart
2207
+#+END_SRC
2208
+
2209
+Install some dependencies:
2210
+
2211
+#+BEGIN_SRC: bash
2212
+apt-get install apache2 php5 php5-gd php-xml-parser php5-intl
2213
+apt-get install php5-sqlite php5-mysql smbclient curl libcurl3 php5-curl
2214
+#+END_SRC
2215
+
2216
+Download owncloud.
2217
+
2218
+#+BEGIN_SRC: bash
2219
+cd /tmp
2220
+wget http://freedombone.uk.to/owncloud.tar.bz2
2221
+#+END_SRC
2222
+
2223
+Verify the download:
2224
+
2225
+#+BEGIN_SRC: bash
2226
+md5 owncloud.tar.bz2
2227
+f43eabb746b5e339ee70d0a6aaf4a49c
2228
+#+END_SRC
2229
+
2230
+Extract the archive.  This may take a couple of minutes, so don't be alarmed that the system has crashed.
2231
+
2232
+#+BEGIN_SRC: bash
2233
+export HOSTNAME=myownclouddomainname.com
2234
+tar -xjf owncloud.tar.bz2
2235
+#+END_SRC
2236
+
2237
+Move the extracted files to your site.
2238
+
2239
+#+BEGIN_SRC: bash
2240
+cp -r owncloud /var/www/$HOSTNAME
2241
+rm -rf /var/www/$HOSTNAME/htdocs
2242
+mv /var/www/$HOSTNAME/owncloud /var/www/$HOSTNAME/htdocs
2243
+chown -R www-data:www-data /var/www/$HOSTNAME/htdocs/
2244
+chmod 775 /var/www/$HOSTNAME/htdocs
2245
+chmod 664 /var/www/$HOSTNAME/htdocs/*
2246
+chmod g+s /var/www/$HOSTNAME/htdocs
2247
+#+END_SRC
2248
+
2249
+With a web browser visit your domain and enter an administrator username and password.
2250
+
2251
+** Install Gitlab
2252
+
2083 2253
 ** Install Tripwire
2084 2254
 
2085 2255
 Tripwire will try to detect any intrusions into your system. It's a good idea to install it after you have installed all of the other programs which you intend to use.
@@ -2119,9 +2289,8 @@ The following ports on your internet router/firewall should be forwarded to the
2119 2289
 | HTTPS    |        443 |
2120 2290
 | IMAP     |        143 |
2121 2291
 | IRC      | 6665..6669 |
2122
-| SIP      |       5060 |
2292
+| SIP      | 5060..5061 |
2123 2293
 | SMTP     |         25 |
2124
-| SMTP     |        587 |
2125 2294
 | SMTPS    |        465 |
2126 2295
 | SSH      |         22 |
2127 2296