How to Install Seafile cloud storage in Ubuntu 14.04 server

Seafile cloud storage

1. Introduction

Seafile is a free and open source cloud storage software system. It acts as a central server for storing files and synchronize the data with multiple computers and mobile devices using the seafile client. It allows users to assemble files into libraries and these libraries can be shared among the users as well as groups. Also it provides advanced support for privacy protection and teamwork. This article will help you to install Seafile on Ubuntu server.

2. Prerequisites

Operating System must be Ubuntu 14.04 LTS
Linux server with a valid hostname, 2GB RAM
LAMP must be installed

3. Install all Dependency Softwares for Seafile

First, you need to update the system to make sure that all softwares are updated.

# apt-get update
# apt-get upgrade

Then install the following required dependencies:

Java Runtime Environment (JRE)

# apt-get install openjdk-7-jre

Install poppler-utils

# apt-get install poppler-utils

Install Python and its libraries

# apt-get install libpython2.7  python-simplejson python-setuptools python-imaging python-mysqldb
# easy_install pip
# pip install boto

4. Install Seafile

You need to download the latest stable version of Seafile and extract it using the below commands. It is important to choose the package as per your system architecture. The downloaded seafile package here is that of 32 bit system.

# cd /usr/local/src
# wget
# tar -xzf seafile-server_5.0.4_i386.tar.gz
# cd seafile-server-5.0.4/

5. Configure Seafile

Here you have to run the following script to check whether your server meets all requirements.

# ./

Since we have already installed all system requirements, you just press the Enter key to continue. Next you will be prompted to enter several information like server name, IP address, default port, create MySQL database etc for configuring seafile in the server. You should enter the server name and IP address that you have set up for your server. When you answer the questions which are related to default values, it is always good to press the “enter” key to accept the values.

Some examples are shown below :

What is the name of the server? It will be displayed on the client.
3 - 15 letters or digits
[ server name ]

What is the ip or domain of the server?
For example:,
[ This server's ip or domain ]

Where do you want to put your seafile data?
Please use a volume with enough free space
[ default "/usr/local/src/seafile-data" ]

Which port do you want to use for the seafile fileserver?
[ default "8082" ]

After all the required information are entered you will get the summary of your configuration. Finally press enter for saving the configuration.

You will get the following message after saving the configuration.

Your seafile server configuration has been finished successfully.

run seafile server:     ./ { start | stop | restart }
run seahub  server:     ./  { start  | stop | restart  }

6. Start Seafile and seahub services

First you need to start the seafile service, which controls the file transfer and data sharing function.

# ./ start

Next you need to start the seahub servcie. It provides the web interface to interact with seafile.

# ./ start

Since the Seahub server is started for the first time, you will need to create the admin account.

What is the email for the admin account?
[ admin email ]

What is the password for the admin account?
[ admin password ]

Enter the password again:
[ admin password again ]

Successfully created seafile admin

7. Seafile Web Interface

Seahub is Seafile server package which contains Python HTTP server. Once the Seahub server is started, you can access Seafile via http://your domain or IP:8000 and then login with the admin account and password that was created on the configuration time. After login to the page, you can create and manage your files, contacts, groups, libraries, etc.

How to install Apache Thrift on Ubuntu 14.04

1. Introduction

Apache Thrift is just a software framework written in C++. It was initially developed in 2007 by Facebook but now it is an Open Source project in Apache Software Foundation (ASF). The RPC is Remote Procedure Call is a type of protocol, requesting a service from one server to another server in a network using programs. Tt does not need any kind of network details for the whole process. In this article, We are going to install Apache Thrift.

Install all the dependencies

# apt-get install libboost-dev libboost-test-dev libboost-program-options-dev libboost-system-dev libboost-filesystem-dev libevent-dev automake libtool flex bison pkg-config g++ libssl-dev ant

2. Install Java JDK

Check whether the Java JDK package is installed or not. You may use the below command to verify :

# java --version

If the Java JDK is not installed. Please the command to install Java JDK :

# apt-get install openjdk-7-jre 
# apt-get install openjdk-7-jdk

Thus we have completed installing the dependencies.

3. Installation

Download the latest version of Apache Thrift from there official site in to your local directory :


Extract the tar file :

# tar -xvf thrift-0.9.3.tar.gz

Now install thirift folder :

# cd thrift-0.9.3/
# ./configure
thrift 0.9.3

Building C++ Library ......... : yes
Building C (GLib) Library .... : no
Building Java Library ........ : yes
Building C# Library .......... : no
Building Python Library ...... : no
Building Ruby Library ........ : no
Building Haxe Library ........ : no
Building Haskell Library ..... : no
Building Perl Library ........ : no
Building PHP Library ......... : no
Building Erlang Library ...... : no
Building Go Library .......... : no
Building D Library ........... : no
Building NodeJS Library ...... : no
Building Lua Library ......... : no

C++ Library:
   Build TZlibTransport ...... : yes
   Build TNonblockingServer .. : yes
   Build TQTcpServer (Qt4) .... : no
   Build TQTcpServer (Qt5) .... : no

Java Library:
   Using javac ............... : javac
   Using java ................ : java
   Using ant ................. : /usr/bin/ant

# make 
# make install

Thus the installation process is completed. We can verify the installation using the command below :

# thrift -version
Thrift version 0.9.3

4. Conclusion

Thus we have completed the installation of Apache Thrift.

How to install Nginx as Reverse Proxy in front of Apache on Ubuntu 15.10

1.0 Introduction

Nginx or “engine-x” is a high-performance web server with low memory usage, created by Igor Sysoev in 2002. Nginx is not just a web server, it can be used as a reverse proxy for many protocols like HTTP, HTTPS, POP3, SMTP, and IMAP and as a load balancer and HTTP cache as well.

In this tutorial, I will install and configure Nginx as a caching reverse proxy for an Apache web server on Ubuntu 15.10, Nginx is used as the front end and Apache as the back end. Nginx will run on port 80 to respond to requests from a user/browser, the request will then be forwarded to the apache server that is running on port 8080.

2.0 Install Apache and PHP

Log in to your ubuntu server as a root user.

Before install the package you have to update the apt cache using “apt-get”

#apt-get update

Then install apache with the apt-get command.

# apt-get install apache2

Once apache is installed, we must install PHP.

# apt-get install php5 php5-mysql libapache2-mod-php5

3.0 Configure Apache and PHP

By default, apache listens on port 80. We have to configure apache to run on port 8080 for our proxy setup as port 80 will be used by nginx later. We have to edit the apache configuration file “/etc/apache2/ports.conf”. And then proceed with the virtual host configuration in the “/etc/apache2/sites-available/” directory.

First change the port for apache to 8080 by editing the file “ports.conf” with the vim editor.

#vim /etc/apache2/ports.conf

On line 5, change port 80 to 8080 as follows.

Listen 8080

Now go to the virtualhost directory and edit the file “000-default.conf”.

   #cd sites-available/
   #vim 000-default.conf

Make sure your configuration is same as below



    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

Test the configuration and restart apache

  #apachectl configtest
  #systemctl restart apache2

Create a new file with the name “info.php” in the directory “/var/www/html/” with the following content

  #cd /var/www/html/
  #echo "" > info.php

Visit your site in browser


4.0 Install Nginx

Install Nginx with the following apt-get command

#apt-get install nginx

5.0 Configure Nginx

Once Nginx is installed, configure Nginx to act as reverse proxy for the apache web server that running on port 8080.
Go to the nginx configuration directory and edit the file “nginx.conf”.

  #cd /etc/nginx/
  #vim nginx.conf

Enable Gzip compression for Nginx by uncomment the gzip lines.

        # Gzip Settings
       gzip on;
        gzip_disable "msie6";
        gzip_vary on;
        gzip_proxied any;
        gzip_comp_level 6;
        gzip_buffers 16 8k;
        gzip_http_version 1.1;
        gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

The most important is :

  • gzip on : to turn gzip compression.
  • gzip_types : is list of MIME-types which you want to turn the compression.
  • gzip_proxied any : is enable compression for proxied request.

Right under gzip settings, add these proxy cache settings:

 # Proxy Cache Settings
 proxy_cache_path /var/cache levels=1:2 keys_zone=reverse_cache:60m inactive=90m max_size=1000m;

Now we will configure a virtualhost in the directory “/etc/nginx/sites-available”

New virtualhost configuration file named “reverse.conf”.

   #cd /etc/nginx/sites-available
   #vim reverse.conf

Paste the configuration below:

   server {
    listen 80;

    # Site Directory same in the apache virtualhost configuration
    root /var/www/html; 
    index index.php index.html index.htm;

    # Domain

    location / {
        try_files $uri $uri/ /index.php;

    # Reverse Proxy and Proxy Cache Configuration
    location ~ \.php$ {
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_set_header Host $host;

        # Cache configuration
        proxy_cache reverse_cache;
        proxy_cache_valid 3s;
        proxy_no_cache $cookie_PHPSESSID;
        proxy_cache_bypass $cookie_PHPSESSID;
        proxy_cache_key "$scheme$host$request_uri";
        add_header X-Cache $upstream_cache_status;

    # Enable Cache the file 30 days
    location ~* .(jpg|png|gif|jpeg|css|mp3|wav|swf|mov|doc|pdf|xls|ppt|docx|pptx|xlsx)$ {
        proxy_cache_valid 200 120m;
        expires 30d;
        proxy_cache reverse_cache;
        access_log off;

    # Disable Cache for the file type html, json
    location ~* .(?:manifest|appcache|html?|xml|json)$ {
        expires -1;

    location ~ /\.ht {
        deny all;

Take backup the “default” configuration file from “/etc/nginx/sites-available” directory.

  #mv default default.bak

Then activate the new virtualhost configuration.

#ln -s /etc/nginx/sites-available/reverse.conf /etc/nginx/sites-enabled/

Test the nginx configuration and restart nginx.

  #nginx -t
  #systemctl restart nginx

6.0 Configure Logging

In this step, I will configure apache to log the real ip of the visitor instead of the local IP. Install the apache module “libapache2-mod-rpaf” and edit the module configuration file.

   #apt-get install libapache2-mod-rpaf
   #cd /etc/apache2/mods-available/
   #vim rpaf.conf

Add the server IP to the line 10.

  RPAFproxy_ips ::1

Restart apache

   #systemctl restart apache2

Test rpaf by viewing the apache access log with the tail command

#tail -f /var/log/apache2/access.log

How to install and configure LAMP ( Linux, Apache, MySQL and PHP ) in Ubuntu 14.04

1. Introduction

Short for Linux, Apache, MySQL and PHP, an open-source Web development platform, also called a Web stack, that uses Linux as the operating system, Apache as the Web server, MySQL as the RDBMS and PHP as the object-oriented scripting language. Perl or Python is often substituted for PHP.

2. Requirements

An ordinary server with Ubuntu 14.04 LTS installed. You can install it on any platform, but here the documentations are based on the Ubuntu / debian server.

3. Installation

Please proceed with the following steps:

3.1 Apache2 Installation

Type the below command for installing apache 2 package from repository.

#  apt-get install apache2

Restart apache service

# /etc/init.d/apache2 restart

Apache will start working with minimal configuration. Now Open your server-ip in the browser and You can see the apache ubuntu test page.( Default document root is located in this path /var/www/html )

apache3 ubuntu default

3.2 MySQL installation

Issue the below command to install mysql server with dependencies.

# apt-get install mysql-server

During installation it will prompt for a new password for mysql root . Give some strong password and retype the same password for confirmation.

After installation check the Database connection.

Check the service status.

# /etc/init.d/mysql status

Service is already up , Now Type this command to login

# mysql -u root -p

Enter password: ******
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 42
Server version: 5.5.35-1ubuntu1 (Ubuntu)
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.

Mysql server installation is over.

3.3 PHP installation

Type the below command to install php5.

# apt-get install php5 php5-mysql

Create a php file and paste the below code into the file to show the php configuration . Goto the default apache root path /var/www/html . create a new file info.php and paste the below code and save it.

# vi /var/www/html/info.php

Please use the following codes to create a phpinfo page.


Now restart the apache2 service.

# /etc/init.d/apache2 restart

Now open the file in the browser ( Eg: http://yourip/info.php ) you can see the php information page as below.
Make sure you can see the mysql details in the php information page.

ubuntu phpinfo

We have successfully configured Apache2 , mysql and php.