|
@@ -1209,8 +1209,8 @@ Set the following properties:
|
1209
|
1209
|
TCP_PORTS="1,7,9,11,15,79,109,110,111,119,138,139,512,513,514,515,540,635,1080,1524,2000,2001,3000,4000,4001,5742,6000,6001,6667,12345,12346,20034,27665,30303,32771,32772,32773,32774,31337,40421,40425,49724,54320"
|
1210
|
1210
|
UDP_PORTS="1,7,9,66,67,68,69,111,137,138,161,162,474,513,517,518,635,640,641,666,700,2049,3000,31335,27444,34555,32770,32771,32772,32773,32774,31337,54321"
|
1211
|
1211
|
|
1212
|
|
-ADVANCED_EXCLUDE_TCP="113,139,70,80,443,587,143,6697,993,5060,5061,25,465,22,5222,5223,5269,5280,5281,8444"
|
1213
|
|
-ADVANCED_EXCLUDE_UDP="520,138,137,67,70,80,443,143,6697,993, 5060,5061,25,465,22,5222,5223,5269,5280,5281,8444"
|
|
1212
|
+ADVANCED_EXCLUDE_TCP="113,139,70,80,443,587,143,6697,993,5060,5061,25,465,22,4040,5222,5223,5269,5280,5281,8444"
|
|
1213
|
+ADVANCED_EXCLUDE_UDP="520,138,137,67,70,80,443,143,6697,993, 5060,5061,25,465,22,4040,5222,5223,5269,5280,5281,8444"
|
1214
|
1214
|
|
1215
|
1215
|
SCAN_TRIGGER="2"
|
1216
|
1216
|
|
|
@@ -1339,6 +1339,10 @@ iptables -A INPUT -p tcp --dport 70 -m limit --limit 3/minute --limit-burst 1 -j
|
1339
|
1339
|
iptables -A INPUT -p tcp --dport 143 -m limit --limit 3/minute --limit-burst 1 -j ACCEPT
|
1340
|
1340
|
iptables -A INPUT -p tcp --dport 993 -m limit --limit 3/minute --limit-burst 1 -j ACCEPT
|
1341
|
1341
|
|
|
1342
|
+# Limit Subsonic connections
|
|
1343
|
+iptables -A INPUT -p tcp --dport 4040 -m limit --limit 10/minute --limit-burst 1 -j ACCEPT
|
|
1344
|
+iptables -A INPUT -p udp --dport 4040 -m limit --limit 10/minute --limit-burst 1 -j ACCEPT
|
|
1345
|
+
|
1342
|
1346
|
# Limit SIP connections
|
1343
|
1347
|
iptables -A INPUT -p tcp --dport 5060:5061 -m limit --limit 3/minute --limit-burst 1 -j ACCEPT
|
1344
|
1348
|
|
|
@@ -2351,16 +2355,16 @@ Search for MaxClients and replace the value with 6. As an example the settings s
|
2351
|
2355
|
|
2352
|
2356
|
#+BEGIN_SRC: bash
|
2353
|
2357
|
Timeout 30
|
2354
|
|
-KeepAlive On
|
|
2358
|
+KeepAlive Off
|
2355
|
2359
|
MaxKeepAliveRequests 5
|
2356
|
2360
|
KeepAliveTimeout 10
|
2357
|
2361
|
|
2358
|
2362
|
<IfModule mpm_prefork_module>
|
2359
|
|
- StartServers 1
|
2360
|
|
- MinSpareServers 1
|
2361
|
|
- MaxSpareServers 3
|
2362
|
|
- MaxClients 10
|
2363
|
|
- MaxRequestsPerChild 3000
|
|
2363
|
+ StartServers 3
|
|
2364
|
+ MinSpareServers 3
|
|
2365
|
+ MaxSpareServers 5
|
|
2366
|
+ MaxClients 10
|
|
2367
|
+ MaxRequestsPerChild 0
|
2364
|
2368
|
</IfModule>
|
2365
|
2369
|
|
2366
|
2370
|
<IfModule mpm_worker_module>
|
|
@@ -7228,6 +7232,275 @@ service cron restart
|
7228
|
7232
|
|
7229
|
7233
|
This will delete all pasted content once per day.
|
7230
|
7234
|
|
|
7235
|
+** Subsonic music server
|
|
7236
|
+
|
|
7237
|
+#+BEGIN_VERSE
|
|
7238
|
+/Where words fail, music speaks./
|
|
7239
|
+
|
|
7240
|
+-- Hans Christian Andersen
|
|
7241
|
+#+END_VERSE
|
|
7242
|
+
|
|
7243
|
+*** Introduction
|
|
7244
|
+Owncloud is probably the easiest way to handle your media, but Subsonic is another alternative and has a mobile app which can be used to conveniently play your music. Unless you particularly prefer Subsonic it's probably better to stick with Owncloud and skip this section.
|
|
7245
|
+
|
|
7246
|
+The method of installing Subsonic described here is not ideal, but works. The main issue is that the Debian package supplied from sourceforge contains a licensing [[https://www.fsf.org/blogs/community/antifeatures][antifeature]], which needs to be removed in order to achieve a fully free system.
|
|
7247
|
+*** Installing the Server
|
|
7248
|
+For this you will need a new subdomain (or your own domain), so see [[Setting up a web site]] for details of how to do that.
|
|
7249
|
+
|
|
7250
|
+#+BEGIN_SRC: bash
|
|
7251
|
+apt-get install openjdk-7-jre openjdk-7-jdk lintian maven libav-tools
|
|
7252
|
+adduser subsonic
|
|
7253
|
+mkdir ~/build
|
|
7254
|
+cd ~/build
|
|
7255
|
+wget http://freedombone.uk.to/subsonic-4.9.deb
|
|
7256
|
+sha256sum subsonic-4.9.deb
|
|
7257
|
+064c2a7e69d47715ce230f3dfcacdc627c18f6466e0fe48952f133ce06be698d
|
|
7258
|
+dpkg -i subsonic-4.9.deb
|
|
7259
|
+#+END_SRC
|
|
7260
|
+
|
|
7261
|
+Now we remove the antifeature by compiling from source and then overwriting the relevant files.
|
|
7262
|
+
|
|
7263
|
+#+BEGIN_SRC: bash
|
|
7264
|
+git clone https://github.com/EugeneKay/subsonic.git
|
|
7265
|
+cd subsonic
|
|
7266
|
+git checkout release
|
|
7267
|
+mvn package
|
|
7268
|
+mvn -P full -pl subsonic-booter -am install
|
|
7269
|
+mvn -P full -pl subsonic-installer-debian/ -am install
|
|
7270
|
+cp ~/build/subsonic/subsonic-booter/target/subsonic-booter-jar-with-dependencies.jar /usr/share/subsonic/
|
|
7271
|
+cp ~/build/subsonic/subsonic-main/target/subsonic.war /usr/share/subsonic/subsonic.war
|
|
7272
|
+cp ~/build/subsonic/subsonic-booter/src/main/script/subsonic.sh /usr/share/subsonic/subsonic.sh
|
|
7273
|
+editor /etc/default/subsonic
|
|
7274
|
+#+END_SRC
|
|
7275
|
+
|
|
7276
|
+Settings should look like the following.
|
|
7277
|
+
|
|
7278
|
+#+BEGIN_SRC: bash
|
|
7279
|
+SUBSONIC_ARGS="--max-memory=100"
|
|
7280
|
+SUBSONIC_USER=subsonic
|
|
7281
|
+#+END_SRC
|
|
7282
|
+
|
|
7283
|
+Save and exit.
|
|
7284
|
+
|
|
7285
|
+#+BEGIN_SRC: bash
|
|
7286
|
+chown -R subsonic:subsonic /var/subsonic
|
|
7287
|
+mkdir /var/music
|
|
7288
|
+chown -R subsonic:subsonic /var/music
|
|
7289
|
+service subsonic restart
|
|
7290
|
+#+END_SRC
|
|
7291
|
+
|
|
7292
|
+Edit your Apache configuration.
|
|
7293
|
+
|
|
7294
|
+#+BEGIN_SRC: bash
|
|
7295
|
+export HOSTNAME=mysubsonicdomainname.com
|
|
7296
|
+editor /etc/apache2/sites-available/$HOSTNAME
|
|
7297
|
+#+END_SRC
|
|
7298
|
+
|
|
7299
|
+Add the following, replacing /mysubsonicdomainname.com/ with your subsonic domain name and /myusername@mydomainname.com/ with your email address.
|
|
7300
|
+
|
|
7301
|
+#+BEGIN_SRC: bash
|
|
7302
|
+<VirtualHost *:80>
|
|
7303
|
+ ServerName mysubsonicdomainname.com
|
|
7304
|
+ Redirect permanent / https://mysubsonicdomainname.com/
|
|
7305
|
+</VirtualHost>
|
|
7306
|
+
|
|
7307
|
+<IfModule mod_ssl.c>
|
|
7308
|
+<VirtualHost *:443>
|
|
7309
|
+ ServerAdmin myusername@mydomainname.com
|
|
7310
|
+ ServerName mysubsonicdomainname.com
|
|
7311
|
+
|
|
7312
|
+ ProxyRequests Off
|
|
7313
|
+ ProxyPreserveHost Off
|
|
7314
|
+
|
|
7315
|
+ <Location />
|
|
7316
|
+ ProxyPass http://localhost:4040/
|
|
7317
|
+ ProxyPassReverse http://localhost:4040/
|
|
7318
|
+ </Location>
|
|
7319
|
+
|
|
7320
|
+ RewriteEngine on
|
|
7321
|
+ RewriteOptions inherit
|
|
7322
|
+
|
|
7323
|
+ DocumentRoot /var/www/mysubsonicdomainname.com/htdocs
|
|
7324
|
+ <Directory />
|
|
7325
|
+ Options FollowSymLinks
|
|
7326
|
+ AllowOverride All
|
|
7327
|
+ </Directory>
|
|
7328
|
+ <Directory /var/www/mysubsonicdomainname.com/htdocs/>
|
|
7329
|
+ Options All
|
|
7330
|
+ AllowOverride All
|
|
7331
|
+ Order allow,deny
|
|
7332
|
+ allow from all
|
|
7333
|
+ LimitRequestBody 5120000
|
|
7334
|
+ </Directory>
|
|
7335
|
+
|
|
7336
|
+ # Don't serve .php~ or .php# files created by emacs
|
|
7337
|
+ <Files ~ "(^#.*#|~|\.sw[op])$">
|
|
7338
|
+ Order allow,deny
|
|
7339
|
+ Deny from all
|
|
7340
|
+ </Files>
|
|
7341
|
+
|
|
7342
|
+ <IfModule headers_module>
|
|
7343
|
+ Header set X-Content-Type-Options nosniff
|
|
7344
|
+ Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate, private"
|
|
7345
|
+ Header set Pragma no-cache
|
|
7346
|
+ </IfModule>
|
|
7347
|
+
|
|
7348
|
+ <Files .htaccess>
|
|
7349
|
+ deny from all
|
|
7350
|
+ </Files>
|
|
7351
|
+
|
|
7352
|
+ ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
|
|
7353
|
+ <Directory "/usr/lib/cgi-bin">
|
|
7354
|
+ AllowOverride All
|
|
7355
|
+ Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
|
|
7356
|
+ Order allow,deny
|
|
7357
|
+ Allow from all
|
|
7358
|
+ LimitRequestBody 512000
|
|
7359
|
+ </Directory>
|
|
7360
|
+
|
|
7361
|
+ ErrorLog ${APACHE_LOG_DIR}/error.log
|
|
7362
|
+
|
|
7363
|
+ # Possible values include: debug, info, notice, warn, error, crit,
|
|
7364
|
+ # alert, emerg.
|
|
7365
|
+ LogLevel error
|
|
7366
|
+
|
|
7367
|
+ CustomLog ${APACHE_LOG_DIR}/ssl_access.log combined
|
|
7368
|
+
|
|
7369
|
+ # SSL Engine Switch:
|
|
7370
|
+ # Enable/Disable SSL for this virtual host.
|
|
7371
|
+ SSLEngine on
|
|
7372
|
+
|
|
7373
|
+ SSLCertificateFile /etc/ssl/certs/mysubsonicdomainname.com.crt
|
|
7374
|
+ SSLCertificateKeyFile /etc/ssl/private/mysubsonicdomainname.com.key
|
|
7375
|
+
|
|
7376
|
+ # Options based on bettercrypto.org
|
|
7377
|
+ SSLProtocol All -SSLv2 -SSLv3
|
|
7378
|
+ SSLHonorCipherOrder On
|
|
7379
|
+ SSLCompression off
|
|
7380
|
+ SSLCipherSuite EDH+CAMELLIA:EDH+aRSA:EECDH+aRSA+AESGCM:EECDH+aRSA+SHA384:EECDH+aRSA+SHA256:EECDH:+CAMELLIA256:+AES256:+CAMELLIA128:+AES128:+SSLv3:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS:!RC4:!SEED:!ECDSA:CAMELLIA256-SHA:AES256-SHA:CAMELLIA128-SHA:AES128-SHA
|
|
7381
|
+
|
|
7382
|
+ # Add six earth month HSTS header for all users ...
|
|
7383
|
+ Header add Strict-Transport-Security "max-age=15768000"
|
|
7384
|
+ # If you want to protect all subdomains , use the following header
|
|
7385
|
+ # ALL subdomains HAVE TO support https if you use this !
|
|
7386
|
+ # Strict-Transport-Security: max-age=15768000 ; includeSubDomains
|
|
7387
|
+
|
|
7388
|
+ # SSL Engine Options:
|
|
7389
|
+ # Set various options for the SSL engine.
|
|
7390
|
+ # o FakeBasicAuth:
|
|
7391
|
+ # Translate the client X.509 into a Basic Authorisation. This means that
|
|
7392
|
+ # the standard Auth/DBMAuth methods can be used for access control. The
|
|
7393
|
+ # user name is the `one line' version of the client's X.509 certificate.
|
|
7394
|
+ # Note that no password is obtained from the user. Every entry in the user
|
|
7395
|
+ # file needs this password: `xxj31ZMTZzkVA'.
|
|
7396
|
+ # o ExportCertData:
|
|
7397
|
+ # This exports two additional environment variables: SSL_CLIENT_CERT and
|
|
7398
|
+ # SSL_SERVER_CERT. These contain the PEM-encoded certificates of the
|
|
7399
|
+ # server (always existing) and the client (only existing when client
|
|
7400
|
+ # authentication is used). This can be used to import the certificates
|
|
7401
|
+ # into CGI scripts.
|
|
7402
|
+ # o StdEnvVars:
|
|
7403
|
+ # This exports the standard SSL/TLS related `SSL_*' environment variables.
|
|
7404
|
+ # Per default this exportation is switched off for performance reasons,
|
|
7405
|
+ # because the extraction step is an expensive operation and is usually
|
|
7406
|
+ # useless for serving static content. So one usually enables the
|
|
7407
|
+ # exportation for CGI and SSI requests only.
|
|
7408
|
+ # o StrictRequire:
|
|
7409
|
+ # This denies access when "SSLRequireSSL" or "SSLRequire" applied even
|
|
7410
|
+ # under a "Satisfy any" situation, i.e. when it applies access is denied
|
|
7411
|
+ # and no other module can change it.
|
|
7412
|
+ # o OptRenegotiate:
|
|
7413
|
+ # This enables optimized SSL connection renegotiation handling when SSL
|
|
7414
|
+ # directives are used in per-directory context.
|
|
7415
|
+ #SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
|
|
7416
|
+ <FilesMatch "\.(cgi|shtml|phtml|php)$">
|
|
7417
|
+ SSLOptions +StdEnvVars
|
|
7418
|
+ </FilesMatch>
|
|
7419
|
+ <Directory /usr/lib/cgi-bin>
|
|
7420
|
+ SSLOptions +StdEnvVars
|
|
7421
|
+ </Directory>
|
|
7422
|
+
|
|
7423
|
+ # SSL Protocol Adjustments:
|
|
7424
|
+ # The safe and default but still SSL/TLS standard compliant shutdown
|
|
7425
|
+ # approach is that mod_ssl sends the close notify alert but doesn't wait for
|
|
7426
|
+ # the close notify alert from client. When you need a different shutdown
|
|
7427
|
+ # approach you can use one of the following variables:
|
|
7428
|
+ # o ssl-unclean-shutdown:
|
|
7429
|
+ # This forces an unclean shutdown when the connection is closed, i.e. no
|
|
7430
|
+ # SSL close notify alert is send or allowed to received. This violates
|
|
7431
|
+ # the SSL/TLS standard but is needed for some brain-dead browsers. Use
|
|
7432
|
+ # this when you receive I/O errors because of the standard approach where
|
|
7433
|
+ # mod_ssl sends the close notify alert.
|
|
7434
|
+ # o ssl-accurate-shutdown:
|
|
7435
|
+ # This forces an accurate shutdown when the connection is closed, i.e. a
|
|
7436
|
+ # SSL close notify alert is send and mod_ssl waits for the close notify
|
|
7437
|
+ # alert of the client. This is 100% SSL/TLS standard compliant, but in
|
|
7438
|
+ # practice often causes hanging connections with brain-dead browsers. Use
|
|
7439
|
+ # this only for browsers where you know that their SSL implementation
|
|
7440
|
+ # works correctly.
|
|
7441
|
+ # Notice: Most problems of broken clients are also related to the HTTP
|
|
7442
|
+ # keep-alive facility, so you usually additionally want to disable
|
|
7443
|
+ # keep-alive for those clients, too. Use variable "nokeepalive" for this.
|
|
7444
|
+ # Similarly, one has to force some clients to use HTTP/1.0 to workaround
|
|
7445
|
+ # their broken HTTP/1.1 implementation. Use variables "downgrade-1.0" and
|
|
7446
|
+ # "force-response-1.0" for this.
|
|
7447
|
+ BrowserMatch "MSIE [2-6]" \
|
|
7448
|
+ nokeepalive ssl-unclean-shutdown \
|
|
7449
|
+ downgrade-1.0 force-response-1.0
|
|
7450
|
+ # MSIE 7 and newer should be able to use keepalive
|
|
7451
|
+ BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
|
|
7452
|
+
|
|
7453
|
+</VirtualHost>
|
|
7454
|
+</IfModule>
|
|
7455
|
+#+END_SRC
|
|
7456
|
+
|
|
7457
|
+Save and exit.
|
|
7458
|
+
|
|
7459
|
+#+BEGIN_SRC: bash
|
|
7460
|
+makecert mysubsonicdomainname.com
|
|
7461
|
+a2ensite mysubsonicdomainname.com
|
|
7462
|
+service apache2 restart
|
|
7463
|
+#+END_SRC
|
|
7464
|
+*** Configuration
|
|
7465
|
+Open a browser and go to your subsonic domain name. Log in with username /admin/ and password /admin/, then change your administrator password.
|
|
7466
|
+
|
|
7467
|
+Within the settings click on /users/ and add a user. Give your user access to everything by ticking all the checkboxes. You can then log out and log back in as the user.
|
|
7468
|
+
|
|
7469
|
+Click /settings/ and select /transcoding/. Change the transcoding settings to the following:
|
|
7470
|
+
|
|
7471
|
+| Name | Convert from | Convert to | Step 1 |
|
|
7472
|
+|----------------+---------------------------------------------------+------------+------------------------------------------------------------------------------------------------------------------------------------------|
|
|
7473
|
+| mp3 audio | ogg oga aac m4a flac wav wma aif aiff ape mpc shn | mp3 | avconv -i %s -b %bk -q 0 -loglevel error -f mp3 - |
|
|
7474
|
+| flv/h264 video | avi mpg mpeg mp4 m4v mkv mov wmv ogv divx m2ts | flv | avconv -ss %o -i %s -async 1 -b %bk -s %wx%h -c:a libmp3lame -ar 44100 -ac 2 -v debug -f flv -c:v libx264 -preset superfast -threads 0 - |
|
|
7475
|
+
|
|
7476
|
+| Downsample command | avconv -i %s -b %bk -v 0 -f mp3 - |
|
|
7477
|
+| HTTP Live Streaming command | avconv -ss %0 -t %d -i %s -async 1 -b %bk -s %wx%h -ar 44100 -ac 2 -v 0 -f mpegts -vcodec libx264 -preset superfast -acodec libmp3lame -threads 0 - |
|
|
7478
|
+
|
|
7479
|
+Then save.
|
|
7480
|
+
|
|
7481
|
+Open port 4040 on your internet router and forward it to the BBB.
|
|
7482
|
+
|
|
7483
|
+*** Adding your music
|
|
7484
|
+The easiest way to add your music is to obtain a large capacity USB stick, copy your music onto it, plug it into the front of the BBB and then mount it as a drive.
|
|
7485
|
+
|
|
7486
|
+So with the USB stick plugged in and logged into the BBB as root via ssh:
|
|
7487
|
+
|
|
7488
|
+#+BEGIN_SRC: bash
|
|
7489
|
+mount /dev/sda /var/music
|
|
7490
|
+chown -R subsonic:subsonic /var/music
|
|
7491
|
+#+END_SRC
|
|
7492
|
+
|
|
7493
|
+Then within a browser go to your Subsonic domain name, select *settings*, then *Media folders* then *Scan media folders now*. Depending upon how much music you have this could take a while, so don't be too impatient.
|
|
7494
|
+*** Android App
|
|
7495
|
+Within [[https://f-droid.org/][F-Droid]] search for *Dsub* and install it.
|
|
7496
|
+
|
|
7497
|
+Open the app, then press on the Dsub icon (top left) and select *settings*, followed by *servers*. Select one of the unused servers then set the name to your domain name, the server address to https://mysubsonicdomainname.com (the domain name you used for subsonic) and your username and password for the Subsonic user which you created earlier. Press on *test server* to check the internet connection to the BBB.
|
|
7498
|
+
|
|
7499
|
+Remove any other servers (including the demo) by pressing on them then selecting *remove server*.
|
|
7500
|
+
|
|
7501
|
+You can then press *back* a few times to return to the main Dsub menu and press *recently added*. If your media library has been scanned (as in the earlier "adding your music" step) then you should see tracks appear. Press on one, then press the play button.
|
|
7502
|
+
|
|
7503
|
+Other proprietary Subsonic mobile apps are available, but are not recommended. Anything proprietary could contain backdoors, malware or other nasties which merely assist the surveillance apparatus.
|
7231
|
7504
|
** Database maintenance
|
7232
|
7505
|
|
7233
|
7506
|
#+BEGIN_VERSE
|
|
@@ -7496,6 +7769,7 @@ The following ports on your internet router/firewall should be forwarded to the
|
7496
|
7769
|
| XMPP (server) | 5269 |
|
7497
|
7770
|
| XMPP (BOSH) | 5280..5281 |
|
7498
|
7771
|
| Bitmessage | 8444 |
|
|
7772
|
+| Subsonic | 4040 |
|
7499
|
7773
|
|
7500
|
7774
|
* Hints and Tips
|
7501
|
7775
|
** Example configurations
|
|
@@ -8358,232 +8632,6 @@ a2ensite $HOSTNAME
|
8358
|
8632
|
service apache2 restart
|
8359
|
8633
|
#+END_SRC
|
8360
|
8634
|
|
8361
|
|
-** Subsonic
|
8362
|
|
-
|
8363
|
|
-Subsonic looks ok as a media server, but the deb file downloadable from soureforge seems to be not quite free - i.e. to have a built in licensing antifeature. There is a fully free version with the antifeature removed, but currently the debian build fails.
|
8364
|
|
-
|
8365
|
|
-#+BEGIN_SRC
|
8366
|
|
-apt-get install openjdk-7-jre openjdk-7-jdk lintian maven
|
8367
|
|
-adduser subsonic
|
8368
|
|
-mkdir ~/build
|
8369
|
|
-cd ~/build
|
8370
|
|
-git clone https://github.com/EugeneKay/subsonic.git
|
8371
|
|
-cd subsonic
|
8372
|
|
-git checkout release
|
8373
|
|
-mvn package
|
8374
|
|
-mvn -P full -pl subsonic-booter -am install
|
8375
|
|
-mvn -P full -pl subsonic-installer-debian/ -am install
|
8376
|
|
-dpkg -i ./subsonic-installer-debian/target/subsonic-*.deb
|
8377
|
|
-editor /etc/default/subsonic
|
8378
|
|
-#+END_SRC
|
8379
|
|
-
|
8380
|
|
-Settings should look like the following:
|
8381
|
|
-
|
8382
|
|
-#+BEGIN_SRC: bash
|
8383
|
|
-SUBSONIC_ARGS="--port=4040 --max-memory=100"
|
8384
|
|
-SUBSONIC_USER=subsonic
|
8385
|
|
-#+END_SRC
|
8386
|
|
-
|
8387
|
|
-Save and exit.
|
8388
|
|
-
|
8389
|
|
-#+BEGIN_SRC: bash
|
8390
|
|
-chown -R subsonic:subsonic /var/subsonic
|
8391
|
|
-service subsonic restart
|
8392
|
|
-#+END_SRC
|
8393
|
|
-
|
8394
|
|
-Edit your Apache configuration.
|
8395
|
|
-
|
8396
|
|
-#+BEGIN_SRC: bash
|
8397
|
|
-export HOSTNAME=mydomainname.com
|
8398
|
|
-editor /etc/apache2/sites-available/$HOSTNAME
|
8399
|
|
-#+END_SRC
|
8400
|
|
-
|
8401
|
|
-Add the following, replacing /mysubsonicdomainname.com/ with your subsonic domain name and /myusername@mydomainname.com/ with your email address.
|
8402
|
|
-
|
8403
|
|
-#+BEGIN_SRC: bash
|
8404
|
|
-<VirtualHost *:80>
|
8405
|
|
- ServerAdmin myusername@mydomainname.com
|
8406
|
|
- ServerName mysubsonicdomainname.com
|
8407
|
|
-
|
8408
|
|
- ProxyRequests Off
|
8409
|
|
- ProxyPreserveHost Off
|
8410
|
|
-
|
8411
|
|
- <Location />
|
8412
|
|
- ProxyPass http://localhost:4040/
|
8413
|
|
- ProxyPassReverse http://localhost:4040/
|
8414
|
|
- </Location>
|
8415
|
|
-
|
8416
|
|
- RewriteEngine on
|
8417
|
|
- RewriteOptions inherit
|
8418
|
|
-
|
8419
|
|
- ErrorLog ${APACHE_LOG_DIR}/paste_error.log
|
8420
|
|
-
|
8421
|
|
- # Possible values include: debug, info, notice, warn, error, crit,
|
8422
|
|
- # alert, emerg.
|
8423
|
|
- LogLevel error
|
8424
|
|
-
|
8425
|
|
- CustomLog ${APACHE_LOG_DIR}/paste.log combined
|
8426
|
|
-</VirtualHost>
|
8427
|
|
-
|
8428
|
|
-
|
8429
|
|
-<IfModule mod_ssl.c>
|
8430
|
|
-<VirtualHost *:443>
|
8431
|
|
- ServerAdmin myusername@mydomainname.com
|
8432
|
|
- ServerName mysubsonicdomainname.com
|
8433
|
|
-
|
8434
|
|
- ProxyRequests Off
|
8435
|
|
- ProxyPreserveHost Off
|
8436
|
|
-
|
8437
|
|
- <Location />
|
8438
|
|
- ProxyPass http://localhost:4040/
|
8439
|
|
- ProxyPassReverse http://localhost:4040/
|
8440
|
|
- </Location>
|
8441
|
|
-
|
8442
|
|
- RewriteEngine on
|
8443
|
|
- RewriteOptions inherit
|
8444
|
|
-
|
8445
|
|
- DocumentRoot /var/www/mysubsonicdomainname.com/htdocs
|
8446
|
|
- <Directory />
|
8447
|
|
- Options FollowSymLinks
|
8448
|
|
- AllowOverride All
|
8449
|
|
- </Directory>
|
8450
|
|
- <Directory /var/www/mysubsonicdomainname.com/htdocs/>
|
8451
|
|
- Options All
|
8452
|
|
- AllowOverride All
|
8453
|
|
- Order allow,deny
|
8454
|
|
- allow from all
|
8455
|
|
- LimitRequestBody 5120000
|
8456
|
|
- </Directory>
|
8457
|
|
-
|
8458
|
|
- # Don't serve .php~ or .php# files created by emacs
|
8459
|
|
- <Files ~ "(^#.*#|~|\.sw[op])$">
|
8460
|
|
- Order allow,deny
|
8461
|
|
- Deny from all
|
8462
|
|
- </Files>
|
8463
|
|
-
|
8464
|
|
- <IfModule headers_module>
|
8465
|
|
- Header set X-Content-Type-Options nosniff
|
8466
|
|
- Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate, private"
|
8467
|
|
- Header set Pragma no-cache
|
8468
|
|
- </IfModule>
|
8469
|
|
-
|
8470
|
|
- <Files .htaccess>
|
8471
|
|
- deny from all
|
8472
|
|
- </Files>
|
8473
|
|
-
|
8474
|
|
- ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
|
8475
|
|
- <Directory "/usr/lib/cgi-bin">
|
8476
|
|
- AllowOverride All
|
8477
|
|
- Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
|
8478
|
|
- Order allow,deny
|
8479
|
|
- Allow from all
|
8480
|
|
- LimitRequestBody 512000
|
8481
|
|
- </Directory>
|
8482
|
|
-
|
8483
|
|
- ErrorLog ${APACHE_LOG_DIR}/error.log
|
8484
|
|
-
|
8485
|
|
- # Possible values include: debug, info, notice, warn, error, crit,
|
8486
|
|
- # alert, emerg.
|
8487
|
|
- LogLevel error
|
8488
|
|
-
|
8489
|
|
- CustomLog ${APACHE_LOG_DIR}/ssl_access.log combined
|
8490
|
|
-
|
8491
|
|
- # SSL Engine Switch:
|
8492
|
|
- # Enable/Disable SSL for this virtual host.
|
8493
|
|
- SSLEngine on
|
8494
|
|
-
|
8495
|
|
- SSLCertificateFile /etc/ssl/certs/mysubsonicdomainname.com.crt
|
8496
|
|
- SSLCertificateKeyFile /etc/ssl/private/mysubsonicdomainname.com.key
|
8497
|
|
-
|
8498
|
|
- # Options based on bettercrypto.org
|
8499
|
|
- SSLProtocol All -SSLv2 -SSLv3
|
8500
|
|
- SSLHonorCipherOrder On
|
8501
|
|
- SSLCompression off
|
8502
|
|
- SSLCipherSuite EDH+CAMELLIA:EDH+aRSA:EECDH+aRSA+AESGCM:EECDH+aRSA+SHA384:EECDH+aRSA+SHA256:EECDH:+CAMELLIA256:+AES256:+CAMELLIA128:+AES128:+SSLv3:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS:!RC4:!SEED:!ECDSA:CAMELLIA256-SHA:AES256-SHA:CAMELLIA128-SHA:AES128-SHA
|
8503
|
|
-
|
8504
|
|
- # Add six earth month HSTS header for all users ...
|
8505
|
|
- Header add Strict-Transport-Security "max-age=15768000"
|
8506
|
|
- # If you want to protect all subdomains , use the following header
|
8507
|
|
- # ALL subdomains HAVE TO support https if you use this !
|
8508
|
|
- # Strict-Transport-Security: max-age=15768000 ; includeSubDomains
|
8509
|
|
-
|
8510
|
|
- # SSL Engine Options:
|
8511
|
|
- # Set various options for the SSL engine.
|
8512
|
|
- # o FakeBasicAuth:
|
8513
|
|
- # Translate the client X.509 into a Basic Authorisation. This means that
|
8514
|
|
- # the standard Auth/DBMAuth methods can be used for access control. The
|
8515
|
|
- # user name is the `one line' version of the client's X.509 certificate.
|
8516
|
|
- # Note that no password is obtained from the user. Every entry in the user
|
8517
|
|
- # file needs this password: `xxj31ZMTZzkVA'.
|
8518
|
|
- # o ExportCertData:
|
8519
|
|
- # This exports two additional environment variables: SSL_CLIENT_CERT and
|
8520
|
|
- # SSL_SERVER_CERT. These contain the PEM-encoded certificates of the
|
8521
|
|
- # server (always existing) and the client (only existing when client
|
8522
|
|
- # authentication is used). This can be used to import the certificates
|
8523
|
|
- # into CGI scripts.
|
8524
|
|
- # o StdEnvVars:
|
8525
|
|
- # This exports the standard SSL/TLS related `SSL_*' environment variables.
|
8526
|
|
- # Per default this exportation is switched off for performance reasons,
|
8527
|
|
- # because the extraction step is an expensive operation and is usually
|
8528
|
|
- # useless for serving static content. So one usually enables the
|
8529
|
|
- # exportation for CGI and SSI requests only.
|
8530
|
|
- # o StrictRequire:
|
8531
|
|
- # This denies access when "SSLRequireSSL" or "SSLRequire" applied even
|
8532
|
|
- # under a "Satisfy any" situation, i.e. when it applies access is denied
|
8533
|
|
- # and no other module can change it.
|
8534
|
|
- # o OptRenegotiate:
|
8535
|
|
- # This enables optimized SSL connection renegotiation handling when SSL
|
8536
|
|
- # directives are used in per-directory context.
|
8537
|
|
- #SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
|
8538
|
|
- <FilesMatch "\.(cgi|shtml|phtml|php)$">
|
8539
|
|
- SSLOptions +StdEnvVars
|
8540
|
|
- </FilesMatch>
|
8541
|
|
- <Directory /usr/lib/cgi-bin>
|
8542
|
|
- SSLOptions +StdEnvVars
|
8543
|
|
- </Directory>
|
8544
|
|
-
|
8545
|
|
- # SSL Protocol Adjustments:
|
8546
|
|
- # The safe and default but still SSL/TLS standard compliant shutdown
|
8547
|
|
- # approach is that mod_ssl sends the close notify alert but doesn't wait for
|
8548
|
|
- # the close notify alert from client. When you need a different shutdown
|
8549
|
|
- # approach you can use one of the following variables:
|
8550
|
|
- # o ssl-unclean-shutdown:
|
8551
|
|
- # This forces an unclean shutdown when the connection is closed, i.e. no
|
8552
|
|
- # SSL close notify alert is send or allowed to received. This violates
|
8553
|
|
- # the SSL/TLS standard but is needed for some brain-dead browsers. Use
|
8554
|
|
- # this when you receive I/O errors because of the standard approach where
|
8555
|
|
- # mod_ssl sends the close notify alert.
|
8556
|
|
- # o ssl-accurate-shutdown:
|
8557
|
|
- # This forces an accurate shutdown when the connection is closed, i.e. a
|
8558
|
|
- # SSL close notify alert is send and mod_ssl waits for the close notify
|
8559
|
|
- # alert of the client. This is 100% SSL/TLS standard compliant, but in
|
8560
|
|
- # practice often causes hanging connections with brain-dead browsers. Use
|
8561
|
|
- # this only for browsers where you know that their SSL implementation
|
8562
|
|
- # works correctly.
|
8563
|
|
- # Notice: Most problems of broken clients are also related to the HTTP
|
8564
|
|
- # keep-alive facility, so you usually additionally want to disable
|
8565
|
|
- # keep-alive for those clients, too. Use variable "nokeepalive" for this.
|
8566
|
|
- # Similarly, one has to force some clients to use HTTP/1.0 to workaround
|
8567
|
|
- # their broken HTTP/1.1 implementation. Use variables "downgrade-1.0" and
|
8568
|
|
- # "force-response-1.0" for this.
|
8569
|
|
- BrowserMatch "MSIE [2-6]" \
|
8570
|
|
- nokeepalive ssl-unclean-shutdown \
|
8571
|
|
- downgrade-1.0 force-response-1.0
|
8572
|
|
- # MSIE 7 and newer should be able to use keepalive
|
8573
|
|
- BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
|
8574
|
|
-
|
8575
|
|
-</VirtualHost>
|
8576
|
|
-</IfModule>
|
8577
|
|
-#+END_SRC
|
8578
|
|
-
|
8579
|
|
-Save and exit.
|
8580
|
|
-
|
8581
|
|
-#+BEGIN_SRC: bash
|
8582
|
|
-makecert mysubsonicdomainname.com
|
8583
|
|
-a2ensite mysubsonicdomainname.com
|
8584
|
|
-service apache2 restart
|
8585
|
|
-#+END_SRC
|
8586
|
|
-
|
8587
|
8635
|
* Related projects
|
8588
|
8636
|
|
8589
|
8637
|
* [[https://freedomboxfoundation.org/][Freedombox]]
|