PHPackages                             hmphu/magemulti - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. hmphu/magemulti

ActiveMagento-module[Utility &amp; Helpers](/categories/utility)

hmphu/magemulti
===============

Something that similar to Magento Go service :). This extension allow you host multiple clients on the same Magento codebase

0.1(9y ago)214OSL 3.0PHP

Since Nov 29Pushed 9y ago1 watchersCompare

[ Source](https://github.com/hmphu/magemulti)[ Packagist](https://packagist.org/packages/hmphu/magemulti)[ RSS](/packages/hmphu-magemulti/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

MAGENTO MULTI CLIENTS
=====================

[](#magento-multi-clients)

> Something that similar to Magento Go service :)
>
> This extension allow you host multiple clients on the same Magento codebase. Every single client has their own local.xml and modules/\*.xml directory. That means you can setting separate databases, caching services and modules per clients.

I. Installation
---------------

[](#i-installation)

### Via modman

[](#via-modman)

```
modman clone https://github.com/hmphu/magemulti.git
```

### Via composer

[](#via-composer)

```
{
    "require": {
        "hmphu/magemulti": "*",
    },
    "repositories": [
        {
            "type": "vcs",
            "url":  "https://github.com/hmphu/magemulti.git"
        }
    ]
}
```

II. Structure
-------------

[](#ii-structure)

Every clients will have seperate `config, media, cache, report, ...` directories under the `clients` directory. This prevents file collisions and lets you use a single CDN domain.

### Config directories

[](#config-directories)

```
{root}/clients/client1/etc
{root}/clients/client2/etc
...

```

### Media directories

[](#media-directories)

```
{root}/clients/client1/media
{root}/clients/client2/media
...

```

### Var directories

[](#var-directories)

```
{root}/clients/client1/var
{root}/clients/client1/var/cache
{root}/clients/client1/var/report
{root}/clients/client1/var/...

{root}/clients/client2/var
{root}/clients/client2/var/cache
{root}/clients/client2/var/report
{root}/clients/client2/var/...
...

```

III. Server settings
--------------------

[](#iii-server-settings)

1. **The `CLIENT_CODE` environment variable**

To make Magento work with the correct database and client's folder I had to modify the `index.php` and `Mage.php` files. This is done by two git patches in this repository and it will checks the `CLIENT_CODE` variable to know wich client this visited site is.

See index.php Mage::app()/Mage::run() is intialized.

```
require_once MAGENTO_ROOT . '/app/MageMulti.php';
Mage::run(MageMulti::getRunCode(), MageMulti::getRunType(), MageMulti::getRunOptions());

```

2. **NGINX configuration**

```
server {
  listen 80;
  server_name foostore.dev;
  root /var/www;
  location ~ .php$ {
    fastcgi_pass  unix:/var/run/php5-fpm.sock;
    fastcgi_param CLIENT_CODE foostore;
  }
  .....
}

```

Most of this is typical Magento Nginx config. The important lines are: `fastcgi_param CLIENT_CODE foostore;`

3. **APACHE configuration**

```

  ServerName foostore.dev
  DocumentRoot /var/www
  SetEnv CLIENT_CODE foostore

```

Most of this is typical Magento Apache config. The important lines are: `SetEnv CLIENT_CODE foostore`

*When you setup new domain and visit the site it will open the Magento Installation page and you can continue [setup your magento site](http://devdocs.magento.com/guides/m1x/install/installing_install.html). The module will create new directories and new `local.xml` file under the `clients` folder*

IV. CRON configuration
----------------------

[](#iv-cron-configuration)

Because Magento need to known the `CLIENT_CODE` to run exactly site so I had to created new `mcron.php` and `mcron.sh` files. This will looks for folders in `clients` folder which are `CLIENT_CODE`

So you have to setup your crontab to run `mcron.php` and `mcron.sh` instead of the default magento files (they are `cron.php` and `cron.sh`)

Example:

```
*/5 * * * * sh /var/www/mcron.sh
```

V. To Do
--------

[](#v-to-do)

- Tests and CI
- Shell script
- Make it work with [Aoe\_Scheduler](https://github.com/AOEpeople/Aoe_Scheduler) module
- Bash script to create new client sites

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3449d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/fd115d146c384a7b17ac22fe1a8c43409c2049e0fa74674896936aa9ade5c90f?d=identicon)[hmphu](/maintainers/hmphu)

---

Top Contributors

[![hmphu](https://avatars.githubusercontent.com/u/2835749?v=4)](https://github.com/hmphu "hmphu (7 commits)")

### Embed Badge

![Health badge](/badges/hmphu-magemulti/health.svg)

```
[![Health](https://phpackages.com/badges/hmphu-magemulti/health.svg)](https://phpackages.com/packages/hmphu-magemulti)
```

###  Alternatives

[inviqa/magento-symfony-container

Provides Magento with an instance of a Symfony DI Container

2436.5k](/packages/inviqa-magento-symfony-container)[tim-reynolds/magento-qconfig

Magento config quick search

513.0k](/packages/tim-reynolds-magento-qconfig)[fastly/cdn

Fastly CDN module for Magento 1.x

275.5k](/packages/fastly-cdn)[clerk/magento

Clerk.io Turns More Browsers Into Buyers

1029.4k](/packages/clerk-magento)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
