How to install Mail Service at Ubutu Live Serer (LEMP)

How to install Mail Service at Ubutu Live Serer (LEMP)

Install mailutils by the following command
apt-get install mailutils
apt-get install ssmtp

edit ssmtp.conf under /etc/ssmtp/ssmtp.conf
Remove “#” from “#FromLineOverride=YES” and add the following lines to ssmtp.conf


After that, test email can send it or not with the following command
echo “tesitng” | mail -s “testing”

Checking Error about mail

if some setting are not and you want to re-configure the setting

Reconfigure / Resetting setting
sudo dpkg-reconfigure postfix
sudo dpkg-reconfigure mailutils




The hosted network couldn’t be started at windows OS

When I try to run netsh wlan start hostednetwork, I get the following message:

C:\Windows\system32>netsh wlan start hostednetwork
The hosted network couldn’t be started.
The group or resource is not in the correct state to perform the requested operation.

Go to device manager by “devmgmt.msc” at run box
then open the network adapters tree ,
right click button on Microsoft Hosted Network Virtual Adapter and click on enable

Try now with the command netsh wlan start hostednetwork with admin privileges. It should work.



Example syntax for Secure Copy (scp)

What is Secure Copy?

scp allows files to be copied to, from, or between different hosts. It uses ssh for data transfer and provides the same authentication and same level of security as ssh.


Copy the file “foobar.txt” from a remote host to the local host

$ scp /some/local/directory

Copy the file “foobar.txt” from the local host to a remote host

$ scp foobar.txt

Copy the directory “foo” from the local host to a remote host’s directory “bar”

$ scp -r foo

Copy the file “foobar.txt” from remote host “” to remote host “”

$ scp \

Copying the files “foo.txt” and “bar.txt” from the local host to your home directory on the remote host

$ scp foo.txt bar.txt

Copy the file “foobar.txt” from the local host to a remote host using port 2264

$ scp -P 2264 foobar.txt

Copy multiple files from the remote host to your current directory on the local host

$ scp\{a,b,c\} .
$ scp\{foo.txt,bar.txt\} .

scp Performance

By default scp uses the Triple-DES cipher to encrypt the data being sent. Using the Blowfish cipher has been shown to increase speed. This can be done by using option -c blowfish in the command line.

$ scp -c blowfish some_file

It is often suggested that the -C option for compression should also be used to increase speed. The effect of compression, however, will only significantly increase speed if your connection is very slow. Otherwise it may just be adding extra burden to the CPU. An example of using blowfish and compression:

$ scp -c blowfish -C local_file


Thanks Stewart Macleod for port example.

Ref :

How to Use SSL Certificate in LEMP Digital Droplet

(1) We need to create two Certificate to give to SSL Certificate Vendor ( / GMO-ACE )

How do I generate a CSR Code


OS – Ubuntu 14.04
Digital Ocean Droplet with LEMP

cd /etc/ssl
mkdir /etc/ssl/websitessl
openssl req -new -newkey rsa:2048 -nodes -keyout domainname.key -out domainname.csr

“`means you create a 2048bits csr. I recommend for more security to use “`rsa:4069“`
You also need to change “`domainname.key“`and “`domainname.csr“` into your own domain name
so you can verify the CSR file. After you filled in all the legit information ,
you can open the new file using a client for example WinSCP, copy it, and use it for your SSL.


(2) And then, we have to buy/generate our SSL certificate at SSL Vendor Site and we will get / SSL vendor will generate the certificate files .

We have to copy generated .PEM files from SSL Certifiate Provider to our host ( Digital Ocean LEMP )
And then, we have to edit the virtual host setting file at

Using SSL Certificate at Nginx Virtual Host Setting
you have to create tow server blocks for both HTTP and HTTPS request.
And then, redirect to every request to HTTPS.

server {
listen 80;
return 301$request_uri;

server {
listen 443 ssl;
ssl on;

root /var/www/registrations/public;
index index.php index.html index.htm;

# Make site accessible from http://localhost/
# server_name localhost;

access_log /var/log/nginx/nginx.vhost.access.log;
error_log /var/log/nginx/nginx.vhost.error.log;

ssl_certificate /etc/ssl/websitessl/;
ssl_certificate_key /etc/ssl/websitessl/examplesite.key;
ssl_trusted_certificate /etc/ssl/websitessl/;

ssl_ciphers “HIGH:!aNULL:!MD5 or HIGH:!aNULL:!MD5:3DES”;
ssl_prefer_server_ciphers on;

# to disable SSL3 service – to prevent the POODLE Vulnerablitiy attack
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;

location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
# try_files $uri $uri/ =404;
try_files $uri $uri/ /index.php?$query_string;
# Uncomment to enable naxsi on this location
# include /etc/nginx/naxsi.rules

# Only for nginx-naxsi used with nginx-naxsi-ui : process denied requests
#location /RequestDenied {
# proxy_pass;

#error_page 404 /404.html;

# redirect server error pages to the static page /50x.html
#error_page 500 502 503 504 /50x.html;
#location = /50x.html {
# root /usr/share/nginx/html;

# pass the PHP scripts to FastCGI server listening on
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# # NOTE: You should have “cgi.fix_pathinfo = 0;” in php.ini
# # With php5-cgi alone:
# fastcgi_pass;
# # With php5-fpm:
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;

# deny access to .htaccess files, if Apache’s document root
# concurs with nginx’s one
location ~ /\.ht {
deny all;

client_max_body_size 10M;


Creating Wifi Hotspot at Window OS

How to tell if your PC supports Hotspot 2.0

Hotspot 2.0 is relatively new, and it’s available on Windows 10 devices with compatible hardware.

You can quickly check to see if your device supports Hotspot 2.0, using the following steps:

  1. Open Start.
  2. Search for Command Prompt and click the result.
  3. Type the following command and press Enter:

    netsh wlan show wirelesscapabilities

If the command output shows that your PC supports ANQP Service Information Discovery, you can connect to Hotspot 2.0 networks.


Set Up Wi-Fi Hotspot Using the Command Prompt at Windows 10

This method does not require you to download any third-party application. You can easily set up a Wi-Fi hostspot using the built-in tools in Windows OS.

Step 1 – You need to open the command prompt with administrator privileges.

Step 2 – Now we will create the hotspot. Simply enter the following command and press the Enter key:

Now we will create the hotspot. Simply enter the following command and press the Enter key:

netsh wlan set hostednetwork mode=allow ssid=YourHotspotName key=YourPassword

The SSID is the name of the Wifi connection and can be changed to anything you want. The KEY is the password and can be changed, also but bear in mind that it has to be at least eight characters.

Step 3 – You need to start the following command to start the WiFi hotspot:

netsh wlan start hostednetwork

Your WiFi hotspot should be activated and usable. You can check its status in the network and sharing center of your control panel.


You can now connect your devices to the hotspot and use the same WiFi connection without using third-party tools.

You can turn off the hotspot when not in use with the following command:

netsh wlan stop hostednetwork