• 車種別
  • パーツ
  • 整備手帳
  • ブログ
  • みんカラ+

ひなり@3年17組のブログ一覧

2009年05月15日 イイね!

【Debian】magic-smtpd

ビルド


# gzip -cd magic-smtpd-0.8.4-2.tar.gz | tar xvf -

# cd magicmail-0.8.4-2

# make


magic-smtpd.c:178: error: static declaration of ‘smtp_from_addr’ follows non-static declaration
magic-smtpd.h:42: error: previous declaration of ‘smtp_from_addr’ was here
make[1]: *** [magic-smtpd.o] エラー 1
make[1]: ディレクトリ `/home/kie/magicmail-0.8.4-2/magic-smtpd' から出ます
make: *** [all] エラー 2

makeでエラーが出る…

ネットをいろいろ調べると…

magic-smtpd.hの42行目の「extern lm_string_t smtp_from_addr;」を消してしまえとの事w


magic-smtpdをインストール


# mkdir -p /etc/magic-mail/control
# mkdir -p /etc/magic-mail/bin

# cp ./magic-smtpd/magic-smtpd /var/qmail/bin/magic-smtpd
# chown root:qmail /var/qmail/bin/magic-smtpd

# cp ./scripts/vpopmail-check-user.sh /etc/magic-mail/bin
# chown root:root /etc/magic-mail/bin/vpopmail-check-user.sh


設定

# vi /etc/init.d/qmail


(修正前)

sh -c "start-stop-daemon --start --quiet --user qmaild \
--pidfile /var/run/tcpserver_smtpd.pid --make-pidfile \
--exec /usr/bin/tcpserver -- -l0 -R -H \
-u `id -u qmaild` -g `id -g nobody` -x /etc/tcp.smtp.cdb 0 smtp \
$rblsmtpd /usr/sbin/qmail-smtpd 2>&1 \
| $logger &"

(修正後)

sh -c "start-stop-daemon --start --quiet --user qmaild \
--pidfile /var/run/tcpserver_smtpd.pid --make-pidfile \
--exec /usr/bin/tcpserver -- -l0 -R -H \
-u `id -u qmaild` -g `id -g nobody` -x /etc/tcp.smtp.cdb 0 smtp \
$rblsmtpd /usr/sbin/magic-smtpd 2>&1 \
| $logger &"



存在するユーザのみメールの受信を受け取るには下記2つのファイル(check_valid_usersとext_check_user_prog)を作成します。

# echo 'on' > /etc/magic-mail/control/auth_enable
# echo 'on' > /etc/magic-mail/control/check_valid_users
# echo '/home/vpopmail/bin/vchkpw' > /etc/magic-mail/control/ext_check_passwd_prog
# echo '/etc/magic-mail/bin/vpopmail-check-user.sh' > /etc/magic-mail/control/ext_check_user_prog






Posted at 2009/05/15 11:08:01 | コメント(0) | トラックバック(0) | Debian GNU/Linux | パソコン/インターネット
2009年05月15日 イイね!

【Debian】ntpdate (時刻合わせ)

 
サーバの時刻はずれてきます。NTPサーバーを参照して定期的にコンピュータの時刻を合わせることにします。

ntpdateをインストール

# apt-get install ntpdate


時刻合わせ

東京大学のNTPサーバーはntp.nc.u-tokyo.ac.jpを使って、時間を合わせる場合。
# ntpdate ntp.nc.u-tokyo.ac.jp

16 May 00:07:12 ntpdate[25825]: adjust time server 130.69.251.23 offset -0.322489 sec


定期的に時刻合わせを行うように設定


# vi /etc/cron.d/ntpdate

* 0 * * * root ntpdate -s ntp.nc.u-tokyo.ac.jp > /dev/null 2>&1

Posted at 2009/05/15 10:17:58 | コメント(1) | トラックバック(0) | Debian GNU/Linux | 日記
2009年05月10日 イイね!

【Debian】qmail + vpopmail

競合するパッケージのアンインストール

exim4-daemon-lightはqmailと競合するので削除する。
# apt-get remove exim4-daemon-light


ucspi-tcp-srcのインストール

# apt-get install ucspi-tcp-src


作業ディレクトリの入力を求められるが、そのまま「Enter」
ucspi-tcpのビルド

# build-ucspi-tcp


This script unpacks the ucspi-tcp-src source into a directory, and
compiles it to produce a binary ucspi-tcp*.deb file.

The directory where this is done will end up containing the source
and package files for the ucspi-tcp binary package, along with a
directory containing the unpacked source.

Enter a directory where you would like to do this [/tmp/ucspi-tcp]



ビルドがうまく行くと,以下のようなメッセージが出る。

It seems that all went ok

Do you want to remove all files in /tmp/ucspi-tcp,
except ucspi-tcp_0.88-15_i386.deb now? [Yn]
Yを入力する。/tmp/qmail以下でdebファイル以外の全ファイルが削除される。


続いてすぐにdebパッケージをインストールするか聞かれる。

Do you want to install ucspi-tcp_0.88-15_i386.deb now? [Yn]
Yを入力する。


uscpi-tcp-srcパッケージを消すか聞かれる

Do you want to purge ucspi-tcp-src now? [yN]
Nを入力する。


Remember that you can install ucspi-tcp_0.88-15_i386.deb
on other computers so you don't need to compile it again.

Good luck!



qmail-srcのインストール





# apt-get install qmail-src



Warning: The home dir /var/qmail/alias you specified can't be accessed: そのようなファイルやディレクトリはありません
Adding system user `alias' (UID 64010) ...
Adding new user `alias' (UID 64010) with group `nogroup' ...
Not creating home directory `/var/qmail/alias'.
Warning: The home dir /var/qmail you specified can't be accessed: そのようなファイルやディレクトリはありません
Adding system user `qmaild' (UID 64011) ...
Adding new user `qmaild' (UID 64011) with group `nogroup' ...
Not creating home directory `/var/qmail'.
Warning: The home dir /var/qmail you specified can't be accessed: そのようなファイルやディレクトリはありません
Adding system user `qmails' (UID 64012) ...
Adding new user `qmails' (UID 64012) with group `qmail' ...
Not creating home directory `/var/qmail'.
Warning: The home dir /var/qmail you specified can't be accessed: そのようなファイルやディレクトリはありません
Adding system user `qmailr' (UID 64013) ...
Adding new user `qmailr' (UID 64013) with group `qmail' ...
Not creating home directory `/var/qmail'.
Warning: The home dir /var/qmail you specified can't be accessed: そのようなファイルやディレクトリはありません
Adding system user `qmailq' (UID 64014) ...
Adding new user `qmailq' (UID 64014) with group `qmail' ...
Not creating home directory `/var/qmail'.
Warning: The home dir /var/qmail you specified can't be accessed: そのようなファイルやディレクトリはありません
Adding system user `qmaill' (UID 64015) ...
Adding new user `qmaill' (UID 64015) with group `nogroup' ...
Not creating home directory `/var/qmail'.
Warning: The home dir /var/qmail you specified can't be accessed: そのようなファイルやディレクトリはありません
Adding system user `qmailp' (UID 64016) ...
Adding new user `qmailp' (UID 64016) with group `nogroup' ...
Not creating home directory `/var/qmail'.
#
一瞬あせるが、これで問題ないようだ。

qmailのビルドと、インストール

# build-qmail


作業ディレクトリの入力を求められるので、そのまま「Enter」
This script unpacks the qmail source into a directory, and
compiles it to produce a binary qmail*.deb file.

The directory where this is done will end up containing the source
and package files for the qmail binary package, along with a
directory containing the unpacked source.

!* WARNING *!
There have been reports of undesired behavior when attempting to
build qmail in a directory on a tmpfs based filesystem. Please do
not try to build on an tmpfs filesystem.

Enter a directory where you would like to do this [/tmp/qmail]


ビルドがうまく行くと,以下のようなメッセージが出る。

It seems that all went ok

Do you want to remove all files in /tmp/qmail,
except qmail_1.03-47_i386.deb now? [Yn]
Yを入力する。/tmp/qmail以下でdebファイル以外の全ファイルが削除される。


続いてすぐにdebパッケージをインストールするか聞かれる。

Do you want to install qmail_1.03-47_i386.deb now? [Yn]
Yを入力する。


qmail-srcパッケージを消すかと聞いてくる。
Do you want to purge qmail-src now? [yN]
Nを入力する。


Remember that you can install qmail_1.03-47_i386.deb
on other computers so you don't need to compile it again.

Don't forget to setup a /etc/qmail/rcpthosts file to prevent open relaying!

Good luck!


/var/qmail/controls ファイルの編集


# echo mx.hoge.jp > /var/qmail/control/me
# echo hoge.jp > /var/qmail/control/defaultdomain
# echo localhost > /var/qmail/control/locals
# echo mx.hoge.jp >> /var/qmail/control/locals
# echo hoge.jp > /var/qmail/control/plusdomain
# echo localhost > /var/qmail/control/rcpthosts
# echo hoge.jp >> /var/qmail/control/rcpthosts


エイリアスを定義する

# cd ~alias
#touch .qmail-postmaster .qmail-mailer-daemon .qmail-webmaster .qmail-root
# chmod 644 .qmail*

# echo '&hoge@hoge.jp' >.qmail-postmaster
# echo '&hoge@hoge.jp' >.qmail-mailer-daemon
# echo '&hoge@hoge.jp' >.qmail-webmaster
# echo '&hoge@hoge.jp' >.qmail-root


Maildirの作成


各ユーザにsuして作成
$ maildirmake ~/Maildir


新規ユーザ登録のとき自動的に作れるようにする
maildirmake /etc/skel/Maildir


SMTP 接続用の tcpserver ルールを作成

# vi /etc/tcp.smtp


/etc/tcp.smtp の内容。

127.0.0.1:allow,RELAYCLIENT=""
192.168.:allow,RELAYCLIENT=""
:allow


tcpserver の接続制御データベースを作成する。中継を許可したいネットワークを追加した場合には tcp.smtp.cdb を再作成する。
# tcprules /etc/tcp.smtp.cdb /etc/tcp.smtp.tmp < /etc/tcp.smtp


qmail 起動
# /etc/init.d/qmail start


qmail関係のプロセスが起動されたことを確認する
# ps ax | grep qmail

10481 pts/0 S 0:00 qmail-send
10482 pts/0 S 0:00 splogger qmail 2
10483 pts/0 S 0:00 qmail-lspawn ./Maildir/
10485 pts/0 S 0:00 qmail-rspawn
10487 pts/0 S 0:00 qmail-clean
10489 pts/0 S 0:00 /usr/bin/tcpserver -R -H -u 64011 -g 65534 -x /etc/tcp.smtp.cdb 0 smtp /usr/sbin/qmail-smtpd
10490 pts/0 S 0:00 splogger qmail 2
10493 pts/0 S+ 0:00 grep qmail


SMTP 接続チェック

# telnet localhost smtp

Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 mx.hoge.jp ESMTP


QUITを入力
QUIT
221 mx.hoge.jp
Connection closed by foreign host.



vpopmail のインストール


実行に必要なグループとユーザを作成する。
# groupadd vchkpw
# useradd -g vchkpw -d /home/vpopmail -m -s /bin/true vpopmail


vpopmailの入手し解凍する。入手先はこちら(http://inter7.com/vpopmail/
# bzip2 -cd vpopmail-5.4.27.tar.bz2 | tar xvf -


コンパイルと、インストール
# ./configure --enable-logging=y \
--enable-relay-clear-minutes=40 \
--enable-roaming-users=y \
--enable-tcpserver-file=/etc/tcp.smtp \
--enable-logging=y

# make

# make install-strip


POP3 接続用の tcpserver ルールを作成

# vi /etc/tcp.pop3


/etc/tcp.pop3 の内容。

:allow


tcpserver の接続制御データベースを作成する。
# tcprules /etc/tcp.pop3.cdb /etc/tcp.pop3.tmp < /etc/tcp.pop3


/etc/init.d/qmail の pop3 に関する箇所を追記


# Uncomment the following lines to automatically start the pop3 server
sh -c "start-stop-daemon --start --quiet --user root \
--pidfile /var/run/tcpserver_pop3d.pid --make-pidfile \
--exec /usr/bin/tcpserver -- -l0 -R -H -x /etc/tcp.pop3.cdb \
0 pop3 /usr/sbin/qmail-popup mallet.jp \
/home/vpopmail/bin/vchkpw \
/usr/sbin/qmail-pop3d Maildir &"



# Uncomment the following line if you have enabled the pop3 server
start-stop-daemon --user root --stop --quiet --oknodo --pidfile /var/run/tcpserver_pop3d.pid --exec /usr/bin/tcpserver


qmail 再起動
# /etc/init.d/qmail restart


POPへのアクセス後一定時間経ったらSMTPの許可リストをクリアするために、cronで一定の周期でプログラムを実行させる。
# vi /etc/cron.d/clearopensmtp

*/10 * * * * root /home/vpopmail/bin/clearopensmtp 2 >&1 > /dev/null


# /etc/init.d/cron restart



POP3 接続チェック

# telnet localhost pop3

Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
+OK <14548.1241951655@hoge.jp>


QUITを入力
QUIT
+OK
Connection closed by foreign host.


qmail + vpopmail によるバーチャルドメイン管理


新規ドメインの追加

# cd ~vpopmail
# ./bin/vadddomain hoge.jp
Please enter password for postmaster:*********
enter password again:*********


新規ユーザの追加

# ./bin/vadduser hoge@hoge.jp
Please enter password for postmaster:*********
enter password again:*********



qmailadmin のインストール


qmailadmin を入手し解凍する。入手先はこちら(http://inter7.com/qmailadmin/
# gzip -cd qmailadmin-1.2.12.tar.gz | tar xvf -


コンパイルと、インストール

# ./configure \
--enable-htmldir=/home/www/htdocs \
--enable-cgibindir=/home/www/cgi-bin/qmailadmin \
--enable-cgipath=/cgi-bin/qmailadmin/qmailadmin \
--enable-imagedir=/home/www/htdocs/cgi-img/qmailadmin \
--enable-imageurl=/cgi-img/qmailadmin \
--enable-ezmlmdir=n \
--enable-maxmailinglists=0 \
--enable-autoresponder-bin=n \
--enable-autoresponder-path=n

# make clean
# make
# make install-strip


アクセスしてみる。



apache2 の設定にて、内部からのみアクセスできるようにする

# vi /etc/apache2/conf.d/qmailadmin

<Directory "/home/www/cgi-bin/qmailadmin">
<Files "qmailadmin">
order deny,allow
deny from all
allow from 127.0.0.1
allow from 192.168.1
</Files>
</Directory>

Posted at 2009/05/10 13:31:13 | コメント(0) | トラックバック(0) | Debian GNU/Linux | パソコン/インターネット
2009年05月10日 イイね!

【Debian】apt

sources.list の書き換え


vi /etc/apt/sources.list


書き換え前
#
# deb cdrom:[Debian GNU/Linux 5.0.1 _Lenny_ - Official Multi-architecture amd64/i386/powerpc NETINST #1 20090413-22:38]/ lenny main

#deb cdrom:[Debian GNU/Linux 5.0.1 _Lenny_ - Official Multi-architecture amd64/i386/powerpc NETINST #1 20090413-22:38]/ lenny main

deb http://ftp.jp.debian.org/debian/ lenny main
deb-src http://ftp.jp.debian.org/debian/ lenny main

deb http://security.debian.org/ lenny/updates main
deb-src http://security.debian.org/ lenny/updates main

deb http://volatile.debian.org/debian-volatile lenny/volatile main
deb-src http://volatile.debian.org/debian-volatile lenny/volatile main


書き換え後
#
# deb cdrom:[Debian GNU/Linux 5.0.1 _Lenny_ - Official Multi-architecture amd64/i386/powerpc NETINST #1 20090413-22:38]/ lenny main

#deb cdrom:[Debian GNU/Linux 5.0.1 _Lenny_ - Official Multi-architecture amd64/i386/powerpc NETINST #1 20090413-22:38]/ lenny main

deb http://ftp.jp.debian.org/debian/ lenny main contrib non-free
deb-src http://ftp.jp.debian.org/debian/ lenny main contrib non-free

deb http://security.debian.org/ lenny/updates main contrib
deb-src http://security.debian.org/ lenny/updates main contrib

deb http://volatile.debian.org/debian-volatile lenny/volatile main contrib
deb-src http://volatile.debian.org/debian-volatile lenny/volatile main contrib



# apt-get clean
# apt-get update

Posted at 2009/05/10 13:18:15 | コメント(2) | トラックバック(0) | Debian GNU/Linux | パソコン/インターネット
2009年05月09日 イイね!

【Debian】Apache2

Apache2 インストール

# apt-get install apache2


とりあえず動作させる為の設定

/etc/apache2/sites-available/defaultファイルを変更

# cd /etc/apache2/sites-available/
# cp default default.org
# vi default


defaultファイルの以下の箇所を、任意のディレクトリに変更

DocumentRoot /var/www/

<Directory /var/www/>

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin/">



userdirを有効にする

userdirモジュールを組み込みます。
# a2enmod userdir


php5を組み込み

# aptitude install libapache2-mod-php5
# aptitude clean
/etc/apache2/mods-enabled/に、php5.loadとphp5.confが作成される。

設定の確認

# apache2ctl configtest
Syntax OK


Apache2を再起動

# /etc/init.d/apache2 restart
Posted at 2009/05/09 11:20:23 | コメント(0) | トラックバック(0) | Debian GNU/Linux | パソコン/インターネット

プロフィール

「[整備] #CR-Vハイブリッド 走行中テレビが見れる ナビ操作 ができるキット https://minkara.carview.co.jp/userid/154254/car/2987639/6220900/note.aspx
何シテル?   02/13 15:28
ひなり♂です。(*`・ω・´*)ノ 平成16年生まれ。ソフトテニスとバトミントンをやってます。
みんカラ新規会員登録

ユーザー内検索

<< 2025/6 >>

1234567
891011121314
15161718192021
22232425262728
2930     

ブログカテゴリー

リンク・クリップ

キャロウェイ ELYTE ♦♦♦ TD DRIVER  
カテゴリ:その他(カテゴリ未設定)
2025/05/04 20:54:30
PROCEED DOUBLE-R SF FW 
カテゴリ:その他(カテゴリ未設定)
2025/05/04 20:54:23
PROCEED DOUBLE-R SB-UT 
カテゴリ:その他(カテゴリ未設定)
2025/05/04 20:54:15

愛車一覧

ホンダ ZR-V ホンダ ZR-V
2023年10月5日(木)納車 【タイプ】e:HEV Z 【駆動】4WD 【定員】5名 ...
ホンダ ライフ ホンダ ライフ
サブ
ホンダ モビリオスパイク ホンダ モビリオスパイク
義妹の車
日産 グロリア 日産 グロリア
生まれてはじめて買った。中古の430グロリアってやつです。
ヘルプ利用規約サイトマップ
© LY Corporation