-
Notifications
You must be signed in to change notification settings - Fork 72
Webservers
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.
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!
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.
- Install Apache:
sudo apt-get install apache2
. (Note: This will also install the requiredsqlite3
library.) - 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. - Enable URL Rewriting for Apache:
sudo a2enmod rewrite
- Enable the usage of htaccess files (BucBucStriim incudes one):
sudo nano /etc/apache2/sites-available/default
- In section
<Directory /var/www>
change 'AllowOverride Noneto
AllowOverride All`.
The web server root directory is /var/www
, so BicBucStriim should be installed there, using the usual process.
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.
- Install Lighttpd and Sqlite3:
sudo apt-get install lighttpd sqlite3
- 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. - Enable the server to handle PHP scripts:
sudo lighty-enable-mod fastcgi-php
- Add URL Rewriting for BicBucStriim:
sudo nano /etc/lighttpd/lighttpd.conf
- Add the following lines at the end:
url.rewrite-once = ("^/bbs/(?!(style|img|js|installcheck.php)).*$" => "/bbs/index.php/$1")
- Check that
server.modules
includesmod_redirect
, if not add it.
- 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.
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.
- Install Nginx and Sqlite3:
sudo apt-get install nginx sqlite3
- 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. - Add URL Rewriting for BicBucStriim:
sudo nano /etc/nginx/sites-available/default
- Change the root directory:
root /var/www
- Add URL Rewriting for BucBucStriim, see below
- 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 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>