Due to tight security restrictions we can't host the admin.php file on our live server. As a result I need to be able to run EE from two locations: One from a dev server (where we include the admin.php file for access to the EE panel) and another from our live server, where we will not include the admin.php file. We only need to serve content there, not manipulate it.

Both the live and dev servers have access to the same DB.

Has anyone done something like this before? Is it possible? If so, what are the details for making this work?

up vote 4 down vote accepted

Yes it will work, just use the same database config (you'll need to use the full name of the database server rather than 'localhost').

When you have the dev site installed and working just copy the files over to your live server.

You will then need to update a number of paths in various parts of the system. For this I would suggest using Focus Labs Config to set up different config files for each environment in which the site will run.

You might want to look at using a Git repo to keep files in sync.

However, for the record, simply removing admin.php won't stop access to the site's CP. Just hit the system directory and it will load up. I'm curious as to why your host is saying you can't have the admin.php file.

  • It's not our host, it's us. We've been attacked before, so we tend to be extra cautious. As for the system directory, I've also changed the name and put it above web root. – Brandon Durham Aug 7 '13 at 1:55

I cannot say I've done this before, but what I would attempt to do is the following:

  1. Make a duplicate install of your live ExpressionEngine code on a separate location of your dev server, separate from your dev environment.
  2. Ensure the config point your database to the live server. Then use this install uniquely for the Control Panel.
  3. You'll want to make sure there is nothing preventing a database connection from your dev environment. You may need to change your database host from '127.0.0.1' to specify the live host.
  4. If you have issues with links, set a rewrite rule on your live site to redirect anything pointing to admin.php or /system to the dev server; assuming your dev server has protection from the outside world it should not pose a problem.

You'll also want to make sure you keep both versions of the code in sync going forward, especially any updates to EE or add-ons.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.