Search This Blog

Saturday, October 22, 2016

Software Selection in Ubuntu Server



OpenSSH server
SSH (Secure Shell) is a protocol to get encrypted remote access to a machine. The machine you want to access needs to run a SSH server to accept incoming requests. OpenSSH is an implementation of SSH. Next to shell access and file transfer (SFTP, SCP), SSH enables fancy things, such as starting an application on the server, but show the GUI on the client (X11 forwarding).

DNS server
The Domain Name System, short DNS, resolves addresses, like google.com to IP 74.125.200.138 addresses like , which makes the internet more usable to human beings. For DNS lookups, the clients, e.g. web browsers, send a request to a DNS server in order to retrieve the IP address of the required service.

LAMP server
LAMP = Linux Apache MySQL PHP, pretty much explains it: This package contains an Apache web server (a server that e.g. delivers websites), with a MySQL backend (A database management system), and a PHP interpreter (PHP is a scripting language that is executed on the server before sending the result to the client, in this setup through the Apache server).

Mail server
A server that is responsible for delivering E-Mail, both for sending and receiving, depending on the setup.

PostgreSQL server
PostgreSQL is, like MySQL, a database management system. A database server enables clients to send queries to the server and returns the results.

Print server
On a default Desktop Ubuntu, there is a printing system called CUPS installed. CUPS works as a server, on which the printers are installed. Every time you print something on Ubuntu, it sends the print job to a print server, either on the same system, or to another. E.g. in my school, there is a central print server students send their print jobs to, and then the print server takes care of the printing.

Samba file server
Samba is an implementation of the SMB (Server Message Block) protocol, which can be used as a network file system. SMB clients can mount drives published by a SMB server.
Tomcat Java server
Tomcat is another web service, responsible for delivering JSP content, i.e. dynamic website generation.
Virtual Machine host
This option installs KVM, a host for running virtual machines.

We get all these software selection option at the time of installing the server. We can get back to this selection at any time by installing the following pancake:

#apt-get install tasksel
#tasksel

After installing the following package will get a window like this and will able to select any package as per our requirement.





Saturday, October 15, 2016

Linux user, file and directory

Linux user, file and directory  



[safayat@mail  home] $
[root@mail  home] #
  1       2        3       4

                1: user name
                2: hostname
                3: user's current locaiton
                4: user types (root: #, regular user: $)

Linux User's Types:
 >>root user: Administrator (#)
>> system user: service (mail/ftp/games/daemon)-cannot login
>>  regular user: Rahim, Karim, guest ($)


Meaning of colors in command line:

      blue - dir 
      b&w - file
      red - compress (rpm/zip/rar)
      green - execute file
      yellow - device (terminal/cd/dvd/usb/hdd)
      cyan - link file
      magenta - Picture/image/media



Linux Directory Structure:

  "~"         => home dir
  "/"          => root partition
  "/root" => root's home dir
  "/home" => user's home
    i.e.: /mail/log

$ cd /
$ ls



bin
user binary files ( executed by normal user)

boot
system boot related file

dev
system device files (dvd/cd/hdd/fd)

etc
all server & system configuration file

home
regular user home dir

lib
system libary files locations. libraries needed to execute the binaries in /bin/ and /sbin/.

media
system defaut mount point (DVD/ISO/SOFTware)

mnt                
mount point (DVD/HDD/USB)

opt
optional (empty)

proc
Also called 'proFS' system process related info (CPU,RAM, Process, Driver, Modules and Kernel)

root
 root user (superuser) home dir.

run
service running data. Runtime data for processes started since the last boot. 

sbin
system binary ( used by root user)

srv
Sort for Service. User's (/home/*) service related data. Like WWW, FTP etc.

sys
Sort for system. '/sys' directory as a virtual filesystem (sysfs) mounted under /sys. similar as proc.
temp
temporary files (deleted after 10 days)

usr                  
thirdparty software install location

var                  
varibale file (mail/log/hosting/ftpdata)

                                                                                          


 NB: The red marked directories are mostly usable. 

How DNS works


How DNS works 



Monday, October 10, 2016

How does a mail server work?

How does a mail server work?


A mail server (sometimes also referred to an e-mail server) is a server that handles and delivers e-mail over a network, usually over the Internet. A mail server can receive e-mails from client computers and deliver them to other mail servers. A mail server can also deliver e-mails to client computers. A client computer is normally the computer where you read your e-mails, for example your computer at home or in your office. Also an advanced mobile phone or Smartphone, with e-mail capabilities, can be regarded as a client computer in these circumstances.
Using email address has become a common phenomenon in today’s world. From sending to receiving an email there are a lot things are happened in background.
That whole process can be divided into two steps:
They are - Sending mail and receiving mail.  And the two protocols of this process are given below:

>> Sending email: Simple Mail Transfer Protocol (SMTP)
>> Receiving email: Post Office Protocol (POP) / Internet Message Access Protocol (IMAP)



Key players in mail transection:

The following key players are important in understanding the operation of a mail server.
  • Mail User Agent (MUA): The MUA is a component which interacts with end users directly. Examples of MUA are Thunderbird, MS Outlook, Zimbra Desktop. Web mail interfaces like Gmail and Yahoo! are also MUA.
  • Mail Transfer Agent (MTA): The MTA is responsible for transferring an email from a sending mail server all the way to a recipient mail server. Examples of MTA are sendmail and postfix.
  • Mail Delivery Agent (MDA): Within a destination mail server, local MTA accepts an incoming email from remote MTA. The email is then delivered to user's mailbox by MDA.
  • POP/IMAP: POP and IMAP protocols are used to fetch emails from a recipient server's mailbox to recipient MUA.
  • Mail Exchanger Record (MX): The MX record is the DNS entry for mail servers. This record points to the IP address towards which emails should be shot. The lowest MX record always wins, i.e., gets the highest priority. For example, MX 1 is better than MX 2. The IP address of the MX record may vary based on the design and configuration requirements, as will be discussed later in the article.

When a sender clicks on the send button, SMTP (MTA) ensures end to end delivery of an email from a sender-side server to a destination server. Upon reaching the destination server, the MTA local to the destination server accepts the email, and hands it over to the local MDA. The MDA then writes the email to a receiver's mailbox. When the recipient checks for emails, they are fetched by MUA by using protocols like POP or IMAP.




Public and Private IP address

What is public IP address?

A public IP address is the address that is assigned to a computing device to allow direct access over the Internet. A web server, email server and any server device directly accessible from the Internet are candidate for a public IP address. A public IP address is globally unique, and can only be assigned to an unique device.

What is private IP address?

A private IP address is the address space allocated by InterNIC to allow organizations to create their own private network. There are three IP blocks (1 class A, 1 class B and 1 class C) reserved for a private use. The computers, tablets and smartphones sitting behind your home, and the personal computers within an organizations are usually assigned private IP addresses. A network printer residing in your home is assigned a private address so that only your family can print to your local printer.
When a computer is assigned a private IP address, the local devices sees this computer via it's private IP address. However, the devices residing outside of your local network cannot directly communicate via the private IP address, but uses your router's public IP address to communicate. To allow direct access to a local device which is assigned a private IP address, a Network Address Translator (NAT) should be used.

What is the difference between public and private IP address?

A public IP address is an IP address that can be accessed over the Internet. Like postal address used to deliver a postal mail to your home, a public IP address is the globally unique IP address assigned to a computing device. Your public IP address can be found at What is my IP Address webpage. Private IP address on the other hand is used to assign computers within your private space without letting them directly expose to the Internet. For example, if you have multiple computers within your home you may want to use private IP addresses to address each computer within your home. In this scenario, your router get the public IP address, and each of the computers, tablets and smartphones connected to your router (via wired or wifi) get a private IP address from your router via DHCP protocol.
Internet Assigned Numbers Authority (IANA) is the organization responsible for registering IP address ranges to organizations and Internet Service Providers (ISPs). To allow organizations to freely assign private IP addresses, the Network Information Center (InterNIC) has reserved certain address blocks for private use. The following IP blocks are reserved for private IP addresses.





Introduction to Proxy Server

What is a Proxy Server?


A Proxy server is an intermediary machine, between a client and the actual server, which is used to filter or cache requests made by the client.
This article is focused on the Different Caching Web Proxies.


Normal (Regular/Caching) Proxy:


A regular caching proxy server is a server which listens on a separate port (e.g. 3128) and the clients (browsers) are configured to send requests for connectivity to that port. So the proxy server receives the request, fetches the content and stores a copy for future use. So next time when another client requests for the same webpage the proxy server just replies to the request with the content in its cache thus improving the overall request-reply speed.


Transparent Proxy:


A transparent proxy server is also a caching server but the server is configured in such a way that it eliminates the client side (browser side) configuration. Typically the proxy server resides on the gateway and intercepts the WWW requests (port 80, 443 etc.) from the clients and fetches the content for the first time and subsequently replies from its local cache. The name Transparent is due to the fact that the client doesn't know that there is a proxy server which mediates their requests. Transparent proxy servers are mostly used in big corporate organizations where the client side configuration is not easy (due to the number of clients). This type of server is also used in ISP's to reduce the load on the bandwidth usage.


Reverse Proxy:


A reverse proxy is totally different in its usage because it is used for the benefit of the web server rather than its clients. Basically a reverse proxy is on the web server end which will cache all the static answers from the web server and reply to the clients from its cache to reduce the load on the web server. This type of setup is also known as Web Server Acceleration.

Friday, October 7, 2016

LOOP BACK ADDRESS


127.0.0.1 is the standard IP  address used for a loopback network connection. This means that if you try to connect to 127.0.0.1, you are immediately looped back to your own machine. 127.0.0.1 is also referred to as “localhost”, meaning ‘this computer’.127.0.0.0/8 - This block is assigned for use as the Internet host loopback address. A datagram sent by a higher level protocol to an address anywhere within this block should loop back inside the host. Making a connection with a 127.0.0.1 loopback address is the same as making a connection with any remote computer on the network, but avoiding the local network interface hardware. It is widely used by application developers and system administrators with the intention of testing software/applications.

In a word, 127.0.0.0 is the address that refers your system back to its self. 127.0.0.0 checks whether the LAN card is logically connected or not.