Configure Apache With Self-Signed TLS/SSL Certificate on Ubuntu 16.04

Step 1: Generating the certificate

First, let’s create a place to store the file.

mkdir ~/certificates
cd ~/certificates

Generate CSR and private key.

openssl req -x509 -newkey rsa:4096 -keyout apache.key -out apache.crt -days 365 -nodes

It will ask for information for the certificate request. Complete with the appropriate information.

Country Name (2 letter code) [AU]: US
State or Province Name (full name) [Some-State]: FL
Locality Name (eg, city) []: Miami
Organization Name (eg, company) [My Company]: My Company
Organizational Unit Name (eg, section) []:

Common name should be your domain name or the server’s IP address. Also, fill in your email.

Read more

Share

Upgrade PHP version to 7.2 from 7.0 on Ubuntu 16.04

Check your PHP version installed

Before we start, we can simply type the following command to check the existing PHP version installed on the server.

$ php -v

If you installed Ubuntu 16.04 LTS, you will get PHP 7.0.30 installed on your server by running installation script from VestaCP. In this tutorial, we will upgrade our PHP version to 7.2 to enjoy more features and bug fixes.

Check your PHP modules installed

To check installed PHP modules in Ubuntu, type the following command (as Ubuntu makes PHP modules available via packages):

$ dpkg — get-selections | grep -v deinstall | grep php7.0

Remember mark installed modules list, as you need to install them again after upgraded to PHP 7.2. We don’t need to install mcrypt as it has been dropped from PHP 7.2.

In this tutorial, we need to install those modules again:

Read more

Share

Install and setup Plex Media Server Ubuntu 16.04

Plex is a free feature-rich media library platform that provides a way to store all your movies, shows, and other media in one place. You can access Plex from any device, whether you’re at home or on-the-go. There are many different media tools available in the world like, Kodi, Xmbc, OSMC and Mediatomb, but the Plex Media Server is perhaps one of the most popular solutions for managing media. Plex runs on Windows, macOS, Linux, FreeBSD and many more. Plex is a client-server media player system made up from two main components, 1) The Plex Media Server, which organizes music, photos and videos content from personal media libraries and streams it to their player, 2) The Players that can be the Plex web UI, Plex Apps or Plex home theater. Plex Media Server supports Chromecast, Amazon FireTV, Android, iOS, Xbox, PlayStation, Apple TV, Roku, Android TV and various types of smart TVs. If you are looking for a way to watch your movies from anywhere, then Plex is best choice for you.

In this tutorial, we will learn how to install and configure Plex Media Server on Ubuntu 16.04.

Requirements

  • A server running Ubuntu 16.04.
  • A not-root user with sudo privileges setup on your server.
  • A static IP address 192.168.0.227 setup on your server.

Getting Started
Before starting, make sure your system is fully up to date by running the following command:

sudo apt-get update -y
sudo apt-get upgrade -y

Once your system is updated, restart your system to apply all these changes with the following command:

sudo reboot

After restarting, log in with sudo user and proceed to the next step.

Read more

Share

Install CakePHP 3 On Ubuntu 16.04

This guide assumes you’ve set up a Ubuntu 14.04 server and have MYSQL up and running. This guide uses the “PHPMyAdmin” from the “One Click Apps” available on Digital Ocean running on a vps running Ubuntu 16.04. The smallest memory (512mb) should be enough to get you up and running.

If you don’t have a Digital Ocean account (you should, they’re a great service) get one here.

Step 1: Update Package Manager

ssh root@YOUR-IP

Note: If this is the first time you’ve logged into your vps, you will be asked to change the password from the one emailed to you when you created your vps. This is fairly self explanatory, simply follow the prompts.

Update your package manager:

sudo apt-get update

Step 2: Install Some PHP Modules

We need to install a few PHP modules that CakePHP uses. Namely the curl, zip, intl and sqlite modules.

Read more

Share

LAMP on Ubuntu 16.04 using Tasksel

Quick Install Using Tasksel

Instead of installing Apache, MySQL, and PHP separately, tasksel offers a convenient way to get a LAMP stack running quickly. Install tasksel if not already installed by default.

sudo apt install tasksel

Use tasksel to install the LAMP stack.

sudo tasksel install lamp-server

Enter the prompt for a MySQL root password.

Share

Install Mailtrain Mail Marketer Software on Ubuntu 16.04 – Auto Installation

Mailtrain is a self hosted newsletter application built on Node.js (v5+) and MySQL (v5.5+ or MariaDB). Mailtrain supports subscriber list management, list segmentation, custom fields, email templates, large CSV list import files, etc.

Requirements

  • Nodejs v5+
  • MySQL v5.5 or MariaDB
  • Redis (optional, disabled by default, used only for session storage)

Automatic installation on Ubuntu 16.04
You can download and run install.sh in your blank Ubuntu VPS to set up. Mailtrain and all required dependencies (including MySQL). The installation script assumes a somewhat blank server, so if this is a machine you are already using for something else, you might want to skip the automatic install and proceed manually.

If you like living on the edge and feel adventurous you can run the installation script directly from your command line as root:

curl https://raw.githubusercontent.com/andris9/mailtrain/master/setup/install.sh | sudo bash

Install script installs and sets up the following:

  • Node.js (version 6.x)
  • MariaDB (the default version from apt-get)
  • Mailtrain (from the master branch) on port 80
  • UFW firewall that blocks everything besides ports 22, 25, 80, 443
  • ZoneMTA to queue and deliver messages (NB! using ZoneMTA assumes that outgoing port 25 is open which might not be the case on some hosts like on the Google Cloud)Redis server for session cache
  • logrotate to rotate Mailtrain log files
  • upstart or systemd init script to automatically start and manage Mailtrain process

After the install script has finished and you see a success message then you should have a Mailtrain instance running at http://yourdomain.com

Next steps after installation

1. Change admin password
Navigate to http://yourdomain.com where yourdomain.com is the address of your server. Click on the Sign In link in the right top corner of the page. Authenticate with the following credentials:

Username: admin
Password: test
Once authenticated, click on your username in the right top corner of the page and select “Account”. Now you should be able to change your default password.

2. Update page configuration
If signed in navigate to http://yourdomain.com/settings and check that all email addresses and domain names are correct. Mailtrain default installation comes bundled with ZoneMTA, so you should be able to send out messages right away. ZoneMTA even handles a lot of bounces (not all kind of bounces though) automatically so you do not have to change anything in the SMTP settings to get going.

3. Set up SPF
If you are using the bundled ZoneMTA then you need to add your Mailtrain host to the SPF DNS record of your sending domain. So if you are sending messages as “info@example.com” then the domain “example.com” should have a SPF DNS record that points to the IP address or hostname of your Mailtrain host. Everything should work without the SPF record but setting it up correctly improves the deliverability a lot.

4. Set up DKIM
If you are using the bundled ZoneMTA then you can provide a DKIM key to sign all outgoing messages. You can provide the DKIM private key in Mailtrain Settings page. This key is only used by ZoneMTA, so if you are using some other provider then you check your providers’ documentation to see how to set up DKIM. In case of ZoneMTA you only need to open Mailtrain Settings page, scroll to DKIM config section and fill the fields for DKIM selector and DKIM private key. Everything should work without the DKIM signatures but setting it up correctly improves the deliverability a lot.

5. Set up VERP
The bundled ZoneMTA can already handle a large amount of bounces if you use it to deliver messages but not all – namely such bounces that happen after the recipient MX accepts the message for local delivery. This might happen for example when a user exists, so the MX accepts the message but the quota for that user is checked only when actually storing the message to users’ mailbox. Then a bounce message is generated and sent to the original sender which in your case is the mail address you are sending your list messages from. You can catch these messages and mark such recipients manually as bounced but alternatively you can set up a VERP based bounce handler that does this automatically. In this case the sender on the message envelope would not be your actual address but a rewritten bounce address that points to your Mailtrain installation.

To set it up you need to create an additonal DNS MX entry for a bounce domain, eg “bounces.example.com” if you are sending from “example.com”. This entry should point to your Mailtrain server IP address. Next you should enable the VERP handling in Mailtrain Settings page.

As ZoneMTA uses envelope sender as the default for DKIM addresses, then if using VERP you need to set up DKIM to your bounce domain instead of sender domain and also store the DKIM key as “bouncedomain.selector.pem” in the ZoneMTA key folder.
If you do not use VERP with ZoneMTA then you should get notified most of the bounces so everything should mostly work without it

6. Set up proper PTR record
If you are using the bundled ZoneMTA then you should make sure you are using a proper PTR record for your server. For example if you use DigitalOcean then PTR is set automatically (it’s the droplet name, so make sure your droplet name is the same as the domain name you are running Mailtrain from). If you use AWS then you can request setting up PTR records using this form (requires authentication). Otherwise you would have to check from your service provider, hot to get the PTR record changed. Everything should work without the PTR record but setting it up correctly improves the deliverability a lot.

7. Ready to send!
With proper SPF, DKIM and PTR records (DMARC wouldn’t hurt either) I got perfect 10/10 score out from MailTester when sending a campaign message to a MailTester test address. I did not have VERP turned on, so the sender address matched return path address.

Src: https://www.diycode.cc/projects/andris9/mailtrain

Share

Install Librenms on Ubuntu 16.04

The first step we must do for installing LibreNMS Monitoring Tools is to install some packages needed on the server. Connect to your server and update the repository.

ssh root@hakase-labs-server
sudo apt update

Install all the required packages for LibreNMS from the Ubuntu repository using the following command.

apt-get install fping imagemagick whois mtr-tiny nmap python-mysqldb snmpd  rrdtool git snmp graphviz python lsb snmp

After the installation is complete, goto the next step.

Install Nginx Webserver
In this tutorial, we will be running LibreNMS under the Nginx web server. Nginx is powerful web server that’s available in the Ubuntu repositories.

Install nginx using apt command from the repository in the following way.

apt install nginx

When it’s done, start the service and enable it to run automatically every time at system boot.

systemctl start nginx
systemctl enable nginx

Nginx web server is running under the default port 80. We can check the port using the netstat command, and check Nginx using curl command to get the HTTP status code, as shown below.

netstat -plntu | grep 80
curl -I localhost

Nginx installation has been completed.

Read more

Share