如何阿帕奇被允许发送电子邮件? [英] How can apache be allowed to send email?

查看:280
本文介绍了如何阿帕奇被允许发送电子邮件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我运行的Apache 2.2和PHP 5.3的一个CentOS 6.2虚拟机,我试图从通过PHP的mail()函数发送电子邮件。我可以从CLI发送电子邮件没有问题,但是PHP尝试,当它失败。在sendmail的日志如下:

I have a CentOS 6.2 virtual machine running Apache 2.2 and PHP 5.3 that I'm trying to send email from via PHP's mail() function. I can send email from the CLI without problems but when PHP tries it fails. In the sendmail log is the following:

Oct  9 11:42:03 localhost sendmail[3080]: NOQUEUE: SYSERR(apache): can not chdir(/var/spool/clientmqueue/): Permission denied

它看起来像阿帕奇无权这样做,但我不知道如何解决它。我发现这个,但没有具体的有很多的讨论够我在做什么,我可以用。任何帮助将是AP preciated。
谢谢!

It seems like Apache doesn't have permission to do this but I'm not sure how to fix it. I've found a lot discussion about this but nothing specific enough to what I'm doing that I could use. Any help would be appreciated. Thanks!

推荐答案

首先,你必须检查是否许可​​是否正确。这里是下面的权限在我的系统

First you have to check if permission are correct. Here is the permission below in my system

#ls -l命令/usr/sbin/sendmail.sendmail
-R-XR-SR-X根smmsp /usr/sbin/sendmail.sendmail

#ls -l命令的/ var /阀芯/ clientmqueue
drwxrwx --- smmsp smmsp的/ var /阀芯/ clientmqueue

如果您的权限或所有权是错误的,然后使用chown和CHMOD更改。

If your permissions or ownership is wrong then change it using chown and chmod.

如果上面是正确的,然后禁用SELinux或者如果你想启用SELinux的使用chcon命令来设置正确的SELinux上下文。

If the above is right then disable selinux or if you want selinux enabled use chcon to set the correct selinux context.

<一个href=\"http://docs.fedoraproject.org/en-US/Fedora/13/html/Security-Enhanced_Linux/sect-Security-Enhanced_Linux-Working_with_SELinux-SELinux_Contexts_Labeling_Files.html\" rel=\"nofollow\">http://docs.fedoraproject.org/en-US/Fedora/13/html/Security-Enhanced_Linux/sect-Security-Enhanced_Linux-Working_with_SELinux-SELinux_Contexts_Labeling_Files.html

有关禁用SELinux的临时使用 0 #setenforce

For disabling selinux temporarily use #setenforce 0

这篇关于如何阿帕奇被允许发送电子邮件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆