Install the latest Apache SOLR Build in a few minutes on Ubuntu/Debian

First install a Java runtime and needed utilities: apt-get update apt-get install openjdk-7-jre openjdk-7-jre-headless openjdk-7-jre-lib unzip lsof Then execute these as root: cd ~ wget http://www.eu.apache.org/dist/lucene/solr/5.5.4/solr-5.5.4.tgz tar xzf solr-5.3.1.tgz solr-5.3.1/bin/install_solr_service.sh –strip-components=2 chmod +x install_solr_service.sh ./install_solr_service.sh solr-5.3.1.tgz Finally start Solr: service solr start You should now be able to access your server like this: http://localhost:8983/solr You might want to adjust 5.5.4 to the latest available version – have a look here.

Sync file changes recursively to a remote host using lsyncd

First install lsyncd, on Ubuntu/Debian just like this: sudo apt-get update sudo apt-get install lsyncd There are some needed folders that are not automatically created: mkdir -p /etc/lsyncd /var/log/lsyncd Now let's take a sample file and copy it to /etc/lsyncd/lsyncd.conf.lua where lsyncd will automatically pick it up: cp /usr/share/doc/lsyncd/examples/lrsyncssh.lua /etc/lsyncd/lsyncd.conf.lua Here's a sample configuration: settings {         logfile = "/var/log/lsyncd/lsyncd.log",         statusFile = "/var/log/lsyncd/lsyncd.status" } sync {     Read more…

Mail Server with SSL/TLS built on Dovecot and Postfix using MySQL backend

Install needed packages: apt-get install postfix postfix-mysql dovecot-core dovecot-imapd dovecot-lmtpd dovecot-mysql dovecot-sieve dovecot-managesieved mysql-server-5.6 postfix postfix-mysql During the Postfix install, choose "Internet Smarthost" and leave the values at their defaults, we will replace the configuration later. Create database: Connect to the mysql console using root and execute these: CREATE DATABASE mailserver; USE mailserver; CREATE TABLE `virtual_domains` ( `id` INT NOT NULL AUTO_INCREMENT, `name` VARCHAR(50) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE `virtual_users` Read more…

Setting up mysql replication to Amazon RDS

If you want to set up a replication between an RDS and an existing mysql server environment, you might encounter privilege errors, when trying to execute commands like "change master to…" or "stop slave;" on the RDS. Amazon RDS comes with a bunch of stored procedures that you have to use instead: MySQL Command Stored Procedure change master to mysql.rds_set_external_master start slave mysql.rds_start_replication stop slave mysql.rds_stop_replication reset master mysql.rds_reset_external_master Changing master host example: CALL mysql.rds_set_external_master ('111.222.333.4', Read more…

Create Secure FTP Jails with OpenSSH on Debian/Ubuntu

If you don't have already OpenSSH-Server on your machine and you're connected probably via SSH, then we need to install it: apt-get update apt-get install openssh-server Next we modify the file /etc/ssh/sshd_config: Comment out the following line by prepending a #: Subsystem sftp /usr/lib/openssh/sftp-server And in the same file add this block right at the end: Subsystem sftp internal-sftp Match group ftpaccess ChrootDirectory %h X11Forwarding no AllowTcpForwarding no ForceCommand internal-sftp The group ftpaccess in the above Read more…

Creating a Glusterfs volume replicated across 2 hosts

This worked perfectly on Ubuntu 14.04, but should work just the same on other Ubuntu or Debian-based distributions.  First of all, install glusterfs on both hosts: apt-get install glusterfs-server I suggest, for simplicity to but the 2 hostnames in /etc/hosts on each server, for example: 192.168.18.11 srv01 192.168.18.12 srv02 I'm going to use those hostnames in the commands below. Let's connect the 2 hosts. Execute this on the first host for example: gluster peer probe Read more…

Installing RatticWeb on Ubuntu 14.04

First a few prerequesites: apt-get update apt-get install git libxslt-dev libxml2-dev libldap2-dev libsasl2-dev libmysqlclient-dev python-dev python-virtualenv Create a virtual environment and run the actual installation: mkdir ~/venv/RatticWeb mkdir -p ~/venv/RatticWeb virtualenv ~/venv/RatticWeb source ~/venv/RatticWeb/bin/activate git clone https://github.com/tildaslash/RatticWeb.git cd RatticWeb/ pip install -r requirements-mysql.txt -r requirements-dev.txt cat > conf/local.cfg <<EOF [ratticweb] secretkey = [ENTER SOMETHING RANDOM HERE] debug = true [filepaths] help = ../RatticWeb.wiki EOF Finally bring the database up2date and start the server: ./manage.py syncdb Read more…

Install Haproxy 1.5 as transparent loadbalancer for http and https on Ubuntu Trusty

I've been searching and testing this quite a while until I had a working setup. There are a lot of articles out there, but here is a solution that has worked for me. First install haproxy 1.5: apt-add-repository ppa:vbernat/haproxy-1.5 apt-get update apt-get install haproxy It is important that you use at least version 1.5 of haproxy! First of all edit /etc/default/haproxy and change the line ENABLED=1. You also may want to change some flags, for example to give Read more…