Installation - Linux Source
History Key
- New content
Removed content
Recent Versions
Choose two versions to compare, or click the link to view it.
- Client and Server Requirements
- Install Apache2
- Configure Apache2 with SSL
- Install and configure PHP5
- Install and configure PostgreSQL
- Install SimpleSAMLphp
- Install the FileSender package
- Create the FileSender user and database
- Configure your FileSender installation
- Configure Cron
- Start using FileSender
- Support and Feedback
This is the installation documentation for installing FileSender 1.1(.x) on Linux. This guide is written for installation from source on the Debian Linux platform but any Linux variant should work with some modifications (most notably about installing the required additional software packages).
Debian and RPM packages are also available to automate most of the steps below. Please see Installation - Debian Ubuntu and Installation - RPM for instructions on how to get and use them. The Debian and RPM packages will install the filesender and simplesamlphp software in the /usr/share/ directory tree. In the examples below /var/www is used as base directory. Please adapt the examples below where appropriate when using the packages.
Client and Server Requirements
See Requirements.
Install Apache2
Install Apache2 from the Debian package repository:
$ apt-get install apache2
Configure Apache2 with SSL
FileSender assumes it will run on a webserver with SSL enabled, which is enforced by the ForceSSL setting in the FileSender configuration file, check Configure your FileSender installation). Get a certificate and configure your webserver with SSL. Please note that a self-signed certificate will most likely cause upload problems with Flash (most notably the "#2038 IO Error" but others have been seen). This is a Flash problem which is explained in more detail in the FAQ.
Disabling SSL means all file uploads and downloads are unprotected and any data transferred to and from your FileSender installation can be stolen. Disabling SSL is not advisable.
Install and configure PHP5
- Install PHP5 from the Debian package repository:
$ apt-get install php5 php5-cgi
- Check whether the GMP extension is enabled (it usually is):
$cat /etc/php5/conf.d/gmp.ini
# configuration for php GMP module
extension=gmp.so
- Change some PHP ini-settings to allow for larger files, longer execution times and to turn on logging. As of version 1.0.1 a sample settings file is provided in the the FileSender config directory as filesender-php.ini. This file can be stored in your /etc/php.d/ or /etc/php5/conf.d/ directory to activate those settings. Please adapt the sample settings file where needed. Alternatively you can manually edit your php.ini file:
$ gedit /etc/php5/apache2/php.ini
To allow for larger files and longer execution times you will need to edit these lines:
max_input_time(in seconds)
upload_max_filesize(in M)
post_max_size (in M)
NOTE: Remember to change filesender $config['max_flash_upload_size'] to match your upload_max_filesize.If they are not the same FileSender will use the lowest value as the actual maximum upload size for Flash uploads.
Reasonable values are:
max_input_time = 3600
upload_max_filesize = 2047M
post_max_size = 2146445312 ; 2047M + 10K
To change the temporary location for Flash uploads configure this in php.ini:
upload_tmp_dir = /your/temporarylocation
Note: that this setting is for all PHP-apps, not only for filesender.
Note: It is best to make this temporary folder location the same as your filesender $config['site_temp_filestore'].
To turn on logging configure these lines in php.ini:
log_errors = on
error_log = syslog
-
When using Suhosin,
changemakesome settings:
;(checkconfiguration/etc/php5/apache2/conf.d/suhosin.ini)for php suhosin module
- extension=suhosin.so
[suhosin]
; For Suhosin plugin versions before 0.9.33
suhosin.cookie.encrypt = off
; Needed for IE compatibility
suhosin.session.cryptua = off
; Needed for SimpleSAMLphp
suhosin.get.max_value_length = 2048
Install and configure PostgreSQL
PostgreSQL can be installed from your standard debian repository along with PostgreSQL support in PHP:
$ apt-get install postgresql php5-pgsql
FileSender uses password based database logins and by default assumes that PostgreSQL is configured to accept password based sessions on 'localhost'. You should check and when needed change the relevant settings in the PostgreSQL pg_hba.conf configuration file. This file should have the following entries with md5 listed as METHOD for local IPv4 and IPv6 connections:
# Database administrative login by UNIX sockets
local all postgres ident
# TYPE DATABASE USER CIDR-ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all ident
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5
On Debian based systems this file will be in /etc/postgresql/<version>/main/pg_hba.conf . On Red Hat/Fedora based systems this file will be in /var/lib/pgsql/data/pg_hba.conf . When changing the pg_hba.conf file you'll have to restart the database server with (version number may be different or not needed depending on your system):
$ /etc/init.d/postgresql-8.3 restart
Install SimpleSAMLphp
To set up a working SimpleSAMLphp that uses the preconfigured !OpenIdP as an authentication mechanism follow this recipe:
- Download SimpleSAMLphp 1.8.1 (note that recent Debian/Ubuntu have packages available, also the FileSender RPM and Debian repositories have SimpleSAMLphp packages).
- Some SimpleSAMLphp setups require the PHP mcrypt extension: apt-get install php-mcrypt
- Extract it into a suitable directory on your website such as /var/www/simplesamlphp-1.8.1
- Add "Alias /simplesaml /var/www/simplesamlphp-1.8.1/www" to your Apache virtual host configuration
- Copy the standard configuration files to the right places:
$ cp -r config-templates/*.php config/
$ cp -r metadata-templates/*.php metadata/
To tailor your SimpleSAMLphp installation to your local site please check its installation and configuration documentation.
When connecting to an Identity provider make sure all the required attributes are sent by the identity provider. See the section on IdP attributes in the Reference Manual for details.
By default the following attributes are set as required:
mail
eduPersonTargetedID
cn
By default FileSender uses eduPersonTargetedID for the unique identification of the user (this can be changed in the configuration). If your identity provider doesn't provide the eduPersonTargetedID attribute you can either change the attrabute uniquely identyfing a user or alternatively you can add an authproc filter to the metadata of that Identity provider to locally generate an eduPersonTargetedID attribute . See http://simplesamlphp.org/docs/1.8/core:authproc_targetedid for the details.
Install the FileSender package
- Download the FileSender software from the FileSender 1.1 download page.
- Extract the FileSender tarbal
tar zxvf /usr/local/src/filesender-1.1.tar.gzThis will create a directory 'filesender-1.1' . You can move that directory to the preferred location on your system. In this document we'll use /var/www/filesender :
mv filesender-1.1 /var/www/filesender
- Make the files, tmp and log directories writable by the web daemon user and allow the web deamon user to read the config.php configuration file:
cd /var/www/filesender
chown www-data:www-data tmp files log
chgrp www-data config/config.php
The directory structure and permissions should now be as follows, carefully check the entries marked in bold:
filesender:/var/www/filesender# ls -l config/
total 24
-rw-r----- 1 root www-data 15347 2011-01-27 18:54 config.php
filesender:/var/www/filesender# ls -al
total 100
drwxr-xr-x 11 root root 4096 2011-01-29 18:39 .
drwxr-xr-x 9 root root 4096 2011-01-29 18:56 ..
-rw-r--r-- 1 root root 10783 2011-01-29 12:37 CHANGELOG.txt
drwxr-xr-x 2 root root 4096 2011-01-29 18:39 classes
drwxr-xr-x 2 root root 4096 2011-01-29 18:39 config
drwxr-xr-x 2 root root 4096 2011-01-29 18:39 cron
drwxr-xr-x 2 www-data www-data 4096 2011-01-29 18:39 files
drwxr-xr-x 2 root root 4096 2011-01-29 18:39 includes
-rw-r--r-- 1 root root 3318 2011-01-29 12:28 INSTALL.txt
-rw-r--r-- 1 root root 1554 2011-01-14 11:33 LICENCE.txt
drwxr-xr-x 2 www-data www-data 4096 2011-01-29 18:39 log
-rw-r--r-- 1 root root 2002 2011-01-29 12:28 README.txt
drwxr-xr-x 2 root root 4096 2011-01-29 18:39 scripts
drwxr-xr-x 2 www-data www-data 4096 2011-01-29 18:39 tmp
drwxr-xr-x 6 root root 4096 2011-01-29 18:39 www
- Add an alias to your Apache virtual host configuration:
<VirtualHost *>
...
Alias /filesender /var/www/filesender/www
...
</VirtualHost>
this will make the FileSender web tree accessible through your web site. Alternatively you can simply point your DocumentRoot to /var/www/filesender/www
Create the FileSender user and database
Run the following commands in a terminal to create the PostgreSQL user and database to be used by FileSender.
Create the database user filesender without special privileges and with a password. The command will prompt you to specify and confirm a password for the new user. This is the password you need to configure in the FileSender configuration file.
$ sudo -u postgres createuser -S -D -R -P filesender
Enter password for new role: <secret>
Enter it again: <secret>
Create the filesender database with UTF8 encoding owned by the newly created filesender user:
$ sudo -u postgres createdb -E UTF8 -O filesender filesender
$ psql -h localhost filesender filesender < /var/www/filesender/scripts/filesender_db.sql
Password for user filesender: <secret>
NOTICE: CREATE TABLE will create implicit sequence "files_fileid_seq" for serial column "files.fileid"
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "files_pkey" for table "files"
CREATE TABLE
CREATE SEQUENCE
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "logs_pkey" for table "logs"
CREATE TABLE
Configure your FileSender installation
To configure your FileSender installation, edit
/var/www/filesender/config/config.php
Carefully check and adapt the following settings. The minimum required changes to config.php are marked in bold:
$config['admin'] = '';
$config['adminEmail'] = 'Your.Address@example.org';
$config['Default_TimeZone'] = 'Europe/Berlin';
$config['site_url'] = $prot . $_SERVER['SERVER_NAME'] . '/filesender/'; // URL to Filesender
$config['site_simplesamlurl'] = $prot . $_SERVER['SERVER_NAME'] . '/simplesaml/';
$config['site_filestore'] = '/var/www/filesender/files/';
$config['site_temp_filestore'] = '/var/www/filesender/tmp/';
$config['site_simplesamllocation'] = '/var/www/simplesamlphp-1.8.1/';
$config['log_location'] = '/var/www/filesender/log/';
$config['site_name'] = 'FileSender';
$config['forceSSL'] = true;
$config['pg_host'] = 'localhost'; // postgres database host
$config['pg_database'] = 'filesender'; // name of database on postgres
$config['pg_port'] = '5432'; // default port
$config['pg_username'] = 'filesender'; // username to connect to postgress database
$config['pg_password'] = '<secret>'; // password to connect to postgress database
Detailed information about the configuration settings of FileSender can be found in the Administrator reference manual
Configure Cron
Cron jobs are scheduled by setting up a "crontab." A crontab is a text file that contains the commands to be run.
Filesender uses a Cron job to remove files that have expired and close any vouchers that have expired.
Typically you would run the Cron job every night at a set time. Note that the Debian and RPM packages will install the required cronjob for you.
To edit a crontab through the command line, type:
crontab -e
Add the following line:
0 0 * * * php -q /var/www/filesender/cron/cron.php
This will run your cron page nightly at midnight.
Start using FileSender
https://yoursite/filesender/
Support and Feedback
See Support and Mailinglists and Feature requests.