Moodle 3.0.4-0109 on Synology NAS Changed IP Address Moodle No longer works

Moodle 3.0.4-0109 on Synology NAS Changed IP Address Moodle No longer works

by Rich Stockley -
Number of replies: 8

Hi All

I have had to change the IP address of our Synology NAS Cluster, and now Moodle is not working. I get this error.

This is only accessed from inside out network, not from outside.

There must be somewhere that I can change the old to the new IP address and off it goes...

Thanks in advance for your assistance


(I did look on this site for other postings, but they only related to external access to moodle)

Best Regards


Rich



Attachment moodle error.png
Average of ratings: -
In reply to Rich Stockley

Re: Moodle 3.0.4-0109 on Synology NAS Changed IP Address Moodle No longer works

by Just H -

Change it in your config.php.

In reply to Just H

Re: Moodle 3.0.4-0109 on Synology NAS Changed IP Address Moodle No longer works

by Joost Elshoff -
Picture of Particularly helpful Moodlers Picture of Testers
Most Synology NAS devices don't allow for modification of config.php as everything is well hidden from superuser's view through the DiskStationManager interface. I've come across this problem a number of times. 


This article from the Synology website might help you though:

https://www.synology.com/en-us/knowledgebase/DSM/help/WebStation/application_webserv_php

In reply to Joost Elshoff

Re: Moodle 3.0.4-0109 on Synology NAS Changed IP Address Moodle No longer works

by Rich Stockley -

I can get into the config.php, what would I need to change/add?


Regards


Rich



Attachment moodle config.php.png
In reply to Rich Stockley

Re: Moodle 3.0.4-0109 on Synology NAS Changed IP Address Moodle No longer works

by Rich Stockley -
Thanks very much for your replies, as you have come across this before, would you know how to get into the config.php to edit it using the correct way.
In reply to Rich Stockley

Re: Moodle 3.0.4-0109 on Synology NAS Changed IP Address Moodle No longer works

by Rich Stockley -

I now know how to login to the NAS in Linux, I can get to the root, so where do I go to find my config.php?

Regards

Rich

In reply to Rich Stockley

Re: Moodle 3.0.4-0109 on Synology NAS Changed IP Address Moodle No longer works

by Rich Stockley -

OK, I have figured it out, located and changed the config.php and everything now works fine.


I now understand why there is not much detailed help out there on Synology NAS's as you can REALLY ruin everything on your NAS, and becasue of that no one wants to be part of this.


Here's what I did, but I can't accept any responsibility if you damaged anything, or something doesn't work.


Synology NAS's run a Linux type of OS, so you'll need to know about command like dir, ls pwd and vi (the editor)

I managed to get inside the NAS by using Putty set to ssh.

Then I navigated to the installation folder of moodle (I did a bunch of screenshots as I installed moodle)


I learned the vi text editor by changing some text in the README.txt file in this folder, saving it and reviewing the results.

When I was satisfied that I understood what I was doing I changed the ip address in the config.php file and saved it, and exited the putty session.

I then entered the ip address in my the browser xxx.xxx.xxx.xxx/moodle

and bingo I was in.


Thanks for your assistance.


Rich


In reply to Rich Stockley

Re: Moodle 3.0.4-0109 on Synology NAS Changed IP Address Moodle No longer works

by Ken Task -
Picture of Particularly helpful Moodlers

Congrats!   Uhhhh .... you might not be done yet.

In moodle, every internal link to things moodle is recorded in the db for the site using the wwwroot variable ... ie, the IP address you changed in config.php.

So if you get 404 errors using internal links ... ie, notifications link, etc..  then you need to:

1. backup the DB ... sql dump ... I don't know how to do that on a NAS if that's where the DB server is.

2. run search and replace from the Moodle Admin UI:

http://ip/admin/tool/replace/

Search for http://oldip/ replace with http://newip/

That's a global all utility ... so that's why it's important to do #1 above first.

'spirit of sharing', Ken

In reply to Ken Task

Re: Moodle 3.0.4-0109 on Synology NAS Changed IP Address Moodle No longer works

by Rich Stockley -

Top bloke Ken, and thanks for the reply

I haven't gone too deeply into what works and what does not work, I'm just very happy that it's there at all.

I'll refer to this should I need it in future.

I really like your 'spirit of sharing' Ken

Regards


Rich