Openwebmail. 安裝 openwebmail 必要套件 yum -y install gcc perl-Text-Iconv perl-CGI perl- YAML...

21
openwebmail

Transcript of Openwebmail. 安裝 openwebmail 必要套件 yum -y install gcc perl-Text-Iconv perl-CGI perl- YAML...

Page 1: Openwebmail. 安裝 openwebmail 必要套件 yum -y install gcc perl-Text-Iconv perl-CGI perl- YAML perl-CPAN perl-suidperl httpd service httpd start chkconfig httpd.

openwebmail

Page 2: Openwebmail. 安裝 openwebmail 必要套件 yum -y install gcc perl-Text-Iconv perl-CGI perl- YAML perl-CPAN perl-suidperl httpd service httpd start chkconfig httpd.

安裝 openwebmail 必要套件• yum -y install gcc perl-Text-Iconv perl-CGI perl-

YAML perl-CPAN perl-suidperl httpd• service httpd start• chkconfig httpd on

Page 3: Openwebmail. 安裝 openwebmail 必要套件 yum -y install gcc perl-Text-Iconv perl-CGI perl- YAML perl-CPAN perl-suidperl httpd service httpd start chkconfig httpd.

下載 openwebmail 所有程式 ( 主要是 .pl) tar ball

• cd /tmp; rm -rf /tmp/*• mkdir /tmp/op; cd /tmp/op• wget http://mylady.tw/public/linux/op/openwebmail-current.tar.gz• tar -xvz -f openwebmail-current.tar.gz

Page 4: Openwebmail. 安裝 openwebmail 必要套件 yum -y install gcc perl-Text-Iconv perl-CGI perl- YAML perl-CPAN perl-suidperl httpd service httpd start chkconfig httpd.

將 .pl 與設定檔搬到 /var/www

• mv cgi-bin/openwebmail /var/www/cgi-bin/• cp -r data/openwebmail /var/www/html• mv data /var/www• rm -rf /tmp/op

Page 5: Openwebmail. 安裝 openwebmail 必要套件 yum -y install gcc perl-Text-Iconv perl-CGI perl- YAML perl-CPAN perl-suidperl httpd service httpd start chkconfig httpd.

設定 .pl 的 權限為 4755

• cd /var/www/cgi-bin/openwebmail• chmod 4755 openwebmail*.pl – set uid runtime 時 , 一般 user 暫時變為 file

owner• 再將 wrapsuid.pl permission > 660– chmod 660

/var/www/cgi-bin/openwebmail/misc/tools/wrapsuid/wrapsuid.pl

Page 6: Openwebmail. 安裝 openwebmail 必要套件 yum -y install gcc perl-Text-Iconv perl-CGI perl- YAML perl-CPAN perl-suidperl httpd service httpd start chkconfig httpd.

原 /usr/bin/suidperl perm 為 0755, 4555

• ll /usr/bin/suidperl > 請改為 4555• chmod 4555 /usr/bin/suidperl– 還記得 set uid 嗎 ? 參考 ll /usr/bin/passwd, run

time 時變成 root

Page 7: Openwebmail. 安裝 openwebmail 必要套件 yum -y install gcc perl-Text-Iconv perl-CGI perl- YAML perl-CPAN perl-suidperl httpd service httpd start chkconfig httpd.

建立 openwebmail 的 log file

• touch /var/log/openwebmail.log• ll /var/log/openwebmail.log– -rw-r--r-- root root /var/log/openwebmail.log

• chown root:mail /var/log/openwebmail.log• ll /var/log/openwebmail.log– -rw-r--r-- root mail /var/log/openwebmail.log

Page 8: Openwebmail. 安裝 openwebmail 必要套件 yum -y install gcc perl-Text-Iconv perl-CGI perl- YAML perl-CPAN perl-suidperl httpd service httpd start chkconfig httpd.

copy redirect.html 到 /var/www/html/index.html就不用打很長的網址

• http://axp1.csie.ncu.edu.tw– http://

axp1.csie.ncu.edu.tw/cgi-bin/openwebmail/openwebmail.pl

• cp -p /var/www/html/openwebmail/redirect.html /var/www/html/index.html– (cp -p 檔案的擁有者屬性也複製過去 )

• 可以看一下 index.html 的 refresh content 就是 /cgi-bin/openwebmail/openwebmail.pl

Page 9: Openwebmail. 安裝 openwebmail 必要套件 yum -y install gcc perl-Text-Iconv perl-CGI perl- YAML perl-CPAN perl-suidperl httpd service httpd start chkconfig httpd.

修改 openwebmail.conf• vim /var/www/cgi-bin/openwebmail/etc/openwebmail.conf

– ow_cgidir >> cgi 檔預設目錄 , 改到 /var/www/cgi-bin/openwebmail– ow_htmldir >> html 檔預設目錄 , 改到 /var/www/data/openwebmail– default_language en >> # 改成中文版:

default_language zh_TW.Big5

Page 10: Openwebmail. 安裝 openwebmail 必要套件 yum -y install gcc perl-Text-Iconv perl-CGI perl- YAML perl-CPAN perl-suidperl httpd service httpd start chkconfig httpd.

複製預設認證檔到 /var/www/cgi-bin/openwebmail/etc/.

• cp /var/www/cgi-bin/openwebmail/etc/defaults/auth_unix.conf /var/www/cgi-bin/openwebmail/etc/.

• 修改認證檔 auth_unix.conf 的– passwdfile_encrypted & passwdmkdb, 其他不用改

• vim /var/www/cgi-bin/openwebmail/etc/auth_unix.conf– passwdfile_encrypted /etc/master.passwd >>>

passwdfile_encrypted /etc/shadow– passwdmkdb /usr/sbin/pwd_mkdb >>> none

Page 11: Openwebmail. 安裝 openwebmail 必要套件 yum -y install gcc perl-Text-Iconv perl-CGI perl- YAML perl-CPAN perl-suidperl httpd service httpd start chkconfig httpd.

copy 預設 dbm.conf 到 正確的資料夾

• cp /var/www/cgi-bin/openwebmail/etc/defaults/dbm.conf /var/www/cgi-bin/openwebmail/etc/.

• vim /var/www/cgi-bin/openwebmail/etc/dbm.conf– 三個參數值 , 請改為 :• .pag

noneno

Page 12: Openwebmail. 安裝 openwebmail 必要套件 yum -y install gcc perl-Text-Iconv perl-CGI perl- YAML perl-CPAN perl-suidperl httpd service httpd start chkconfig httpd.

openwebmail 初始化• cd /var/www/cgi-bin/openwebmail/– ./openwebmail-tool.pl --init

Page 13: Openwebmail. 安裝 openwebmail 必要套件 yum -y install gcc perl-Text-Iconv perl-CGI perl- YAML perl-CPAN perl-suidperl httpd service httpd start chkconfig httpd.

產生 openwebmail 的 Template 樣板

• perl -MCPAN -e 'install HTML::Template‘– yes

( 跑蠻久的 )

Page 14: Openwebmail. 安裝 openwebmail 必要套件 yum -y install gcc perl-Text-Iconv perl-CGI perl- YAML perl-CPAN perl-suidperl httpd service httpd start chkconfig httpd.

win7 開兩個 IE test

• win7 開兩個 IE– http://www.qlapita.com

[email protected] & [email protected] 互寄

Page 15: Openwebmail. 安裝 openwebmail 必要套件 yum -y install gcc perl-Text-Iconv perl-CGI perl- YAML perl-CPAN perl-suidperl httpd service httpd start chkconfig httpd.

aa & bb 第一次 login 的 page左 aa, 右 bb

Page 16: Openwebmail. 安裝 openwebmail 必要套件 yum -y install gcc perl-Text-Iconv perl-CGI perl- YAML perl-CPAN perl-suidperl httpd service httpd start chkconfig httpd.

先不用改

Page 17: Openwebmail. 安裝 openwebmail 必要套件 yum -y install gcc perl-Text-Iconv perl-CGI perl- YAML perl-CPAN perl-suidperl httpd service httpd start chkconfig httpd.
Page 18: Openwebmail. 安裝 openwebmail 必要套件 yum -y install gcc perl-Text-Iconv perl-CGI perl- YAML perl-CPAN perl-suidperl httpd service httpd start chkconfig httpd.

剛剛用 outlook 寄的 email 還在

Page 20: Openwebmail. 安裝 openwebmail 必要套件 yum -y install gcc perl-Text-Iconv perl-CGI perl- YAML perl-CPAN perl-suidperl httpd service httpd start chkconfig httpd.
Page 21: Openwebmail. 安裝 openwebmail 必要套件 yum -y install gcc perl-Text-Iconv perl-CGI perl- YAML perl-CPAN perl-suidperl httpd service httpd start chkconfig httpd.