File httpd.conf.ampache of Package ampache

# You might want to set up a virtual host for the server, but it is
# not a requirement. You can as well reach the server under its
# common name under http://your.server.name/ampache
#
# NameVirtualHost *
# <VirtualHost *>
#     ServerName your.server.name
#     DocumentRoot @APACHE_SERVERROOT@/ampache/public
# </VirtualHost>


<IfModule mod_alias.c>
    Alias /ampache          @APACHE_SERVERROOT@/ampache/public
</IfModule>


  <Directory @APACHE_SERVERROOT@/ampache/public>
    Options -Indexes +SymLinksIfOwnerMatch +ExecCGI
    AllowOverride None

    #
    # The server may be accessed from:
    #
    # Example for `deny all' plus exceptions
    #Order deny,allow
    #Deny from all
    #Allow from example.com
    #Allow from 10.1.0.0/255.255.0.0
    #
    # Example for `allow all'
    # Apache 2.2
    #Order allow,deny
    #Allow from all
    # Apache 2.4
    Require all granted

    <IfModule mod_php5.c>
       # see http://www.zend.com/manual/ref.session.php
       php_value session.save_handler files

       # rebuilding the catalog can take some time... let's increase the time the script
       # is allowed to run to 300 seconds. The default is 30 seconds.
       # Note that you even might need to set this to much higher values, but this is only 
       # the PHP side of things, see below for the apache-related setting
       php_value max_execution_time 300

       # you may need to increase the memory limit (current default: 8 MB)
       #php_value memory_limit 8M

       # Set our default character set. The server-wide default might differ
       AddDefaultCharset ISO-8859-1
    </IfModule>
    <IfModule mod_php7.c>
       # see http://www.zend.com/manual/ref.session.php
       php_value session.save_handler files

       # rebuilding the catalog can take some time... let's increase the time the script
       # is allowed to run to 300 seconds. The default is 30 seconds.
       # Note that you even might need to set this to much higher values, but this is only 
       # the PHP side of things, see below for the apache-related setting
       php_value max_execution_time 300

       # you may need to increase the memory limit (current default: 8 MB)
       #php_value memory_limit 8M

       # Set our default character set. The server-wide default might differ
       AddDefaultCharset ISO-8859-1
    </IfModule>

  </Directory>

  <Directory @APACHE_SERVERROOT@/ampache>
    # Apache 2.4
    <IfModule mod_authz_core.c>
	Require all denied
    </IfModule>
    # Apache 2.2
    <IfModule mod_access.c>
	Order deny,allow
	Deny from all
    </IfModule>
  </Directory>

  <Directory @APACHE_SERVERROOT@/ampache/bin>
    # Apache 2.4
    <IfModule mod_authz_core.c>
	Require all denied
    </IfModule>
    # Apache 2.2
    <IfModule mod_access.c>
	Order deny,allow
	Deny from all
    </IfModule>
  </Directory>

  <Directory @APACHE_SERVERROOT@/ampache/config>
    # Apache 2.4
    <IfModule mod_authz_core.c>
	Require all denied
    </IfModule>
    # Apache 2.2
    <IfModule mod_access.c>
	Order deny,allow
	Deny from all
    </IfModule>
  </Directory>

  <Directory @APACHE_SERVERROOT@/ampache/public/channel>
    <IfModule mod_rewrite.c>
      RewriteEngine On
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteCond %{REQUEST_FILENAME} !-s
      RewriteRule ^([0-9]+)/(.*)$ /channel/index.php?channel=$1&target=$2 [PT,L,QSA]
    </IfModule>  
  </Directory>

  <Directory @APACHE_SERVERROOT@/ampache/public/daap>
    <IfModule mod_rewrite.c>
      RewriteEngine On    
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteCond %{REQUEST_FILENAME} !-s
      RewriteRule ^(.+)$ /index.php?action=$1 [PT,L,QSA]
    </IfModule>
  </Directory>

  <Directory @APACHE_SERVERROOT@/ampache/public/lib/javascript>
    # Apache 2.4
    <IfModule mod_authz_core.c>
	Require all granted
    </IfModule>
    # Apache 2.2
    <IfModule mod_access.c>
	Order deny,allow
	Allow from all
    </IfModule>
  </Directory>  

  <Directory @APACHE_SERVERROOT@/ampache/public/play>
    Options +SymLinksIfOwnerMatch
    <IfModule mod_rewrite.c>
      RewriteEngine On
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteCond %{REQUEST_FILENAME} !-s
      RewriteRule ^art/([^/]+)/([^/]+)/([0-9]+)/thumb([0-9]*)\.([a-z]+)$ /ampache/image.php?object_type=$2&object_id=$3&auth=$1&thumb=$4&name=art.jpg [L]
      RewriteRule ^([^/]+)/([^/]+)/([^/]+)/([^/]+)(/.*)?$ /play/$5?$1=$2&$3=$4 [N,QSA]
      RewriteRule ^([^/]+)/([^/]+)(/.*)?$ /play/$3?$1=$2 [N,QSA]
      RewriteRule ^(/[^/]+|[^/]+/|/?)$ /play/index.php [L,QSA]
    </IfModule>
  </Directory>

  <Directory @APACHE_SERVERROOT@/ampache/public/rest>
    <IfModule mod_rewrite.c>
      RewriteEngine On
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteCond %{REQUEST_FILENAME} !-s
      RewriteCond %{REQUEST_URI} !\.view$
      # some subsonic clients don't use *.view
      RewriteRule ^(.+)$ /rest/index.php?ssaction=$1 "[PT,L,QSA,B= ?,BNP]"
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteCond %{REQUEST_FILENAME} !-s
      # subsonic clients using *.view
      RewriteRule ^(.+)\.view$ /rest/index.php?ssaction=$1 "[PT,L,QSA,B= ?,BNP]"
      RewriteRule ^fake/(.+)$ /play/$1 "[PT,L,QSA,B= ?,BNP]"
    </IfModule>
  </Directory>

  <Directory @APACHE_SERVERROOT@/ampache/public/server>
    # Enable CORS headers
    <IfModule mod_headers.c>
      Header set Access-Control-Allow-Origin "*"
    </IfModule>  
  </Directory>    
  
  <Directory @APACHE_SERVERROOT@/ampache/public/templates>  
    # Apache 2.4
    <IfModule mod_authz_core.c>
	Require all denied
	<FilesMatch "\.css$|\.gif$">
		Require all granted
	</FilesMatch>
    </IfModule>
    # Apache 2.2
    <IfModule mod_access.c>
	Order deny,allow
	Deny from all
	<Files ~ "\.css$|\.gif$">
		Allow from all
	</Files>
    </IfModule>
  </Directory>
  



# Since rebuilding the database can take a long time --depending on the size
# of your MP3 archive-- you might need to increase the amount of time the 
# apache server will wait for scripts to complete.
#
# see http://httpd.apache.org/docs-2.0/mod/core.html#timeout
#
# Note that this value can only be set system wide (=apache wide). A value of 0
# disables it. The directive would look like this:
#Timeout 0
#
# However, as this timeout can only be set once (and only) globally for Apache,
# you should not set it here, but instead tweak /etc/sysconfig/apache2 and set
# it from there -- search there for the APACHE_TIMEOUT variable.


# vim: syntax=apache
openSUSE Build Service is sponsored by