Chinaunix首页 | 论坛 | 博客
  • 博客访问: 387505
  • 博文数量: 120
  • 博客积分: 5051
  • 博客等级: 大校
  • 技术积分: 1255
  • 用 户 组: 普通用户
  • 注册时间: 2007-07-03 01:25
文章分类

全部博文(120)

文章存档

2011年(2)

2010年(11)

2009年(28)

2008年(26)

2007年(53)

我的朋友

分类: LINUX

2007-12-12 15:26:55

Openwebmail安装步聚

1)download following packages from

CGI.pm-3.05.tar.gz
MIME-Base64-3.01.tar.gz
libnet-1.19.tar.gz
Text-Iconv-1.2.tar.gz
Authen-PAM-0.14.tar.gz
Digest-1.08.tar.gz
Digest-MD5-2.33.tar.gz
openwebmail-2.52.tar.gz

2)install the above software

install CGI
tar -zxvf CGI.pm-3.05.tar.gz
cd CGI.pm-3.05
perl Makefile.PL
make
make install

install MiME
cd MIME-Base64-3.01
perl Makefile.PL
make
make install

install libnet
cd libnet-1.19
perl Makefile.PL (ans 'no' if asked to update configuration)
make
make install

install Text_Iconv
tar -zxvf libiconv-1.9.1.tar.gz
cd libiconv-1.9.1
./configure
make
make install

install Authen-PAM
tar -zxvf Authen-PAM-0.14.tar.gz
cd Authen-PAM-0.14
./configure
make
make install

install Digest-1.08
tar -zxvf Digest-1.08.tar.gz
cd Digest-1.08
./configure
make
make install

install Digest-MD5
tar -zxvf Digest-MD5-2.33.tar.gz
cd data
./configure
make
make install

install openwebmail
First : chmod 4755 /usr/bin/perl  (or chmod 4555 /usr/bin/suidperl)
Second : install as following steps:
        1. cd /var/www
        tar -zxvBpf openwebmail-X.XX.tar.gz
        mv data/openwebmail html/
        rmdir data

        2. cd /var/www/cgi-bin/openwebmail/etc

        modify auth_unix.conf from defaults/auth_unix.conf
        a. set passwdfile_encrypted to '/etc/shadow'
        b  set passwdmkdb           to 'none'

        modify openwebmail.conf
        a. set mailspooldir to '/var/spool/mail'
        b. set ow_htmldir   to '/var/www/html/openwebmail'
        set ow_cgidir    to '/var/www/cgi-bin/openwebmail'
        c. set spellcheck   to '/usr/bin/ispell -a -S -w "-" -d @@@DICTIONARY@@@ -p @@@PDICNAME@@@'
        d. change default_signature for your need
        e. other changes you want

        3. add
        /var/log/openwebmail.log {
                postrotate
                        /usr/bin/killall -HUP syslogd
                        endscript
        }
to /etc/logrotate.d/syslog to enable logrotate on openwebmail.log

4. execute /var/www/cgi-bin/openwebmail/openwebmail-tool.pl --init
This step will come several problem:
1)usr/bin/suidperl:symbol lookup error:/usr/bin/suidperl:undefined
Suggestion:
modify /var/www/cgi-bin/openwebmail/*.pl
#!/usr/bin/suidperl -T  to '#!/usr/bin/perl'

2)The init routine will test them and try to give you some useful suggestions.
it look as /etc/dbm.conf ...
Suggestion :
vi /var/www/cgi-bin/openwebmail/etc/dbm.conf
dbm_ext                 .db
dbmopen_ext             none
dbmopen_haslock         no
save amd exit

execute /var/www/cgi-bin/openwebmail/openwebmail-tool.pl --init again .

5)apache config
modify httpd.conf as following example:

AddHandler cgi-script .pl


ServerAdmin username@localhost.com
ServerName your ip address
Alias /cgi-bin/ "/var/www/cgi-bin/"
Alias /openwebmail/images/  "/var/www/html/images/"

Options ExecCGI
AllowOverride All
Order allow,deny
Allow from all



5)test openwebmail
in browser key ""
you will see a opemwebmail login window.

In this step ,you will seee the following error:

1)Software error:Undefined subroutine &ow::htmltext::str2html called at /var/www/cgi-    bin/openwebmail/shares/ow-shared.pl line 1283.
    For help, please send mail to the webmaster (you@example.com), giving this error message and     the time and date of the error.

Suggestion:
a) chmod 771 /var/www/cgi-bin/openwebmail/etc/sessions
b) vi /var/www/cgi-bin/openwebmail/openwebmail.pl
  at part of "require modules " add require "modules/htmltext.pl"

c)chmod 777 /var/log/openwebmail.log

2)Couldn't create File /var/log/openwebmail.log! (Permission denied)
Suggetion:
touch /var/log/openwebmail.log
chcon -u system_u /var/log/openwebmail.log
chcon -t httpd_sys_script_rw_t /var/log/openwebmail.log
chcon -t httpd_unconfined_script_exec_t /var/www/cgi-bin/openwebmail/openwebmail*

說明一下這個部分
touch /var/log/openwebmail.log <==這是產生一個log檔
chcon -u system_u /var/log/openwebmail.log <==這是修改檔案使用者權限
chcon -t httpd_sys_script_rw_t /var/log/openwebmail.log <==這是修改寫入權限
chcon -t httpd_unconfined_script_exec_t /var/www/cgi-bin/openwebmail/openwebmail* <==這是修改檔案由什麼套件專用這些都是因為SELinux造成的,原本檔案、目錄權限只有使用檔案前面那串(rwxrwxrwx),在使用SELinux後,會多出一種管理 context type,context type會限制該目錄、檔案的使用原則,所以,在使用有安裝SELinux時,常常會出現apach、ftp明明 都設定好了,卻還是不能使用,多半出問題,都是SELinux在做怪


The End!

阅读(2703) | 评论(0) | 转发(0) |
0

上一篇:Apache 配置详解

下一篇:如何生成SSL证书

给主人留下些什么吧!~~