解决openwebmail出错无法访问的问题[ubuntu,linux]

在上一篇文章中openwebmail套件包安装完成, 但是实际上并不能真正成功运行, 还需要做以下内容的调整, 据wwufengg实际操作, 经过如下调整后, 成功访问openwebmail是不成问题的.以下的文章是转自郭工的文章, 很精采,也很实用, 共拜读之:

现在打开浏览器中输入http://ip/cgi-bin/openwebmail/openwebmail.pl看看结果。假如无法正常显示网页,请继续向下看:
首次安装openwebmail的朋友肯定会遇到问题。本人自己曾遇到过很多问题,要么编译错误,要么无法正常显示登录界面。要么就是登录验证失败等等等等…………一大堆问题!下面你可以看看常见的问题及排除方法。

常见问题排解:

1、安装过程中提示:
sending report…
Couldn’t open SMTP servers 127.0.0.1 at port 25! at cgi-bin/openwebmail/openwebmail-tool.pl line 1520.

解决方法:
你需要检查sendmail有无正常安装并且正在运行。
检查方法:netstat -tulnp |grep :25看是否有在运行。如果确认已经安装并在运行,则要检查你的防火墙策略,比如建议先清除掉防火墙所有规则再进行测试。

解决openwebmail出错无法访问的问题[ubuntu,linux]

如图示,即可确定这个sendmail正常运行.

2、打开浏览器中输入http://ip/cgi-bin/openwebmail/openwebmail.pl并不能显示出登录窗口。


解决方法:
我们还要设置apache(httpd)对openwebmail的支持,也就是调试阶段。由于apache2默认配置网页主目录为/var/www/下面。因此我们需要配合这个设置,以便于apache2能够找到我们的openwebmail.pl文件:

 root@testsendmail:/var/www# vi /etc/apache2/sites-available/default 修改这个文件

 

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/              改成ScriptAlias /cgi-bin/ /var/www/cgi-bin/
改成
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all

解决openwebmail出错无法访问的问题[ubuntu,linux]

保存后,/etc/init.d/apache2 restart  重启apache2服务。

3、不能正常显示图标

这是因为连接不到自己的图片文件夹

你需要修改/var/www/cgi-bin/openwebmail/etc/openwebmail.conf
ow_htmlurl              /openwebmail  改为:/data/openwebmail

4、访问: http://localhost/cgi-bin/openwebmail/openwebmail.pl
系统提示:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server ……

解决方法:

使用perl命令直接编译如下文件。

root@netren:/var /www# perl /var/www/cgi-bin/openwebmail/misc/tools/wrapsuid/wrapsuid.pl /var/www/cgi-bin/openwebmail/openwebmail*

然后,所有openwebmail*.pl文件的权限变成0755了,所以还要做
root@netren:/var/www# chmod 4755 /var/www/cgi-bin/openwebmail/openwebmail*.pl

 

5、登录遇到的问题:
首先默认不能用root进行登录是正常的,我们新建或使用已经存在的其他用户进行登录  提示:

登录失败
认证系统内部错误,请回到登录页面 再试一次

解决方法:
修改 /usr/local/www/cgi-bin/openwebmail/etc/default/auth_unix.conf

passwdfile_plaintext    /etc/passwd
passwdfile_encrypted   /etc/master.passwd   修改为    passwdfile_encrypted    /etc/shadow
passwdmkdb             /usr/sbin/pwd_mkdb   修改为   passwdmkdb              none
保存退出。

6、发送邮件后,对方显示发件人主机不正常 :@后面不是我想要的域名
解决方法:
修改/usr/local/www/cgi-bin/openwebmail/etc/openwebmail.conf
domainnames             auto  #将auto修改为你的域名如:netren.org

基本上,现在你可以正常使用openwebmail系统了

其他:

openwebmail setuid root出错,perl怎样才能支持SUIDPERL
访问: http://localhost/cgi-bin/openwebmail/openwebmail.pl
系统提示:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, root@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.

分析一:
看日志tail -f /var/log/httpd/error_log错误提示如下:
[Tue Jul 12 15:56:56 2005] [error] [client 127.0.0.1] Premature end of script headers: openwebmail.pl
[Tue Jul 12 15:56:56 2005] [error] [client 127.0.0.1] (2)!!!!!!!!!!!!!!!!!!: exec of ‘/var/www/cgi-bin/openwebmail/openwebmail.pl’ failed
好象是执行/var/www/cgi-bin/openwebmail/openwebmail.pl失败,所以手工执行此文件:
[root@localhost www]# /var/www/cgi-bin/openwebmail/openwebmail.pl
bash: /var/www/cgi-bin/openwebmail/openwebmail.pl: /usr/bin/suidperl: bad interpreter: 没有那个文件或目录
现在问题明朗了,是/var/www/cgi-bin/openwebmail/openwebmail.pl调用/usr/bin/suidperl这个文件失败,因为系统根本没有/usr/bin/suidperl这个文件。解决的办法很简单修改/var/www/cgi-bin/openwebmail/所有openwebmail*.pl文件中“#!/usr/bin/suidperl -T”为“#!/usr/bin/perl”(后来发现openwebmail带的文档中提到suidperl的问题,可以重新编译perl来实现suidperl我没有实验,只是根据文档里面猜测的)
访问: http://localhost/cgi-bin/openwebmail/openwebmail.pl
系统提示与以前相同,日志提示改变:
[Tue Jul 12 16:28:06 2005] [error] [client 127.0.0.1] Premature end of script headers: openwebmail.pl
[Tue Jul 12 16:28:06 2005] [error] [client 127.0.0.1] Can’t do setuid

分析二:
重新认真读openwebmail带的文档发现如下如下解决方法:
perl /var/www/cgi-bin/openwebmail/misc/tools/wrapsuid/wrapsuid.pl /var/www/cgi-bin/openwebmail/
访问: http://localhost/cgi-bin/openwebmail/openwebmail.pl
系统提示:
Software error:
Can’t locate Text/Iconv.pm in @INC (@INC contains: /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 . /var/www/cgi-bin/openwebmail) at shares/iconv.pl line 7.
BEGIN failed–compilation aborted at shares/iconv.pl line 7.
For help, please send mail to the webmaster (root@localhost), giving this error message and the time and date of the error.

分析三:
阅读文档得到如下答案:
iconv是用来支持多国的字集转换功能,但可能在编辑时有错
cp /var/www/cgi-bin/openwebmail/misc/patches/iconv.pl.fake /var/www/cgi-bin/openwebmail/shares/iconv.pl
访问: http://localhost/cgi-bin/openwebmail/openwebmail.pl
系统提示:
Please execute ‘/var/www/cgi-bin/openwebmail/openwebmail-tool.pl –init’ on server first!

分析四:
提示什么就做什么,在命令行下执行
/var/www/cgi-bin/openwebmail/openwebmail-tool.pl –init
提示如下
[root@localhost openwebmail]# /var/www/cgi-bin/openwebmail/openwebmail-tool.pl –init
Please change ‘/var/www/cgi-bin/openwebmail/etc/dbm.conf’ from
dbm_ext                 .db
dbmopen_ext             none
dbmopen_haslock         no
to
dbm_ext                 .db
dbmopen_ext             .db
dbmopen_haslock         no
And execute ‘/var/www/cgi-bin/openwebmail/openwebmail-tool.pl –init’ again!
ps: If you are running openwebmail in persistent mode,
don’t forget to ‘touch openwebmail*.pl’, so speedycgi
will reload all scripts, modules and conf files in –init

分析五:
去修改/var/www/cgi-bin/openwebmail/etc/dbm.conf这个文件发现没有这个文件。没有就新建,内容为:
dbm_ext                 .db
dbmopen_ext             .db
dbmopen_haslock         no
然后再执行一次/var/www/cgi-bin/openwebmail/openwebmail-tool.pl –init
访问: http://localhost/cgi-bin/openwebmail/openwebmail.pl
系统提示:
‘/var/www/cgi-bin/openwebmail/.openwebmail.pl’ must setuid to root

分析六:
原来刚才执行perl /var/www/cgi-bin/openwebmail/misc/tools/wrapsuid/wrapsuid.pl /var/www/cgi-bin/openwebmail/后,所有openwebmail*.pl文件的s位没有了。所以
chmod 4755 /var/www/cgi-bin/openwebmail/openwebmail*.pl
访问: http://localhost/cgi-bin/openwebmail/openwebmail.pl
OK,可以看到登陆框了,说明openwebmail已经安装成功了。

官方建议的安装步骤: http://openwebmail.org/openwebmail/download/doc/readme.txt

原文链接:https://www.cnblogs.com/wwufengg/articles/openwebmail-error.html
本文来源 爱码网,其版权均为 原网址 所有 与本站无关,文章内容系作者个人观点,不代表 本站 对观点赞同或支持。如需转载,请注明文章来源。

© 版权声明

相关文章