Welcome Guest, Not a member yet? Register   Sign In
Configure CodeIgniter to run on two servers
#9

[eluser]TWP Marketing[/eluser]
Between my dev and live servers the only change I need to make is in (under WIN XP) the hosts file. I uncomment (dev) or comment (live) the declaration of my site url in hosts. For example:

Code:
in hosts file
...
#127.0.0.1 www.mysite.com

The # is the comment delimiter. I realize this is windows centric but it is far simpler than the code mods discussed above. I regret that I don't know if something similar is available under other OS's, but if you run under win, it works well and is quick. No guarantee that this works if you are using Vista...

Caveate: it requires that your local httpd.conf file contain virtual host definitions matching the live site installation. Use the same ServerName as in the hosts file, but this is simple to arrange. For example:

Code:
in httpd.conf file
...
<VirtualHost *>
ServerName www.mysite.com
DocumentRoot /www/docs/www.mysite.com
</VirtualHosts

The DocumentRoot param points to where your code resides on both the dev and live sites.
IT DOES NOT NEED TO BE THE SAME AS SERVERNAME.

If you can't control where the live site is installed, change your dev configuration to match the live site. This is a one-time-only change at the time of project setup.


Messages In This Thread
Configure CodeIgniter to run on two servers - by El Forum - 06-03-2009, 06:58 AM
Configure CodeIgniter to run on two servers - by El Forum - 06-04-2009, 02:32 PM
Configure CodeIgniter to run on two servers - by El Forum - 06-04-2009, 11:31 PM
Configure CodeIgniter to run on two servers - by El Forum - 06-05-2009, 01:16 AM
Configure CodeIgniter to run on two servers - by El Forum - 06-05-2009, 01:39 AM
Configure CodeIgniter to run on two servers - by El Forum - 06-05-2009, 01:51 AM
Configure CodeIgniter to run on two servers - by El Forum - 06-05-2009, 05:51 AM
Configure CodeIgniter to run on two servers - by El Forum - 07-01-2009, 12:05 PM
Configure CodeIgniter to run on two servers - by El Forum - 07-01-2009, 12:46 PM
Configure CodeIgniter to run on two servers - by El Forum - 07-01-2009, 12:58 PM
Configure CodeIgniter to run on two servers - by El Forum - 07-01-2009, 01:27 PM
Configure CodeIgniter to run on two servers - by El Forum - 07-01-2009, 02:19 PM
Configure CodeIgniter to run on two servers - by El Forum - 07-25-2009, 07:03 PM
Configure CodeIgniter to run on two servers - by El Forum - 07-26-2009, 06:44 AM
Configure CodeIgniter to run on two servers - by El Forum - 07-26-2009, 11:43 AM



Theme © iAndrew 2016 - Forum software by © MyBB