Skip to content
This repository has been archived by the owner on Jul 31, 2023. It is now read-only.

Webservers

Rainer Volz edited this page Jul 28, 2018 · 10 revisions

BicBucStriim comes with a .htaccess file, a configuration for the Apache web server. This configuration is included because most NAS devices include a LAMP environment, and so the app can easily be installed. However, there are other web servers, and BicBucStriim doesn't require you to use Apache.

This section contains usage examples with different web servers or environments.

Security, please read!

Please be aware that the hints and recipes below are not full solutions. Some aspects, like security, are not mentioned, because they depend on the use case. If used in a public environment a BicBucStriim installation must be secured like other web applications.

Especially the internal database data/data.db should be secured against external downloads!

Apache on Raspberry Pi

This example assumes that you are using the standard Raspbian Wheezy distribution. Raspian is derived from Debian, so this example applies also to Debian, Ubuntu etc.

  1. Install Apache: sudo apt-get install apache2. (Note: This will also install the required sqlite3 library.)
  2. Install PHP: sudo apt-get install php5 php5-sqlite php5-gd. Install PHP 5.2+, the Sqlite3 support to read the Calibre metadata and the GD library to generate thumbnails.
  3. Enable URL Rewriting for Apache: sudo a2enmod rewrite
  4. Enable the usage of htaccess files (BucBucStriim incudes one):
    1. sudo nano /etc/apache2/sites-available/default
    2. In section <Directory /var/www> change 'AllowOverride NonetoAllowOverride All`.

The web server root directory is /var/www, so BicBucStriim should be installed there, using the usual process.

Lighttpd on Raspberry Pi

This example assumes that you are using the standard Raspbian Wheezy distribution. Raspian is derived from Debian, so this example applies also to Debian, Ubuntu etc.

  1. Install Lighttpd and Sqlite3: sudo apt-get install lighttpd sqlite3
  2. Install PHP: sudo apt-get install php5-common php5-cgi php5 php5-sqlite php5-gd. Install PHP 5.2+, the Sqlite3 support to read the Calibre metadata and the GD library to generate thumbnails.
  3. Enable the server to handle PHP scripts: sudo lighty-enable-mod fastcgi-php
  4. Add URL Rewriting for BicBucStriim:
    1. sudo nano /etc/lighttpd/lighttpd.conf
    2. Add the following lines at the end: url.rewrite-once = ("^/bbs/(?!(style|img|js|installcheck.php)).*$" => "/bbs/index.php/$1")
    3. Check that server.modules includes mod_redirect, if not add it.
  5. Reload the server: sudo service lighttpd force-reload

The web server root directory is /var/www, so BicBucStriim should be installed there, using the usual process.

Check Running a lightweight webserver on the Raspberry Pi (lighttpd) for more information about Lighttpd on the Raspberry Pi.

Ngnix on Raspberry Pi

This example assumes that you are using the standard Raspbian Wheezy distribution. Raspian is derived from Debian, so this example applies also to Debian, Ubuntu etc.

  1. Install Nginx and Sqlite3: sudo apt-get install nginx sqlite3
  2. Install PHP: sudo apt-get install php5-common php5-cgi php5 php5-sqlite php5-gd. Install PHP 5.2+, the Sqlite3 support to read the Calibre metadata and the GD library to generate thumbnails.
  3. Add URL Rewriting for BicBucStriim:
    1. sudo nano /etc/nginx/sites-available/default
    2. Change the root directory: root /var/www
    3. Add URL Rewriting for BucBucStriim, see below
  4. Reload the server: sudo service nginx reload

A simple configuration for URL rewriting is:

location /bbs/ {
                rewrite ^/(bbs/img/.*)$ /$1 break;
                rewrite ^/(bbs/js/.*)$ /$1 break;
                rewrite ^/(bbs/style/.*)$ /$1 break;
                rewrite ^/bbs/$ /bbs/index.php last;
                rewrite ^/bbs/(admin|authors|authorslist|login|logout|metadata|search|series|serieslist|tags|tagslist|titles|titleslist|opds)/.*$ /bbs/index.php last;
 }

The web server root directory is /var/www, so BicBucStriim should be installed there, using the usual process.

Check this discussion for more information on installing Ngnix on the Raspberry Pi.

IIS

IIS configuration provided by @nachtfever, see here:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
    <security>
      <requestFiltering allowDoubleEscaping="True" />
    </security>
        <rewrite>
            <rules>
                <rule name="slim" patternSyntax="Wildcard">
                    <match url="*" />
                    <conditions>
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                    </conditions>
                    <action type="Rewrite" url="index.php" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>
Clone this wiki locally