/*****     SENDMAIL SMTP AUTH     *****/


# ftp://ftp.openssl.org/source/
# openssl-0.9.6d.tar.gz

$ gzip -dc openssl-0.9.6d.tar.gz | tar vxf -
$ cd openssl-0.9.6d
$ ./config
$ make
$ make test
$ make install


# ftp://ftp.pdc.kth.se/pub/krb/src/
# krb4-1.1.1.tar.gz

$ gzip -dc krb4-1.1.1.tar.gz | tar vxf -
$ cd krb4-1.1.1
$ ./configure
$ make
$ make install


# ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/
# cyrus-sasl-2.1.2.tar.gz

$ gzip -dc cyrus-sasl-2.1.2.tar.gz | tar vxf -
$ cd cyrus-sasl-2.1.2
$ ./configure
$ make
$ make install


$ cd /usr/lib/sasl          
$ touch Sendmail.conf
$ vi Sendmail.conf

pwcheck_method: shadow


# ftp://ftp.sendmail.org/pub/sendmail/
# sendmail.8.12.3.tar.gz

$ gzip -dc sendmail.8.12.3.tar.gz | tar vxf -
$ cd sendmail.8.12.3/devtools/Site
$ vi site.config.m4

APPENDDEF(`confENVDEF', `-DSASL')
APPENDDEF(`conf_sendmail_LIBS', `-lsasl')
APPENDDEF(`confLIBDIRS', `-L/usr/lib')
APPENDDEF(`confINCDIRS', `-I/usr/include')


$ cd ../../
$ sh Build

$ cd cf/cf/
$ vi generic-linux.mc

divert(-1)
#
# Copyright (c) 1998, 1999 Sendmail, Inc. and its suppliers.
#       All rights reserved.
# Copyright (c) 1983 Eric P. Allman.  All rights reserved.
# Copyright (c) 1988, 1993
#       The Regents of the University of California.  All rights reserved.
#
# By using this file, you agree to the terms and conditions set
# forth in the LICENSE file which can be found at the top level of
# the sendmail distribution.
#
#

#
#  This is a generic configuration file for Linux.
#  It has support for local and SMTP mail only.  If you want to
#  customize it, copy it to a name appropriate for your environment
#  and do the modifications there.
#

divert(0)dnl
VERSIONID(`$Id: generic-linux.mc,v 8.1 1999/09/24 22:48:05 gshapiro Exp $')
OSTYPE(linux)dnl
DOMAIN(generic)dnl
FEATURE(access_db)dnl
FEATURE(`mailertable', `hash /etc/mail/mailertable')dnl
FEATURE(`virtusertable',`hash /etc/mail/virtusertable')dnl
MAILER(local)dnl
MAILER(smtp)dnl
TRUST_AUTH_MECH(`LOGIN PLAIN DIGEST-MD5 CRAM-MD5')dnl
define(`confAUTH_MECHANISMS', `LOGIN PLAIN DIGEST-MD5 CRAM-MD5')dnl


$ cp generic-linux.mc sendmail.mc
$ sh Build sendmail.cf
$ mkdir /etc/mail
$ sh Build install-cf

$ groupadd smmsp
$ useradd -g smmsp smmsp

$ cd ../../
$ mkdir -p /usr/man/man8/
$ mkdir -p /usr/man/man1/
$ sh Build install

$ mkdir /var/spool/mqueue
$ chown root / /etc /etc/mail /usr /var /var/spool /var/spool/mqueue
$ chmod go-w / /etc /etc/mail /usr /var /var/spool /var/spool/mqueue

$ vi /etc/mail/local-host-names
nnmm.com
okdk.com

$ vi /etc/mail/sendmail.cf

$ vi /etc/mail/relay-domains
127.0.0.1
216.236.151.
64.130.235.213

$ vi /etc/mail/aliases

# Following alias is required by the mail protocol, RFC 822
# Set it to the address of a HUMAN who deals with this system's mail problems.
Postmaster: i

# Alias for mailer daemon; returned messages from our MAILER-DAEMON
# should be routed to our local Postmaster.
MAILER-DAEMON: postmaster

# Aliases to handle mail to programs or files, eg news or vacation
# decode: "|/usr/bin/uudecode"
nobody: /dev/null

# Sample aliases:

# Alias for distribution list, members specified here:
#staff:wnj,mosher,sam,ecc,mckusick,sklower,olson,rwh@ernie

# Alias for distribution list, members specified elsewhere:
#keyboards: :include:/usr/jfarrell/keyboards.list

# Alias for a person, so they can receive mail by several names:
#epa:eric


$ newaliases

$ vi /etc/mail/access
localhost.localdomain           RELAY
localhost                       RELAY
okdk.com                        RELAY
haejuk.com                      REJECT
hacker@hacker.com               REJECT
cracker@hacker.com      550     I hate spammers like you!

$ touch /etc/mail/mailertable
$ vi /etc/mail/virtusertable

@nnmm.com   godspeed
ricky@nnmm.com   ricky
admin@okdk.com   dew@dr.com

$ makemap hash access.db < access
$ makemap hash virtusertable.db < virtusertable
$ makemap hash mailertable.db < mailertable

$ /usr/sbin/sendmail -bi
$ /usr/sbin/sendmail -bd -q15m

$ vi /etc/rc.d/init.d/sendmail

#!/bin/sh
#
# sendmail      This shell script takes care of starting and stopping
#               sendmail.
#
# chkconfig: 2345 80 30
# description: Sendmail is a Mail Transport Agent, which is the program \
#              that moves mail from one machine to another.
# processname: sendmail
# config: /etc/sendmail.cf
# pidfile: /var/run/sendmail.pid

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

# Source sendmail configureation.
if [ -f /etc/sysconfig/sendmail ] ; then
        . /etc/sysconfig/sendmail
else
        DAEMON=yes
        QUEUE=1h
fi

# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0

[ -f /usr/sbin/sendmail ] || exit 0

RETVAL=0

# See how we were called.
case "$1" in
  start)
        # Start daemons.

        echo -n "Starting sendmail: "
        /usr/bin/newaliases > /dev/null 2>&1
        for i in virtusertable access domaintable mailertable ; do
            if [ -f /etc/mail/$i ] ; then
                makemap hash /etc/mail/$i < /etc/mail/$i
            fi
        done
        daemon /usr/sbin/sendmail $([ "$DAEMON" = yes ] && echo -bd) \
                                  $([ -n "$QUEUE" ] && echo -q$QUEUE); \
               /usr/sbin/sendmail -L sm-msp-queue -Ac -q30m
        RETVAL=$?

        sleep 1
        echo
        if [ $RETVAL -eq 0 ] ; then
          touch /var/lock/subsys/sendmail
          cp -af /var/spool/clientmqueue/sm-client.pid /var/run/sm-client.pid
        fi
        ;;
  stop)
        # Stop daemons.
        echo -n "Shutting down sendmail: "
        killproc sendmail
        killproc sm-client
        RETVAL=$?
        echo
        if [ $RETVAL -eq 0 ] ; then
          rm -f /var/lock/subsys/sendmail
          rm -f /var/spool/clientmqueue/sm-client.pid
        fi
        ;;
  restart|reload)
        $0 stop
        $0 start
        RETVAL=$?
        ;;
  status)
        status sendmail
        RETVAL=$?
        ;;
  *)
        echo "Usage: sendmail {start|stop|restart|status}"
        exit 1
esac

exit $RETVAL


$ ntsysv


/*****     THE END     *****/

'전자/컴퓨터 > Unix/Linux' 카테고리의 다른 글

proftpd 설치 방법  (0) 2007.04.17
NetBSD3.0에 APM설치 방법  (0) 2007.04.17

proftpd 설치 방법이다.  아래순서대로 따라 입력하면 된다.

http://www.proftpd.org
proftpd-1.2.2.tar.gz


vi /etc/passwd

proftpd:x:501:501::/usr/local/proftpd:/bin/false

vi /etc/group

proftpd:x:501:

gzip -dc proftpd-1.2.2.tar.gz | tar vxf -
cd proftpd-1.2.2
./configure --prefix=/usr/local/proftpd --enable-autoshadow
make
make install

cp contrib/dist/rpm/proftpd.init.d /etc/rc.d/init.d/proftpd
cd /etc/rc.d/init.d/
chmod 755 proftpd

vi /etc/rc.d/init.d/proftpd


#!/bin/sh
#
# Startup script for ProFTPd
#
# chkconfig: 345 85 15
# description: ProFTPD is an enhanced FTP server with \
#               a focus toward simplicity, security, and ease of configuration. \
#              It features a very Apache-like configuration syntax, \
#               and a highly customizable server infrastructure, \
#               including support for multiple 'virtual' FTP servers, \
#               anonymous FTP, and permission-based directory visibility.
# processname: proftpd
# config: /etc/proftpd.conf
#

# Source function library.
. /etc/rc.d/init.d/functions

FTPSHUT=/usr/local/proftpd/sbin/ftpshut
FTPDAEMON=/usr/local/proftpd/sbin/in.proftpd
PID=/usr/local/proftpd/var/proftpd.pid

# See how we were called.
case "$1" in
  start)
        echo -n "Starting proftpd: "
        if [ -f $FTPDAEMON ]; then
                echo -n "Started "
                $FTPDAEMON
        fi
        echo
        touch /var/lock/subsys/proftpd
        ;;
  stop)
        echo -n "Shutting down proftpd: "
        if [ -f $PID ]; then
                echo -n "Stopped "
                /bin/kill `cat $PID`
        fi
        echo
        rm -f /var/lock/subsys/proftpd
        ;;
  status)
        status proftpd
        ;;
  restart)
        $0 stop
        $0 start
        ;;
  reread)
        echo -n "Re-reading proftpd config: "
        killproc proftpd -HUP
        echo
        ;;
  suspend)
        if [ -f $FTPSHUT ]; then
                if [ $# -gt 1 ]; then
                        shift
                        echo -n "Suspending with '$*' "
                        $FTPSHUT $*
                else
                        echo -n "Suspending NOW "
                        $FTPSHUT now "Maintanance in progress"
                fi
        else
                echo -n "No way to suspend "
        fi
        echo
        ;;
  resume)
        if [ -f /etc/shutmsg ]; then
                echo -n "Allowing sessions again "
                rm -f /etc/shutmsg
        else
                echo -n "Was not suspended "
        fi
        echo
        ;;
  *)
        echo -n "Usage: $0 {start|stop|restart|status|reread|resume"
        if [ "$FTPSHUT" = "" ]; then
                echo "}"
        else
                echo "|suspend}"
                echo "suspend accepts additional arguments which are passed to ftpshut(8)"
        fi
        exit 1
esac

if [ $# -gt 1 ]; then
        shift
        $0 $*
fi

exit 0


chmod 755 /etc/rc.d/init.d/proftpd
chown -R proftpd:proftpd /usr/local/proftpd/

vi /usr/local/proftpd/etc/proftpd.conf


# This is a basic ProFTPD configuration file (rename it to
# 'proftpd.conf' for actual use.  It establishes a single server
# and a single anonymous login.  It assumes that you have a user/group
# "nobody" and "ftp" for normal operation and anon.

ServerName                      "OPEN"
ServerType                      standalone
DefaultServer                   on

# Port 21 is the standard FTP port.
Port                            21
# Umask 022 is a good standard umask to prevent new dirs and files
# from being group and world writable.
Umask                           022

# To prevent DoS attacks, set the maximum number of child processes
# to 30.  If you need to allow more than 30 concurrent connections
# at once, simply increase this value.  Note that this ONLY works
# in standalone mode, in inetd mode you should use an inetd server
# that allows you to limit maximum number of processes per service
# (such as xinetd)
MaxInstances                    30

# Set the user and group that the server normally runs at.
User                            proftpd
Group                           proftpd

# Normally, we want files to be overwriteable.
<Directory /*>
  AllowOverwrite                on
</Directory>

######## Global start ###################################
<Global>
Umask                           022
#DisplayLogin                    .welcome.msg
#DisplayFirstChdir               .message
#User                           nobody
#Group                          nogroup
#MaxClients                     10
#MaxClientsPerHost              1
#UserAlias                       anonymous       ftp
RootLogin   off
#AuthPAMAuthoritative  on
#TimeoutIdle   300
DeferWelcome   off
RequireValidShell               on
ShowSymlinks                    on
DefaultRoot                     ~
timesGMT                        off
</Global>
######## Global end ###################################

# A basic anonymous configuration, no upload directories.
<Anonymous ~ftp>
  User                          ftp
  Group                         ftp
  # We want clients to be able to login with "anonymous" as well as "ftp"
  UserAlias                     anonymous ftp

  # LsDefaultOptions  "-a"

  # Limit the maximum number of anonymous logins
  MaxClients                    10
  MaxClientsPerHost  3 "Sorry, one connection allow per one host"
 
  # HideUser   root
  # HideGroup   root
 
  # We want 'welcome.msg' displayed at login, and '.message' displayed
  # in each newly chdired directory.
  DisplayLogin                  welcome.msg
  DisplayFirstChdir             .message

  # Limit WRITE everywhere in the anonymous chroot
  <Limit WRITE>
    DenyAll
  </Limit>

  <Directory incoming>
    <Limit READ>
      DenyALL
    </Limit>
    <Limit STOR MKD>
      AllowALL
    </Limit>
  </Directory>
 
  <Directory logs>
    <Limit READ WRITE DIRS>
      DenyALL
    </Limit>
  </Directory> 

</Anonymous>


/etc/rc.d/init.d/proftpd restart

'전자/컴퓨터 > Unix/Linux' 카테고리의 다른 글

sendmail 설치 스크립트  (2) 2008.07.21
NetBSD3.0에 APM설치 방법  (0) 2007.04.17
얼마전에 VMwere를 써서 NetBSD를 설치해보았다. 리눅스는 용량이커서 설치하기가 버거웠는는데 NetBSD 3.0
은 약 200메가 남짓하다. AMP을 소스로 받아설치하는 방법을 정리해보았다.

 1) 설치환경

  - 운영체제 : NetBSD 3.0

  - 사용버젼 : Apache-1.3.36, Mysql-4.0.26, PHP-4.4.2


 2) 설치방법

  * APM 설치 순서 *

    Mysql -> Apache configure -> PHP -> Apach

  (1) Mysql 설치

     #tar -zxvf mysql-4.0.26.tar.gz

     #cd mysql-4.0.26

     #./configure --prefix=/usr/local/mysql --with-charset=euc_kr -localstatedir=/usr/local/mysql/data

     #make

     #make install

     #/usr/local/mysql/bin/mysql_install_db

     #useradd -M -s /sbin/nologin mysql

     #chown -R mysql:mysql /usr/local/mysql

      *mysql 그룹이 없을 경우 ‘groupadd mysql’을 입력해 그룹을 생성해 줄것

     #/usr/local/mysql/bin/safe_mysqld &


   (2)Apache configure

     #tar -zxvf apache-1.3.36.tar.gz

     #cd apache-1.3.36

     #./configure

   

   (3)PHP 설치

     #tar -zxvf php-4.4.2.tar.gz

     #cd php-4.4.2

     #./configure --with-apache=[(2)번에서 apache-1.3.36의 경로] --with-mysql=/usr/local/mysql

     #make

     #make install

     #cp php.ini-dist /usr/local/lib/php.ini  * get, post가 안될 경우 regster_gobals = on 으로 설정할것

   

   (4)Apache 설치

     #cd  [(2)번에서 apache-1.3.36의 경로]

     #./configure --prefix=/usr/local/apache --activate-module=src/modules/php4/libphp4.a

     #make

     #make install

     #vi /usr/local/apache/bin/conf/httpd.conf (파일을 텍스트 에디터로 열어 아래의 내용이 있는지 확인후 없으면 아래와 같이 입력해 추가할것.)

      AddType application/x-httpd-php .php .php3 .phtml

      :wq

     #/usr/local/apache/bin/apachectl start

   

   (5)batch 파일설정 (/etc/rc.d/rc.local *파일 없을시 생성할것*)

     #vi /etc/rc.d/rc.local (파일을 텍스트 에디터로 열어 아래와 같이 입력할것.)

      /usr/local/mysql/bin/safe_mysqld &

      /usr/local/apache/bin/apachectl start

     :wq

'전자/컴퓨터 > Unix/Linux' 카테고리의 다른 글

sendmail 설치 스크립트  (2) 2008.07.21
proftpd 설치 방법  (0) 2007.04.17

+ Recent posts