去掉Magento2 管理后台的提示

去掉Magento2 管理后台的提示,大多数在配置服务器时有遇到过,网站服务器安全提示信息,很吓人的,有些客户可能不能接受,这里找了一个应急的方式
Your web server is set up incorrectly and allows unauthorized access to sensitive files. Please contact your hosting provider
magento2-web-server-error

vendor/magento/module-admin-notification/Model/System/Message/Security.php

if ($this->_isFileAccessible()) {
// return true;
return false;
}

这样就不会出现提示,这种提示,应该是/etc/下的 权限问题,这个只是隐藏

另一种方式
1.shh- Run the following command from your root account.
chown -R accountuser:accountusergroup /path-to-root-folderl/
==================================================
2. ssh - Run the following command from the domain account user(not your web server account such as apache etc).

find . -type d -exec chmod 770 {} ; & find . -type f -exec chmod 660 {} ; && chmod u+x bin/magento
chmod -R g+w /path-to-root-folderl/{pub,var}
chmod -R g+w /path-to-root-folderl/{app/etc,vendor}
chmod -R g+s pub/static pub/media .
find var/generation -type d -exec chmod g+s {} ;
find var/session -type d -exec chmod g+s {} ;
==================================================
3.ssh - Run the following command from your root account.
chown -R domain_account_user:webservergroup /path-to-root-folderl/var
chown -R domain_account_user:webservergroup /path-to-root-folder/app/etc
chown -R domain_account_user:webservergroup /path-to-root-folderl/pub
chown -R webserverUSER:webservergroup /path-to-root-folder/var/session

发表评论
Magento2 技术支持 上门服务

工作时间
周一至周六
9:00-18:00
相关咨询电话
15360669780
侨海科技