Install Linux + server (Nginx + Apache) + PostgreSQL + PHP on VirtualBox (Ubuntu Server ??? LTS)

On the Internet, I have not found a single recipe for installing and configuring such a rather non-standard server. I decided to write my own recipe.
The working principle is as follows:
Install Linux + server (Nginx + Apache) + PostgreSQL + PHP on VirtualBox (Ubuntu Server ??? LTS)
Static data (files) are given by Nginx, and the dynamics is handled by Apache. VirtualBox
Ubuntu Server ??? LTS (LTS - Long Time Support)

Install VirtualBox

Run the VirtualBox installer.

Settings will ...[/h]

Custom aggregate and window functions in PostgreSQL and Oracle

In this article, we'll see how to create custom aggregate and windowed (in Oracle terminology - analytical) functions in two systems. Despite the differences in the syntax and, in general, the approach to extensibility, the mechanism of these functions is very similar. But there are differences too.
It must be admitted that its own aggregate and window functions are quite rare. Window functions generally for some reason are traditionally classified as "advanced" SQL and are considered difficult to understand and master. Here we should deal with those functions that already exist in the DBMS!
Why, th...

Configuring the bundle proftpd + {mysql /postgresql} with storing passwords in md5 + salt

For a long time to me did not give rest the fact that passwords of users at me in a DB are stored in an open kind. It was also very inconvenient to manually add /remove users and change their passwords.
As a result, I configured the bundle proftpd + mod_sql + mod_sql_passwd with the storage of passwords in the form md5 + salt, and also wrote three scripts to add, delete and change the users password.
In view of the fact that on different servers I use somewhere PostgreSQL, and somewhere MySQL, I spread the description of the settings for both DBMS.
The servers are running ALT Linux ...

Asynchronous work with PostgreSQL in C

Today, I wanted to write a short note on asynchronous work with PostgreSQL in C. The motives are simple: for a small utility, there was a need to implement such functionality, Google made no secret of clear and working examples (there was only an example in pqxx for C ++ - there is an asynchronous connection method and a pipeline -class for queries), and the official documentation on this issue, though very detailed, but not too structured, and the algorithm itself working with the libpq library in asynchronous mode has many pitfalls. Therefore, having understood the question, I want to share the ...