Friday, May 24, 2013


Mail server Overview:

Send mail is the most popular UNIX-based implementation of the Simple Mail Transfer Protocol (SMTP) for transmitting e-mail.
The Mail Transfer Agent (MTA) is responsible for moving email between different email servers using the Simple Mail Transfer Protocol (SMTP), Examples of UNIX MTAs include sendmail, postfix, Exim and qmail.
The message store is a data repository. A user queries this repository using a Mail User Agent (MUA) such as Eudora or Netscape

Email Protocols and some of the basic components

MUA: Mail User Agent         
The email application that a user sends/receives (thunderbird,pine,outlook)
MTA: Mail Transport Agent: transports email messages between hosts using SMTP. A message may involve several MTAs as it moves to its intended destination.  Such as (sendmail,postfix,qmail)
MDA: Mail Delivery Agent
The server agent that accepts email from MTA, and places into users mailbox (procmail)
Mail Access Protocols: There are two primary protocols used by email client applications to retrieve email from mail servers: the Post Office Protocol (POP) and the Internet Message Access Protocol (IMAP).
SMTP: MUAs and MTAs use this protocol for sending emails Mail delivery from a client application to the server, and from an originating server to the destination server
POP3: Post Office Protocol (Ver 3)
MUAs use this protocol for receiving their emails from the final server
IMAP: Internet Message Access Protocol     MUAs can use this protocol to send and receive emails on the servers

Simple Scenario: Sending and receiving e-mail locally

This scenario demonstrates how e-mail is processed between local users.
Jawed is using the Netscape mail client. He writes a message and sends it to Hamid@mycompany.com. The following figure illustrates the path the mail message takes through the network.




HTTP Response Status Codes

HTTP Response Status Codes
1XX: Informational
100 Continue, 101 Switching Protocols
2XX: Success
200 OK, 206 Partial Content
3XX: Redirection
301 Moved Permanently, 304 Not Modified
4XX: Client error
400 Bad Requests, 403 Forbidden, 404 Not Found
5XX: Server error, 500 Internal Server Error, 503 Service Unavailable, 505 HTTP Version Not Supported
Figure 8-7 HTTP Status Codes

How Apache Works

For example, typing in www.google.com into your browser’s address field might send the following request to the server at that IP address:
-        GET / HTTP/1.1
-        Host: www.google.com
First, there is the method (GET), the URI, which specifies which page to be retrieved or which program to be run (root directory /), and the HTTP version (HTTP 1.1).

If the page is found successful, the server returns a 200 status code, response headers, along with the requested data. The response header like the following:
-        HTTP/1.1 200 OK
-        Date: Sun, 10 Jun 2012 19:19:21 GMT
-        Server: Apache
-        Expires: Wed, 11 Jan 1984 05:00:00 GMT
-        Cache-Control: no-cache, must-revalidate, max-age=0
-        Pragma: no-cache
-        Last-Modified: Sun, 10 Jun 2012 19:19:21 GMT
-        Vary: Accept-Encoding,User-Agent
-        Content-Type: text/html; charset=UTF-8
-        Content-Length: 7560 


Apache Web Server Hosting

The Apache web server allows one to configure a single computer to represent multiple websites as if they were on separate hosts. There are two methods available and we describe the configuration of each. Choose one method for your domain:

    Name based virtual host

A single computer with a single IP address supporting multiple web domains. The web browser using the http protocol, identifies the domain being addressed.

    IP based virtual host

The virtual hosts can be configured as a single multi-homed computer with multiple IP addresses on a single network card, with each IP address representing a different web domain. This has the appearance of a web domain supported by a dedicated computer because it has a dedicated IP address.

Apace web server Overview:

The Apache HTTP Server developed by the Apache Software Foundation (http://www.apache.org/). It was first developed to work with Linux/Unix operating systems, but was later adapted to work under other systems, including Windows and Mac. The Apache binary running under UNIX is called HTTPd (HTTP daemon)
(books.google.com)The function of a web server is to deliver web pages on the request of clients using the Hypertext Transfer Protocol (HTTP). This means delivery of HTML documents and any additional content that may be included by a document, such as imagesstyle sheets and scripts.
(tutsplus.com)A web server gets a URL, translates it to a filename and sends that file back over the internet, If for any reason, the web server was not able to process and complete the request, it instead returns an error message.
The Apache server offers a number of services for use, include: HTTP, port 80, SMTP, port 25, DNS for mapping domain names to their corresponding IP addresses, port 53, and FTP for uploading and downloading files, port 21.



Troubleshooting Samba

Samba Logs

Your first line of attack should always be to check the log files. The Samba log files can help diagnose the vast majority of the problems that beginning to intermediate Samba administrators are likely to face. Samba is quite flexible when it comes to logging. By default, logs are placed in samba_directory /var/smbd.log and samba_directory /var/nmbd.log, where samba_directory is the location where Samba was installed (typically, /usr/local/samba).

 Log levels

The level of logging that Samba uses can be set in the smb.conf file using the global log level or debug level option, The logging level is an integer which ranges from 0 (no logging), and increases the logging to voluminous by log level = 3. For example, let's assume that we are going to use a Windows client to browse a directory on a Samba server. For a small amount of log information, you can use log level = 1, which instructs Samba to show only cursory information, in this case only the connection itself:

UNIX Utilities

Sometimes it's useful to use a tool outside of the Samba suite to examine what's happening inside the server. UNIX has always been a "kitchen-sink" operating system. Two diagnostic tools can be of particular help in debugging Samba troubles: trace and tcpdump.

Samba Features

Samba allows file and print sharing between computers running Windows and computers running UNIX. It is an implementation of dozens of services and a dozen protocols, including:

SMB: (Server Message Block):

Protocol to share disk and printer developed by Microsoft and Intel using NetBIOS on TCP/IP. Linux can mount a Samba share using the cifs or smbfs file system

CIFS(Common Internet File System)(An enhanced version of SMB)

extended version of SMB file sharing for Internet, Internet Standard File Protocol to support Windows and UNIX system

SMB/CIFS services in Microsoft:

CIFS, Common Internet File System (formerly SMB) is the file sharing protocol used by Microsoft Windows 95, 98, ME, NT, 2000, and XP operating systems to share files and printers across the network. Similar to CIFS, NFS (Network File System) is the file sharing protocol which is used in UNIX based platforms to share files across the network.
Note: Samba 2.0 on Linux against Windows NT4.


Some options in. Conf file
public - share can be accessed by guest
browsable - share is visible in browse lists
writable - resource is read and write enabled
printable - resource is a printer, not a disk
group - all connections to the share use the specified group as their primary group