Ms7 Search
Google 搜尋 翻譯
calendar
« 九月 2024 »
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30            
近期文章
文章分類
網站連結
Syndicate

« | »

openwebmail 不使用 suidperl 的方式

2011-10-16 @ 12:44 in Linux

因為 fedora 15 已經不用 suidperl 所以必須使用不執行 suidperl  的方式,網路上找到的方法,確實可以執行,將其複製在這裏

以下內容來自: 遠古的記憶 http://zlnet.net/blog/?p=456

所以必須使用不執行suidperl的方式,安裝 OpenWebMail
http://openwebmail.org/openwebmail/download/release/
cpan:http://search.cpan.org/~lds/
==================================================
安裝套件(由 source 安裝)
首先請到
http://turtle.ee.ncku.edu.tw/openwebmail/download/packages/
下載上述的各個套件:

libiconv-1.13.1.tar.gz(http://hpux.connect.org.uk/)
(ftp://ftp.mirrorservice.org/pub/gnu/libiconv/libiconv-1.13.1.tar.gz)

CGI.pm-3.49.tar.gz
(http://search.cpan.org/CPAN/authors/id/L/LD/LDS/CGI.pm-3.49.tar.gz)

MIME-Base64-3.09
(http://search.cpan.org/CPAN/authors/id/G/GA/GAAS/MIME-Base64-3.09.tar.gz)

libnet-1.22
(http://search.cpan.org/CPAN/authors/id/G/GB/GBARR/libnet-1.22.tar.gz)

Text-Iconv-1.7
(http://search.cpan.org/CPAN/authors/id/M/MP/MPIOTR/Text-Iconv-1.7.tar.gz)
==================================================
安裝 CGI.pm 套件

# cd /tmp  
# tar -zxvf CGI.pm-3.45.tar.gz  
# cd CGI.pm-3.49  
# perl Makefile.PL  
# make
# make test  
# make install

註:可能您原本的機器上就已經安裝了 CGI.pm 這個套件,
不過由於有使用者回報 Open WebMail 如果使用太舊的 CGI.pm 版本,
會在上傳附件時, 發生當住的情形, 所以我們建議您安裝 2.74 以後或
是更新的版本。
檢查 CGI.pm 版本的方式如下:

# perl -MCGI -e 'print $CGI::VERSION'

==================================================
安 裝 MIME-Base64 套件

# cd /tmp  
# tar -zxvf MIME-Base64-3.09.tar.gz  
# cd MIME-Base64-3.09  
# perl Makefile.PL  
# make  
# make test  
# make install

註:雖然您的機器可能已經安裝了 MIME-Base64 這個套件,
還是建議您從 source 重新裝一次. 這樣做的話,
可以確定 MIME-Base64 中的 XS 支援有被啟動,
可以大幅地增加處理 MIME 附件編碼與解碼的速度 。
==================================================
安裝 libnet 套件

# cd /tmp  
# tar -zxvf MIME-Base64-3.09.tar.gz  
# cd MIME-Base64-3.09  
# perl Makefile.PL  
# make  
# make test  
# make install

==================================================
安裝 libiconv 套件
所有首先要確認系統上是否支援 iconv() 相關函式,方法如下

# man iconv

如果下完命令後沒有出現相關的 manpage 說明文件,
表示系統可能不支援 iconv() 相關函式, 不過別擔心,
我們可以透過安裝 libiconv 這個套件來替系統加上對 iconv() 的支援

# cd /tmp  
# tar -zxvf libiconv-1.9.1.tar.gz  
# cd libiconv-1.9.1  
# ./configure  
# make  
# make test  
# make install

現在再試一次 man iconv 確認 libiconv 已經被成功的安裝到系統之中
==================================================
安裝 Text-Iconv 套件

# cd /tmp  
# tar -zxvf Text-Iconv-1.7.tar.gz  
# cd Text-Iconv-1.7  
# perl Makefile.PL

註:如果您用的是 FreeBSD,或是您剛才用手動安裝 libiconv-1.9.1.tar.gz 這
個套件,請在執行 perl Makefile.PL 之前,先修改 Makefile.PL 檔案,
將 LIBS 和 INC 這兩行設定如下

'LIBS' => ['-L/usr/local/lib -liconv'],# e.g., '-lm'  
'INC' =>'-I/usr/local/include',# e.g., '-I/usr/include/other'
# make  
# make test
註:如果 make test 失敗,代表您的 OS 不支援 iconv()
這個功能或是 Makefile.PL 中的 LIB,INC 設定有誤。
您可以將 misc/patches/iconv.pl.fake 拷貝,到 iconv.pl
這個檔案上讓 openwebmail 不透過 iconv 進行字集轉換。
這樣 簡/繁轉換功能會還在,
但是會喪失如 自動轉換 UTF-8 格式信件的功能。
# make install

==================================================
==================================================
==================================================
將相關套件安裝後就開始安裝OpenWebMail
1.下載 OpenWebMail
網址:
http://openwebmail.org/openwebmail/download/release/

# cd /tmp  
# mkdir openwebmail  
# cd /tmp/openwebmail  
# tar -zxvBpf openwebmail-2.xx.tar.gzopenwebmail-2.xx.tar.gz
z:以gzip格式過濾歸檔,在執行的同時進行壓縮或解壓縮
x:解開壓縮檔內的檔案
v:顯示操作中的檔案
B:讀取全部的紀錄( for 4.2 BSD)
p(小寫p):紀錄文件關於權限的相關資訊
f:指定要解壓縮或壓縮的檔名

==================================================
2. 將檔案移到存放網頁的資料夾

# mv /tmp/cgi-bin/openwebmail/ /srv/www/cgi-bin/
# mv /tmp/data/openwebmail/ /srv/www/htdocs/

==================================================
3. 設定認證的類型

# cp /srv/www/cgi-bin/openwebmail/etc/defaults/auth_unix.conf \       
/srv/www/cgi-bin/openwebmail/etc/
# chgrp mail /srv/www/cgi-bin/openwebmail/etc/auth_unix.conf
  (因為使用cp複製檔案,群組權限會改變,所以將群組權限改回來)
# vi /srv/www/cgi-bin/openwebmail/etc/auth_unix.conf
將
passwdfile_encrypted /etc/master.passwd
改成
passwdfile_encrypted /etc/shadow
將
passwdmkdb /usr/sbin/pwd_mkdb
改成
passwdmkdb none

==================================================
4. 修改 dbm.conf 檔

# cp /srv/www/cgi-bin/openwebmail/etc/defaults/dbm.conf \
/srv/www/cgi-bin/openwebmail/etc/
# chgrp mail /srv/www/cgi-bin/openwebmail/etc/dbm.conf
(因為使用cp複製檔案,群組權限會改變,所以將群組權限改回來)
# vi /srv/www/cgi-bin/openwebmail/etc/dbm.conf
將
dbmopen_ext  none
改成
dbmopen_ext  .db

==================================================
5.

# vi /srv/www/cgi-bin/openwebmail/etc/openwebmail.conf
mailspooldir  /var/mail <=存放mail的資料夾
ow_cgidir   /usr/local/www/cgi-bin/openwebmail
改成
ow_cgidir   /srv/www/cgi-bin/openwebmail
(存放 cgi-bin/openwebmail 的資料夾)
ow_htmldir  /usr/local/www/data/openwebmail
改成
ow_htmldir  /srv/www/htdocs/openwebmail
(存放 data/openwebmail 的資料夾)

==================================================
6.關閉 suidperl

# vi /srv/www/cgi-bin/openwebmail/etc/defaults/suid.conf
has_savedsuid_support  yes
改成
has_savedsuid_support  no

==================================================
7.修改 openwebmail*.pl
將下列檔案的內容第一行,#!/usr/bin/suidperl -T
改成 #!/usr/bin/perl
(就是/srv/www/cgi-bin/openwebmail/openwebmail*.pl 的檔案)

# sed -i -e  '1c #!/usr/bin/perl' openwebmail*.pl
-i:直接修改讀取的檔案內容,而不是由螢幕輸出。
-e:直接在指令列模式上進行 sed 的動作編輯。
1C:取代,c 的後面接字串,這些字串可以取代 n1,n2 之間的行!
'1c #!/usr/bin/perl':
(表示把第一行的內容取代成 #!/usr/bin/perl)

# sed -i -e  '2a text1' openwebmail*.pl
2a :增加, a 的後面接字串,a 的前面為行數。
'2a text1':
(表示把在第二行的下一行(也就是第三行),增加字串text1)

# sed -n '1,2p' openwebmail*.pl
-n:顯示資料
'1,2p':將檔案內的,1至2行,資料顯示出來

==================================================
8.用 wrapsuid.pl 來將 openwebmail*.pl 都改成2進制檔

# cd /srv/www/cgi-bin/openwebmail/misc/tools/wrapsuid/
# perl wrapsuid.pl /srv/www/cgi-bin/openwebmail/openwebmail*.pl

==================================================
9. 經由 wrapsuid.pl所改變的檔案都變成 755,所以再把權限改回4755

# chmod 4755   /srv/www/cgi-bin/openwebmail/openwebmail*.pl

==================================================
10.測試是否有錯誤訊息

# /srv/www/cgi-bin/openwebmail/openwebmail.pl

==================================================
11.沒有錯誤訊息,就可以執行

# /srv/www/cgi-bin/openwebmail/openwebmail-tool.pl --init

==================================================
12.改變 http.conf 的設定

# vi /etc/httpd/httpd.conf
找到      
AllowOverride None      
Options None      
Order allow,deny      
Allow from all    
改成      
AllowOverride All      
Options ExecCGI      
Order allow,deny      
Allow from all
==================================================
測試OpenWebMail
http://your_server_hostname/cgi-bin/openwebmail/openwebmail.pl
參考資料
http://dslab.ee.ncku.edu.tw/~tung/openwebmail/advanced.html 

迴響

openwebmail 不使用 suidperl 的方式 | 豬窩

Greetings! I know this is kinda off topic but I was wondering if you knew where I could get a
captcha plugin for my comment form? I'm using the same
blog platform as yours and I'm having difficulty finding one?
Thanks a lot!

作者 website host @ 14:52, 2020-08-14

openwebmail 不使用 suidperl 的方式 | 豬窩

Hi there, You've done an incredible job. I will definitely digg it and personally recommend to my friends.
I'm sure they will be benefited from this website.

作者 best web hosting sites @ 19:39, 2020-08-14

openwebmail 不使用 suidperl 的方式 | 豬窩 | 3

Hey! This post couldn't be wrotten anyy better!
Readiing this post remins me of my previous room
mate! He always kept talking about this. I wipl forward this post
too him. Fairly certain he will have a good read.

Thank yyou for sharing!

作者 Young @ 21:16, 2023-02-19

openwebmail 不使用 suidperl 的方式 | 豬窩 | 3

I know this website gikves quality based posts annd
extrda information, is there anyy other sit whuch ggives such information inn quality?

作者 https://dev.xxxcrunch.com/top1961125613 @ 20:44, 2023-04-14

openwebmail 不使用 suidperl 的方式 | 豬窩 | 3

This piece of writing wjll assist the internet visitors for building up
nnew webseite or even a weblog from start tto end.

發表迴響
 authimage