Ampache mit SSL

Ampache arbeitet perfekt mit SSL zusammen. Dazu müssen Sie lediglich Ihren Webserver korrekt einrichten. Trotzdem gibt es einige Dinge die Sie beachten müssen.

################################################################
#/etc/apache2/conf.d/ampache.conf
#
# This configuration file redirects all inbound http requests to
# the ssl port of your system, with the exception of the play
# directory. Therefore, music will still stream over port 80.
#
# Apache Modules needed: rewrite, php5
#
# make sure httpd.conf includes /etc/apache2/conf.d/*.conf
# or place the script in the appropriate directory.
#
# You need to change absolute directories to ampache directory.
# Optionally, you can set sess_cookiesecure  = 1
# in config/ampache.cfg.php
#
# Tested on  Apache 2.0.63 on SUSE 10.3, 
# Kai Gemba. Aug.20 2008, kgemba@csulb.edu
#################################################################
<IfModule mod_php5.c>
# Exception for the play directory
 <Directory /srv/www/htdocs/music/play>
  RewriteEngine on
  Options -Indexes +FollowSymLinks -ExecCGI
  RewriteCond %{SERVER_PORT} !^80$
  RewriteRule index.php http://%{HTTP_HOST}/music/play/index.php [NC,R,L]
 </Directory>
# Force ampache to be ssl
 <Directory /srv/www/htdocs/music>
  RewriteEngine on
  Options +Indexes +FollowSymLinks +ExecCGI
  AllowOverride None
  RewriteCond %{HTTPS} off
  RewriteRule (.*) https://%{HTTP_HOST}/music/$1 [NC,R,L]
 </Directory>
# Extra Security for bin and config
 <Directory /srv/www/htdocs/music/bin>
  Order deny,allow
  Deny from all
 </Directory>
 <Directory /srv/www/htdocs/music/config>
  Order deny,allow
  Deny from all
 </Directory>
</IfModule>

Deswegen hat Ampache standardmäßig die Option Force Http Playback aktiviert. Das bedeutet, dass Ampache alle Playlisten mit der URL http erstellen wird. So brauchen Sie nur /play/index.php durch Ihren HTTP Port and dem gleichen Punkt wie die SSL Instanz erreichbar zu machen.

Clients mit SSL Unterstützung