简体   繁体   English

可以将magento安装到非公共目录中吗?

[英]Possible to install magento into a non-public directory?

I have several websites in my / 我在我的几个网站/

I publish the websites into /website folder (from the root) and i don't want to publish all in website/magento . 我将网站发布到/website文件夹(从根目录开始),并且我不想将所有website/magento发布在website/magento I would like to publish only the essentials in website/magento for security reasons. 出于安全原因,我只想在website/magento发布要点。

Is it possible? 可能吗? How should I do it? 我该怎么办?

I have read: 我读过了:
Magento; Magento; private/public filesystem layer 私有/公共文件系统层

but it's not exactly what I am asking. 但这不完全是我要的。

Thanks 谢谢

I am not sure, should test, I think it should be possible. 我不确定,应该测试,我认为应该可行。

In index.php change 在index.php中更改

$mageFilename = 'app/Mage.php';

to

$mageFilename = '../app/Mage.php';

The essential things are skin, media, downloader, errors, js folders about others I am not sure. 基本内容是我不确定的皮肤,媒体,下载器,错误,关于其他人的js文件夹。

I am not sure whether you need this at all, because file you want to protect and covered by chmod and .htaccess 我不确定是否完全需要此文件,因为要保护的文件由chmod和.htaccess保护

Modify .htaccess file which is available in Magento root directory like below: 修改Magento根目录中可用的.htaccess文件,如下所示:

<Directory /website/magento >
   deny from all
   allow from 192.168.0.50
</Directory>

This directive will protect the magento folder from everybody except 192.168.0.50 IP address which is this IP can use magento. 该指令将保护magento文件夹,从不同的是此IP可使用的Magento 192.168.0.50的IP地址每一个人。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM