Seperate Subdomains for LMS and CMS

904 views
Skip to first unread message

Ricky Bland

unread,
Mar 15, 2015, 5:34:02 PM3/15/15
to edx-...@googlegroups.com
Hey,

Does anybody know how it's possible to set up separate subdomains for the LMS and CMS?

The ideal situation would be to have the LMS at courses.xxxxx.com  and the CMS at studio.xxxxxx.com, both on port 80.

I've been trying a whole variety of things for days and nothing seems to be working for me.

Any help would be greatly appreciated!

Regards,

Ricky

Nilesh Londhe

unread,
Mar 15, 2015, 6:47:47 PM3/15/15
to edx-...@googlegroups.com

To create create domain.com, studio.domain.com and preview.domain.com, would you please try this in your server-vars.yml and run update?

---

EDXAPP_SITE_NAME: 'domain.com'
EDXAPP_LMS_SITE_NAME: "{{ EDXAPP_SITE_NAME }}"
EDXAPP_LMS_BASE: "{{ EDXAPP_SITE_NAME }}"
EDXAPP_LMS_NGINX_PORT: 80
EDXAPP_LMS_SSL_NGINX_PORT: 443

EDXAPP_CMS_SITE_NAME: "studio.{{ EDXAPP_SITE_NAME }}"
EDXAPP_CMS_BASE: "{{ EDXAPP_CMS_SITE_NAME }}"
EDXAPP_CMS_NGINX_PORT: 80
EDXAPP_CMS_SSL_NGINX_PORT: 443

EDXAPP_PREVIEW_SITE_NAME: "preview.{{ EDXAPP_SITE_NAME }}"
EDXAPP_PREVIEW_LMS_BASE: "{{ EDXAPP_PREVIEW_SITE_NAME }}"
EDXAPP_LMS_PREVIEW_NGINX_PORT: 80

--
You received this message because you are subscribed to the Google Groups "General Open edX discussion" group.
To view this discussion on the web visit https://groups.google.com/d/msgid/edx-code/e795fe30-a200-4e38-a309-b88b28b00d84%40googlegroups.com.

Ricky Bland

unread,
Mar 15, 2015, 7:35:00 PM3/15/15
to edx-...@googlegroups.com
Hey Nilesh,

I updated server-vars.yml and ran updates. The cms/lms.env.json files updated at least with the new values,but no change when trying to access the site.


Also been playing with the /edx/app/nginx/sites-available files with a variety of options. Currently it stands as this:

upstream cms-backend {
            server
127.0.0.1:8010 fail_timeout=0;
   
}

server
{
 
# CMS configuration file for nginx, templated by ansible

    listen
80 ;

  server_name
~^((stage|prod)-)?studio.*;


Originally it was listening on port 18010. However, when I change it to 'listen 80' and restart nginx, I then can't access studio at all.

I don't suppose you'd have any other ideas?

I've seen many other sites using Open edX hosting their courses under class.domain.com or courses.domain.com, etc so it must be something very simple I'm overlooking!

Kind Regards,

Ricky

Ricky Bland

unread,
Mar 15, 2015, 8:29:38 PM3/15/15
to edx-...@googlegroups.com
Ah, step 1 complete! I've now got 'studio.domain.com' directing to the CMS on port 80. Turns out I didn't quite have the right DNS settings on AWS's Route 53.

To anybody else who's been wondering how to do the same:

In combination with the above 2 posts from me and Nilesh, on AWS's Route 53, I created a new record set with the following information:

Name: studio.domain.com
Type: A - IPv4 address
Alias: yes
Alias target: [name of EC2 instance I want to direct to]

Now, I just hope I can do the same with the LMS, and somehow direct *.domain.com to a custom site...

Nilesh Londhe

unread,
Mar 16, 2015, 1:23:03 AM3/16/15
to edx-...@googlegroups.com

I just re-confirmed with a successful ansible play on a brand new ubuntu precise box and find that my instructions I provided earlier worked for the following:

cd /var/tmp/configuration/playbooks/
ansible-playbook edx_sandbox.yml -c local -i 'localhost,' -...@mycustomserver-vars.yml

Look at /etc/nginx/sites-enabled/


total 8
drwxr-xr-x 2 root www-data 4096 Mar 15 21:12 .
drwxr-xr-x 5 root root     4096 Mar 15 21:12 ..
lrwxrwxrwx 1 root root       36 Mar 15 21:12 certs -> /edx/app/nginx/sites-available/certs
lrwxrwxrwx 1 root root       34 Mar 15 21:12 cms -> /edx/app/nginx/sites-available/cms
lrwxrwxrwx 1 root root       42 Mar 15 21:12 edx-release -> /edx/app/nginx/sites-available/edx-release
lrwxrwxrwx 1 root root       36 Mar 15 21:12 forum -> /edx/app/nginx/sites-available/forum
lrwxrwxrwx 1 root root       34 Mar 15 21:12 lms -> /edx/app/nginx/sites-available/lms
lrwxrwxrwx 1 root root       34 Mar 15 21:12 ora -> /edx/app/nginx/sites-available/ora
lrwxrwxrwx 1 root root       37 Mar 15 21:12 xqueue -> /edx/app/nginx/sites-available/xqueue

After a successful ansible play, you should note both lms and cms should contain this block

  listen 80 ;
  listen 443 ssl;

Nilesh Londhe

unread,
Mar 16, 2015, 5:26:56 PM3/16/15
to edx-...@googlegroups.com

Earlier, I missed one line that takes care of SSL for https://preview.domain.com so I added that in here.

---

EDXAPP_SITE_NAME: 'domain.com'
EDXAPP_LMS_SITE_NAME: "{{ EDXAPP_SITE_NAME }}"
EDXAPP_LMS_BASE: "{{ EDXAPP_SITE_NAME }}"
EDXAPP_LMS_NGINX_PORT: 80
EDXAPP_LMS_SSL_NGINX_PORT: 443

EDXAPP_CMS_SITE_NAME: "studio.{{ EDXAPP_SITE_NAME }}"
EDXAPP_CMS_BASE: "{{ EDXAPP_CMS_SITE_NAME }}"
EDXAPP_CMS_NGINX_PORT: 80
EDXAPP_CMS_SSL_NGINX_PORT: 443

EDXAPP_PREVIEW_SITE_NAME: "preview.{{ EDXAPP_SITE_NAME }}"
EDXAPP_PREVIEW_LMS_BASE: "{{ EDXAPP_PREVIEW_SITE_NAME }}"
EDXAPP_LMS_PREVIEW_NGINX_PORT: 80
EDXAPP_LMS_PREVIEW_SSL_NGINX_PORT: 443

Nilesh Londhe

unread,
Mar 17, 2015, 6:54:04 PM3/17/15
to edx-...@googlegroups.com

Indeed

domain.com
studio.domain.com
preview.domain.com

all A records need to point to that open edx box you set up

--
You received this message because you are subscribed to the Google Groups "General Open edX discussion" group.

Nilesh Londhe

unread,
May 11, 2015, 12:00:42 AM5/11/15
to edx-...@googlegroups.com

These work fine with latest but won’t when I stick to named-release/birch.

edx_platform_version:         'named-release/birch'
ora2_version:                 'named-release/birch'
certs_version:                'named-release/birch'
forum_version:                'named-release/birch'
xqueue_version:               'named-release/birch'
configuration_version:        'named-release/birch'

Does any one know what fixes it in later releases?

...

Medida Achyuth

unread,
Jan 16, 2018, 7:32:51 AM1/16/18
to General Open edX discussion
hey,does anyone know how to make the cms domain name without port number.

my domain name is studio.domain.com. i have configured the lms and cms files of nginx directory. my domain is working only with port number like studio.domain.com:80

how to setup a domain without a port number?
Reply all
Reply to author
Forward
0 new messages