Magento一次安装,多处使用(多站点同后台)

2,723次阅读
没有评论

共计 5783 个字符,预计需要花费 15 分钟才能阅读完成。

Magento SIDhttpd.conf Can Override php.ini »关于Magento一次安装,多处使用的构想
WordPress可以一次安装,多处使用,Magento当然更有理由这么做了。

Magento 强大的功能之一就是run multi websites,Magento内置了多站点运行的功能。我援引从WordPress安装管理探索出的经验,觉得即使Magento内置multi websites功能,各站点还是不要使用同一个document root为好,还是以一主多副软连接的方式为宜。

只是,我还是没有找到在后台隔离各站点的办法(假设它们由不同的web manager来经营)。我也无法控制上传目录,所有上传得文件都是存放在主域名的document root/{magento installatin path}/media下。

好在magento子目录安装,根目录显示还是做得到的。如将magento放置在document root/magento下,但前台url不出现magento,具体的做法是

1. 把index.php和.htaccess移到document root,其他文件都放置在document root/magento子目录

2. 把index.php修改成

/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* [url]http://opensource.org/licenses/osl-3.0.php[/url]
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email]license@magentocommerce.com[/email] 该E-mail地址已受到防止垃圾邮件机器人的保护,您必须启用浏览器的Java Script才能看到。 so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Magento to newer
* versions in the future. If you wish to customize Magento for your
* needs please refer to [url]http://www.magentocommerce.com[/url] for more information.
*
* @category   Mage
* @package    Mage
* @copyright  Copyright (c) 2008 Irubin Consulting Inc. DBA Varien ([url]http://www.varien.com[/url])
* @license    [url]http://opensource.org/licenses/osl-3.0.php[/url]  Open Software License (OSL 3.0)
*/

if (version_compare(phpversion(), ‘5.2.0′, ‘<’)===true) {
echo  ‘
Whoops, it looks like you have an invalid PHP version.

Magento supports PHP 5.2.0 or newer. Find out how to install Magento using PHP-CGI as a work-around.
’;
exit;
}

$mageFilename = ‘magento/app/Mage.php’;

if (!file_exists($mageFilename)) {
if (is_dir(’downloader’)) {
header(”Location: downloader”);
} else {
echo $mageFilename.” was not found”;
}
exit;
}

require_once $mageFilename;

#Varien_Profiler::enable();

#Mage::setIsDeveloperMode(true);

#ini_set(’display_errors’, 1);

umask(0);
Mage::run(’default’);

3. 把.htaccess修改成:

############################################
## uncomment these lines for CGI mode
## make sure to specify the correct cgi php binary file name
## it might be /cgi-bin/php-cgi

#    Action php5-cgi /cgi-bin/php5-cgi
#    AddHandler php5-cgi .php

############################################
## GoDaddy specific options

#   Options -MultiViews

## you might also need to add this line to php.ini
##     cgi.fix_pathinfo = 1
## if it still doesn’t work, rename php.ini to php5.ini

############################################
## this line is specific for 1and1 hosting

#AddType x-mapp-php5 .php
#AddHandler x-mapp-php5 .php

############################################
## default index file

DirectoryIndex index.php

############################################
## adjust memory limit

#    php_value memory_limit 64M
php_value memory_limit 128M
php_value max_execution_time 18000

############################################
## disable magic quotes for php request vars

php_flag magic_quotes_gpc off

############################################
## disable automatic session start
## before autoload was initialized

php_flag session.auto_start off

############################################
## enable resulting html compression

#php_flag zlib.output_compression on

###########################################
# disable user agent verification to not break multiple image upload

php_flag suhosin.session.cryptua off

###########################################
# turn off compatibility with PHP4 when dealing with objects

php_flag zend.ze1_compatibility_mode Off

###########################################
# disable POST processing to not break multiple image upload

SecFilterEngine Off
SecFilterScanPOST Off

############################################
## enable apache served files compression
## [url]http://developer.yahoo.com/performance/rules.html#gzip[/url]

# Insert filter
#SetOutputFilter DEFLATE

# Netscape 4.x has some problems…
#BrowserMatch ^Mozilla/4 gzip-only-text/html

# Netscape 4.06-4.08 have some more problems
#BrowserMatch ^Mozilla/4\.0[678] no-gzip

# MSIE masquerades as Netscape, but it is fine
#BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
# Don’t compress images
#SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary

# Make sure proxies don’t deliver the wrong content
#Header append Vary User-Agent env=!dont-vary

############################################
## make HTTPS env vars available for CGI mode

SSLOptions StdEnvVars

############################################
## enable rewrites

Options +FollowSymLinks
RewriteEngine on

############################################
## you can put here your magento root folder
## path relative to web root

#RewriteBase /magento/

############################################
## workaround for HTTP authorization
## in CGI environment

RewriteRule .* – [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

############################################

#This is my creation for installing magento under a subfolder.

############################################

RewriteCond %{REQUEST_URI} ^/(media|skin|js)/

RewriteRule (.*) magento/$1 [l]

############################################
## always send 404 on missing files in these folders

RewriteCond %{REQUEST_URI} !^/(media|skin|js)/

############################################
## never rewrite for existing files, directories and links

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l

############################################
## rewrite everything else to index.php

RewriteRule .* index.php [L]

############################################
## Prevent character encoding issues from server overrides
## If you still have problems, use the second line instead

AddDefaultCharset Off
#AddDefaultCharset UTF-8

############################################
## Add default Expires header
## [url]http://developer.yahoo.com/performance/rules.html#expires[/url]

ExpiresDefault “access plus 1 year”

############################################
## By default allow all access

Order allow,deny
Allow from all

############################################
## If running in cluster environment, uncomment this
## [url]http://developer.yahoo.com/performance/rules.html#etags[/url]

#FileETag none

正文完
 0
评论(没有评论)

空瓶子部落

文章搜索
推荐阅读
手把手搭建私人音乐库!这款Docker神器让你跨平台畅听无损音质

手把手搭建私人音乐库!这款Docker神器让你跨平台畅听无损音质

兄弟们有没有这样的烦恼?网易云灰掉的歌单、QQ音乐受限的海外曲库、手机电脑多个设备 音乐库不同步…...
丰田生产方式:标准作业

丰田生产方式:标准作业

文章来源:网络
全局设备效率OEE详解

全局设备效率OEE详解

▲生产线设备效率实时监控 利用OEE的一个最重要目的就是减少一般制造业所存在的六大损失:停机损失、换装调试损失...
5s这样做,能提升管理,更能强化意识!

5s这样做,能提升管理,更能强化意识!

对于工厂而言,因为目视管理与5S可培育员工自主管理的意识,达成强化企业体质的目的。 因此,可以说目视管理与5S...
QC七大手法

QC七大手法

一、检查表(Check Sheet) 1. 定义:检查表就是将需要检查的内容或项目一一列出,然后定期或不定期的...
最新文章
群晖 Let’s Encrypt 泛域名证书自动更新

群晖 Let’s Encrypt 泛域名证书自动更新

目前acme协议版本更新,开始支持泛域名(wildcard),也就是说,可以申请一个类似*.domain.co...
可以卸载TV Box 了,这款支持「绅士模式」的影视神器你值得拥有

可以卸载TV Box 了,这款支持「绅士模式」的影视神器你值得拥有

还在为找优秀片源难、广告多、平台会员太贵而烦恼?今天给大家挖到一款真正的影视宝藏工具——小猫影视! 作为开源免...
【收藏】一次性解决TV点播/直播自由

【收藏】一次性解决TV点播/直播自由

很多时候,资源就在面前,但是我们视而不见,因为长久的安逸,已经让人失去动手的兴趣。但是每次我需要挨个切换APP...
OpenWrt 存储空间扩容的两种方案

OpenWrt 存储空间扩容的两种方案

说明:当我们通过群晖 VMM 虚拟机安装 Open­Wrt 时,默认会分配一个 10GB 的存储空间,而实际情...
OpenWrt修改IP地址两种方法(直接命令修改跟后台修改)

OpenWrt修改IP地址两种方法(直接命令修改跟后台修改)

OpenWrt是什么?OpenWrt一般常见于无线路由器(软路由)第三方固件,它是一个高效、可靠、功能多的路由...
热门文章
提高过程能力指数(CP/CPK)的途径

提高过程能力指数(CP/CPK)的途径

编者按:过程能力指数(CP/CPK)想必各位质量人都耳熟能详、运用自如,质量工程师之家前期也共享过数篇关于过程...
SPC控制图的八种模式分析

SPC控制图的八种模式分析

SPC控制图有八种模式,即八种判断异常的检验准则,每一种检验准则代表一种异常现象,应用SPC控制图进行过程评估...
测量高手放大招:圆跳动测量技巧总结

测量高手放大招:圆跳动测量技巧总结

01. 前言 在五金机加工厂实际的测量工作中,经常碰到要求测量两个要素的圆跳动问题, 利用不同的测量辅件及夹具...
过程能力分析(CP&cpk)

过程能力分析(CP&cpk)

引入过程能力分析的目的? 在我们现有的管理过程中,我们经常会遇到有些具体指标总是不尽人意,存在许多需要改进的地...
新能源汽车 “两会”精神宣贯会

新能源汽车 “两会”精神宣贯会

此次和大家分享新能源汽车相关政策: [embeddoc url=”https://www.ctro...
最新评论
多乐士 多乐士 通过摸索发现ssh拉取会报错,直接网页访问下载会报404错误,不知道原因;但是可以通过群晖CM注册表访问下载,其方法如下: Container Manager-注册表-设置-新增-注册表名称随便写,注册表URL填你的加速地址,勾选信任的SSL自我签署证书,登录信息不填-应用-使用你的地址,这是注册表会显示了,在搜索栏中输入映像名称,搜索结果在每一页的最后一个,你需要划到最后一个进行下载,实测可正常下载安装。 以上供网友参考。
多乐士 多乐士 还有一个比较简单的方法,只是需要一些外部工具。 1、讲损毁硬盘取出,装入外部移动硬盘 2、打开Diskgenius,定位到硬盘 3、格式化系统分区 4、重新插入硬盘 5、存储池->修复存储池即可
多乐士 多乐士 写的不错的文章
辞了老衲 辞了老衲 这个确实有帮助。
渋驀 渋驀 当然任何时候都可以用curl命令和crontab来实现动态更新DDNS的ip地址: 1、安装crontab之后为root用户创建文件/var/spool/cron/root 2、创建并配置ddnsupdate.sh,放到/usr/bin/文件下,文件内容(以he.net为例): Autodetect my IPv4/IPv6 address: IPV4:curl -4 "http://dyn.example.com:password@dyn.dns.he.net/nic/update?hostname=dyn.example.com" IPV6:curl -6 "http://dyn.example.com:password@dyn.dns.he.net/nic/update?hostname=dyn.example.com" 3、添加执行权限chomod +x /usr/bin/ddnsupdate.sh 4、编辑root用户的crontab:*/10 * * * * /usr/binddnsupdate.sh,每10分钟执行一次。好了,可以享受你的DDNS了
21410 21410 请问下载链接在那里?
madkylin madkylin 不错,不错,谢谢分享了,好东西啊 :lol:
feilung feilung 求方法
zengsuyi zengsuyi 应该挺不错的
zise zise 看看是怎么操作的。。 :oops: