我无法在同一台服务器上配置两个codeigniter安装

I'm trying to create a staging environment for my CI based webapp.

I have configured my main CI installation to work with Development and Production environments. Now I want to have a second CI installation on a sub-domain say stage.mysite.com which acts as an staging environment.

Ho do I configure my server or CI so that sub-domains work?

It turned out that it wasn't CodeIgniter installation, it was a permission issue.

My Host throws 500 when group permission is set to writable.

After doing a chmod 755 to the whole sub-domain directory the site started working normal.

This is wiered though.

In your /index.php add the following around line 23

switch($_SERVER['SERVER_NAME']){
    case "stage.mysite.com":
        define('ENVIRONMENT', 'stage');
    case "mysite.com":
        define('ENVIRONMENT', 'production');
    break;
    default:
        define('ENVIRONMENT', 'development');
    break;
}

Add this to your ERROR REPORTING section of index.php

if (defined('ENVIRONMENT'))
{
    switch (ENVIRONMENT)
    {
        case 'stage':
        case 'development':
            error_reporting(E_ALL);
        break;

        case 'production':
            error_reporting(0);
        break;

        default:
            exit('The application environment is not set correctly.');
    }
}

In your /application/config directory, create subdirectories for your environments

/application/config/development/
/application/config/stage/
/application/config/production/

Copy the config.php file from /application/config/ to the subdirectories and modify the base_url and encryption_key configs.

$config['base_url'] = 'http://stage.mysite.com';