Edjet LMS Server

Change installation URL (domain)

How to change installation domain (hostname) of the Edjet LMS Server already installed on your server.

Prerequisites

We assume the application to be properly configured on original server with IP / address entered during the installation process.

That is needed because you will have to access the Setup section via Administration in order to finish this tutorial (otherwise you will be incorrectly redirected by system and you will not be able to access the Setup section and modify the data in database).

If you are not able to match the prerequisites, please see the solution in Troubleshooting section below.

Synopsis

System was originally installed to „192.168.0.1“ and it was also a production domain where application was accessed.

Later we need to change the production domain – application should be available on „www.project.com“ in production.

Also, the application files will physically remain in original location (192.168.0.1).

How to change a production domain after installation

Follow these steps:

  1. Setup new DNS records for new production domain (www.project.com) first:
    A records for „www.project.com“ (and also possibly „project.com“ for non-www format) must be routing to IP of production server, where the instance is physically placed. In this case the records should looks like this:
    A record for www.project.com: 192.168.0.1
    A record for project.com: 192.168.0.1
    Note: propagate of new DNS records may take up to 24-48 hrs depending on DNS records update time setting (TTL cache)
  2. Log into Administration as an superadmin and navigate to Setup > Websites
  3. There should be one record with server name 192.168.0.1. Click Edit.
  4. On tab Basic properties please change ALL values 192.168.0.1 to your new production domain (www.project.com)
    Note: Please be careful on slashes. The mistake can cause the system to malfunction.
  5. When done click Save.
  6. Locate file <approot>/config/cfg.ini.php and open it for editing
    Note: please make sure to keep the encoding of the file at UTF-8 when rewriting the file!
  7. Look for keys "domain_noHttp" and "core_domain" - change BOTH values 192.168.0.1 to your new production domain (www.project.com)
    Note: Please be careful on slashes again.
  8. Save the file.
  9. To avoid the instace of system to be accessible on both addresses, which is not wanted as system can be configured to be correctly working only on one production domain at the same time, please modify <approot>/.htaccess file, as shown below:
  10. Locate second line with #WWW comment:
    #WWW
    ##RewriteCond …
    #WWW
    ##RewriteRule … [R=301,QSA,L]
  11. Add following lines to line under the second #WWW conditions:
    #redirect all queries to production domain
    RewriteCond %{HTTP_HOST} ^192.168.0.1$
    RewriteRule ^(.*)$ http://www.project.com/$1 [R=301,QSA,L]
  12. Save the .htaccess file
  13. Go to your cron folders, for example CRON.10minutes and locate launcher file and add new domain into task. Remove old one.

Troubleshooting

If you are not able to access the Admin section, use any available postgreSQL tool (PgAdminIII for example) to access the database directly. Locate table "settings", look for columns "domain", "repository", "domain_admin", "domain_io", "domain_noHttp" - change ALL values (should be 192.168.0.1) to your new production domain (www.project.com)

Note: Please be careful on slashes. The mistake can cause the system to malfunction.

Related