Tuesday, November 22, 2011

Squid Proxy Server and Send Mail


Squid Proxy Server  :-

Proxy server is used for Internet Sharing :-


 Server Profile

Type                       :    System V manage
Package                 :    Squid
Daemon                 :    Squid
Script                      :    Squid
Configuration        :    /etc/squid/squid.conf
Port No                   :    8080 , 3128
Steps

  1. Check the rpm’s
#rpm –q squid

  1. Edit the file squid.conf
#vi /etc/squid/squid.conf
Line number 54
http-port   8080

Line number 481
cache-mem  100MB

Line number 1805 (syntax : acl acl_name acl_type network or domain)
acl icon src 172.24.0.0/255.255.0.0

Line number 1865
http-access allow icon

In order to deny we write
http-access deny aclname
Like
http-access deny icon

If we want to restrict any site
Syntax : acl aclname acltype Name or domain
Example:
acl icon1 dstdomain .hotmail.com

Start the service
#service squid restart
#chkkconfig squid on

Client Side:
  1. Click on Mozilla Web Browser
  2. Click editàPreferences
  3. Click on “Connection Setting”
  4. Select “ Manual Proxy Configuration”
Http Proxy : 172.24.254.254 Port 8080

Send Mail  :- 

Sendmail is used to configure the mail server on the server in order to send and receive the mail.

Service Profile

Type                          :    System V manage
Package                    :    sendmail, sendmail-cf, procmail, mutt , m4
Daemon                    :    sendmail
Port                           :    25
Configuration File    :    /etc/mail/sendmail.mc
                                       /etc/mail/sendmail.cf
                                        /etc/mail/access
                                        /etc/aliases
Steps:
  1. Edit the file sendmail.mc
Line number 105
            DAEMON-OPTION(……………………….)
Disable this line by adding
dnl#
  1. Now create a new sendmail.cf file through sendmail.mc
#m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf

  1. In order to allow / restrict other network or client or any user to send mail we edit file /etc/mail/access
#vi /etc/mail/access
172.24                                                                                                  OK
172.24.0.4                                                                                      REJECT
root@station6.example.com              DISCARD
OK                  :           Allow
REJECT           :           restrict and message reply will come
DISCARD       :           restrict and message reply will not come

  1. In order to redirect the mail of any user to another we edit
#vi /etc/aliases
Root :              jeet,Deepak,root@station6.example.com
After editing this file, we need to run the ‘newaliases command to update the file
#newaliases

  1. Start the Service
#service sendmail restart
#chkconfig sendmail on

  1. To check the mail
#mutt
If any problem come that /var/spool/mail/root does not exits then create a file by
#touch /var/spool/mail/root



Thanks ,

 

No comments:

Post a Comment