Safe PHPMyAdmin on Ubuntu Server

Today I reached the task to make the PHPMyAdmin install secure on one of my Ubuntu servers.

The machine is running Ubuntu Server 12.10, but you can follow this article also for Ubuntu 13.04 and newer.

Since a web multi-domain server is running on it, my idea is:

  • Have only one third level to reach PHPMyAdmin: pma1.mydomain.ltd
  • Remove /phpmyadmin from every domain.
  • Additional security is provided by http authentication.

Continue reading →

How to replace Sendmail with Gmail smtp on Ubuntu server

Today my goal was to be able to send mails from PHP from my web-server using Gmail smtp.

  1. My server runs on Apache with vhosts: I need a separate mailbox for every domain.
  2. I don’ want to manage a MTA because it’s resource and time expensive, so I want to send mails trough a Gmail account.
  3. I want the system to be fast and easy to maintain.

The standard packages such as postfix, sendmail, qmail etc doesn’t meet the last two requirements, so I had to choose an alternative to postfix: MSMTP

Continue reading →