分类 电脑 下的文章

在postfix里配置多域名的本地用户收件箱

环境:centos6,postfix

步骤:
1.vi /etc/postfix/virtual # 编辑用户映射表

2.内容如下:

admin1@domain1.com admin1
admin2@domain2.com admin2

3.vi /etc/postfix/main.cf # 编辑 postfix 的配置文件,添加或编辑 virtual_alias_domains 如,

virtual_alias_maps = hash:/etc/postfix/virtual
virtual_alias_domains=domain1.com, domain2.com

4.postmap /etc/postfix/virtual # 生成新的映射表

5.postfix reload # 重载postfix配置,让新设置生效

参考:http://techslides.com/mail-server-for-multiple-domains-with-postfix

Magento2 配置 Varnish 后返回 503 错误

现象:经营中的magento2商城,在启用varnish后,网站前台访问返回503错误。

尝试:按magento2的帮助文档,可能是因为商城的商品多,varnish的 http_resp_hdr_lenhttp_resp_size 值不够大。

1.vi /usr/lib/systemd/system/varnish.service # 编辑 centos8 里的varnish systemd 启动配置文件

2.默认的配置内容可能有以下,将http_resp_hdr_lenhttp_resp_size的值往大一轮调

ExecStart=/usr/sbin/varnishd -a :6082 -f /etc/varnish/default.vcl -s malloc,1G 
-p http_resp_hdr_len=256k -p http_resp_size=290k -p workspace_backend=256k -p w
orkspace_client=256k

3.重载 varnish systemd 后重启 varnish 服务,magento2 前台访问正常了

参考:

zen-cart 1.3.9 后台管理菜单部分汉字显示为????

现象:zen-cart 1.3.9 中文程序网站,后台管理菜单部分汉字显示为????。

尝试:从phpmyadmin里,看到configuration数据表的汉字能正常显示。将 includes/classes/db/mysql/query_factory.php 文件中的mysql查询强制使用utf8字符集。如:

if (@mysql_select_db($zf_database, $this->link)) { 
$this->db_connected = true; 
// *** UTF8 Connection Add [BEGIN] *** 
mysql_query(“SET NAMES ‘utf8′”, $this->link); 
mysql_query(“SET CHARACTER SET UTF8″, $this->link); 
// *** UTF8 Connection Add [END] *** 
return true; 
} else { 
$this->set_error(mysql_errno(),mysql_error(), $zp_real); 
return false; 
} 

参考:

zen-cart 1.3.9 启用 https 后管理后台无法登录或更改设置

现象:zen-cart 1.3.9 版本,启用 https 后,管理后台无法登录,填写用户名和密码后提交,会返回登录框。

尝试:管理后台的配置文件 /your_renamed_admin/includes/configure.php ,其中的 http 网址参数要用 https的,如:

define('HTTP_SERVER', 'https://www.YOUR_SHOP.com');
define('HTTPS_SERVER', 'https://www.YOUR_SHOP.com');
define('ENABLE_SSL', 'true'); 

https://www.zen-cart.com/content.php?56-how-do-i-enable-ssl-after-i-have-installed-zen-cart