Change URL from 127.0.0.1 to URL that can be used from anywhere

Keywords: Moodle - Windows - How to - Domain Name (DNS)
Description:
I have the URL 127.0.0.1 after installing Bitnami Moodle but I want to change the URL so that I can access it from anywhere over the internet. Can someone assist me.

Hi @adriaanduplessis.dri,

Thanks for using Bitnami. You can use the Bitnami Configuration tool as mentioned in the next link to configure your website’s domain

https://docs.bitnami.com/installer/faq/linux-faq/configuration/understand-bnconfig/

It is possible you need to open the Apache ports on Windows to get remote requests. We also have a guide for this

https://docs.bitnami.com/installer/faq/windows-faq/administration/use-firewall-windows/

Ok, I feel like I’m using my mind. I have a linux machine running on AWS and I can’t find the application bnconfig. Has anyone been able to successfully alter moodle to use the hostname rather than the ip?

I found it on my testlink instance but it doesn’t seem to have done anything.

Using these instructions:

https://docs.bitnami.com/installer/faq/linux-faq/configuration/understand-bnconfig/

Hi @lreedick,

Thanks for using Bitnami. We removed the bnconfig tool on our recent assets because we are migrating the logic to a new installation format. You can get more information about this in the next link

https://docs.bitnami.com/aws/faq/get-started/understand-upcoming-changes/

In the specific case of Moodle, we didn’t had any problem with the current setup of allowing both a domain and a IP address. Can you give us more information on the issues you are having?

Hi and thanks for the response. I’d originally set up our moodle instance with the IP address as the domain hasn’t yet been established. I now have the domain name redirecting to the IP but the application is reverting to IP address once the domain name is resolved. See DMU.docmation.com

I’m trying to get the application to use the domain name rather than the IP address throughout.

Hi @lreedick,

We have a Support Tool that will gather relevant information for us to analyze your configuration and logs. Could you please execute it on the machine where the stack is running by following the steps described in the guide below?

Please note that you need to paste the code ID that is shown at the end.

Here is the code: e076d974-d235-a393-a6a5-87976326dac1

Hi @lreedick,

Thanks for sharing the bnsupport code with us. I did a quick check of the DNS configuration and the domain name you shared is pointing to a different IP address than the one for your server. Also, when I visit your website using the curl command line, I see there’s an NGINX instance doing a redirect to your server IP address, and I think that’s why you are getting the IP address back on your browser.

$ curl -LI "http://dmu.docmation.com"
HTTP/1.1 301 Moved Permanently
Server: nginx/1.18.0
Date: Wed, 02 Jun 2021 09:12:30 GMT
Content-Type: text/html; charset=iso-8859-1
Connection: keep-alive
Location: http://54.144.140.49/my/

HTTP/1.1 303 See Other
Date: Wed, 02 Jun 2021 09:12:30 GMT
Server: Apache/2.4.46 (Unix) OpenSSL/1.1.1d
X-Powered-By: PHP/7.3.27
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
X-Redirect-By: Moodle
Content-Language: en
Set-Cookie: MoodleSession=6ig1s28bjomn2tqff07ld5eufd; path=/
Location: http://54.144.140.49/login/index.php
Content-Type: text/html; charset=utf-8

HTTP/1.1 200 OK
Date: Wed, 02 Jun 2021 09:12:30 GMT
Server: Apache/2.4.46 (Unix) OpenSSL/1.1.1d
X-Powered-By: PHP/7.3.27
Content-Language: en
Content-Script-Type: text/javascript
Content-Style-Type: text/css
X-UA-Compatible: IE=edge
Cache-Control: private, pre-check=0, post-check=0, max-age=0, no-transform
Pragma: no-cache
Expires:
Accept-Ranges: none
X-Frame-Options: sameorigin
Set-Cookie: MoodleSession=6eib52k8alv2uhs6r26n6mh1qp; path=/
Content-Type: text/html; charset=utf-8

Can you check the DNS configuration? If you point the domain name to the new instance, it should work properly with the domain name.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.