Install AjaXplorer with SSL on Debian 7

AjaXplorer file sharing platform

AjaXplorer file sharing platform

Update 2015-08-15: This article is now outdated. The Pydio website now contains accurate Pydio 6 configuration at https://pyd.io/nginx/.

AjaXplorer (now rebranded Pydio) is a nifty web file sharing platform that can be used as a personal cloud.

It offers a Desktop Client now in beta but it seems promising.

Install required packages

Add the package repositories to /etc/apt/sources.list

deb http://dl.ajaxplorer.info/repos/apt stable main
deb-src http://dl.ajaxplorer.info/repos/apt stable main

Then in the command shell:

wget -O - http://dl.ajaxplorer.info/repos/[email protected] | apt-key add -
apt-get update
apt-get install ajaxplorer mysql-server apache2 php5 php5-mysql

Create a database

In a MySQL shell started with mysql -p

CREATE DATABASE ajaxplorerdb;
GRANT ALL PRIVILEGES ON ajaxplorerdb.* TO "ajaxplorerdb"@"localhost" IDENTIFIED BY "longandrandompassword";
FLUSH PRIVILEGES;
EXIT;

Create SSL certificates

openssl req -x509 -nodes -days 365 -newkey rsa:2048 -out /etc/ssl/localcerts/ajaxplorer.pem  -keyout /etc/ssl/localcerts/ajaxplorer.key

Adjust the PHP configuration

AjaXplorer recommends to disable the output buffering of PHP for improved performances.

In /etc/php5/apache2/php.ini find this line:

output_buffering = 4096

And replace it by:

output_buffering = Off

Note that in the default configuration, this line appears twice, once commented, once not commented!

Create Apache configuration files

Create the VirtualHost for ajaxplorer:

/etc/apache2/sites-available/ajaxplorer.vhost

<VirtualHost *:443>

ServerAdmin [email protected]
ServerName ajaxplorer.domain.com

SSLEngine on
SSLCertificateFile /etc/ssl/localcerts/ajaxplorer.pem
SSLCertificateKeyFile /etc/ssl/localcerts/ajaxplorer.key

DocumentRoot /usr/share/ajaxplorer
<Directory "/usr/share/ajaxplorer">
Options FollowSymLinks
AllowOverride Limit FileInfo
Order allow,deny
Allow from all
</Directory>

ErrorLog ${APACHE_LOG_DIR}/ajaxplorer_error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog ${APACHE_LOG_DIR}/ajaxplorer_access.log combined
</VirtualHost>

Create a redirection from unsecured to secured connection:

/etc/apache2/sites-available/ajaxplorer-redirect.vhost

<virtualhost *:80>
ServerName ajaxplorer.domain.com
KeepAlive Off

RewriteEngine On
#RewriteCond %{HTTP_HOST} ^[^\./]+\.[^\./]+$
RewriteRule ^/(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
</virtualhost>
Note that you can actually merge the 2 Apache configuration file into a single file if you find it more convenient.

Activate Apache configuration

In order for the secure connection to work, you will need to disable disable the default VirtualHost with rm /etc/apache/sites-enabled/000-default. Thanks to anerDev for noticing.
a2enmod rewrite
a2enmod ssl
a2ensite ajaxplorer.vhost
a2ensite ajaxplorer-redirect.vhost
service apache2 restart

Browse your server and follow the installation steps.

Note that the default locations for file storage is in /var/lib/ajaxplorer/data/

2 Comments

  1. anerDev February 21, 2014 9:04 am  Reply

    Good tutorial !
    So, you can create only one single v.host. And remove the 000-default site, or don’t work the redirect.

    • Martin DENIZET February 21, 2014 1:13 pm  Reply

      Yes, good point, if you keep the 000-default the redirect won’t work, you can delelte it with
      rm /etc/apache/sites-enabled/000-default
      I will update the article.
      For the single v.host, yes, if you prefer you can create only only. I took the habit of creating one file per VirtualHost instruction for clarity working with other people.
      Cheers

Leave a Reply