WordPress 在 Linux 下不能发送邮件的问题

本博客迁移到现在的 VPS 上已是两年有余,在有评论到来时从来就没收到过提醒邮件,以前是放在租的主机上,所以那些都有人配置好了的。其实一直没把 WordPress 未能发送邮件的问题放心上,自己收不到倒无所谓,但评论者接收邮件提醒算是件重要的事。

今天一同事说我的博客无法进行评论,我一段时间以来只有一丝感觉为何这么久没人评论了,只想大家都不爱说话罢了,并未意思到博客本身的问题,也在此表示感谢。于是自己测试了下,登陆用户评论没问题,游客无法评论,最后查到是 wpDiscuz 与 Math Comment Spam Protection 插件起冲突了,于是把后者禁用了就没问题。至于评论提交后响应有些慢是由于不得不用的 Akismet 插件的原因。

为评论的问题既然登陆到了 VPS 上了,也顺便把两年来的邮件发送问题也诊断一下,其实做来很简单,就是当初配置 VPS 时少做了一步。当前所用的 Linux 发行版是  Debian,之前记录过一篇 Debian Linux VPS 为 WordPress 的系统准备,其中提到 WordPress 发送邮件用的是 exim4,

所以第一步,修改 /etc/exim4/update-exim4.conf.confdc_eximconfig_configtype 的值由 'local' 改成 'internet'

dc_eximconfig_configtype='internet'

然后重启 exim4 服务,可用命令 service exim4 restart阅读全文 >>

转载于:https://my.oschina.net/u/2791/blog/851935

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
抱歉,我是一个AI语言模型,无法为您提供可靠的Linux脚本。但是,以下是一个简单的脚本,用于在Linux上自动部署LNMP和WordPress: ```bash #!/bin/bash # Update and upgrade packages sudo apt-get update sudo apt-get upgrade -y # Install Nginx sudo apt-get install nginx -y # Install MySQL sudo apt-get install mysql-server -y # Install PHP and related modules sudo apt-get install php-fpm php-mysql php-gd php-xml php-curl php-mbstring -y # Configure Nginx sudo rm /etc/nginx/sites-available/default sudo cat > /etc/nginx/sites-available/default <<EOF server { listen 80 default_server; listen [::]:80 default_server; root /var/www/html; index index.php index.html index.htm; server_name _; location / { try_files $uri $uri/ /index.php?$args; } location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; } } EOF # Restart Nginx sudo systemctl restart nginx # Create WordPress database and user mysql -u root -p <<EOF CREATE DATABASE wordpress; CREATE USER 'wordpressuser'@'localhost' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON wordpress.* TO 'wordpressuser'@'localhost'; FLUSH PRIVILEGES; EOF # Download and extract WordPress cd /var/www/html sudo curl -O https://wordpress.org/latest.tar.gz sudo tar -zxvf latest.tar.gz sudo rm latest.tar.gz # Configure WordPress cd /var/www/html/wordpress sudo mv wp-config-sample.php wp-config.php sudo sed -i "s/database_name_here/wordpress/g" wp-config.php sudo sed -i "s/username_here/wordpressuser/g" wp-config.php sudo sed -i "s/password_here/password/g" wp-config.php # Set permissions sudo chown -R www-data:www-data /var/www/html/wordpress sudo chmod -R 755 /var/www/html/wordpress # Clean up sudo apt-get autoclean sudo apt-get autoremove -y ``` 请注意,这只是一个简单的脚本,可能需要根据您的配置进行修改。在运行脚本之前,请确保备份您的数据并了解脚本的工作原理。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值